No Priority for Music and Sounds

Started by Amir, Mon 08/04/2019 21:18:59

Previous topic - Next topic

Amir

Hi guys,

i would ask you something.
Music set to very low
Sounds set to normal

The music doesn't become quieter. I tried many things for example, sounds very high, music very low or low, there is still no priority.
Why doesn't work?  (wtf)

All filetypes r mp3
AGS version 3.4.1

Greetings
Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

morganw

There are only 8 audio channels, so the priority setting is for choosing which sound will be played when you run out of channels (e.g. if you try to play 9 sounds at the same time, the one with the lowest priority is ignored).
Volumes are separate, if you look at an AudioClip's properties you'll see one called DefaultVolume.

Here is the relevant manual page:
https://www.adventuregamestudio.co.uk/manual/ags13.htm#MusAndSound

Amir

Quote from: morganw on Mon 08/04/2019 21:31:43
There are only 8 audio channels, so the priority setting is for choosing which sound will be played when you run out of channels (e.g. if you try to play 9 sounds at the same time, the one with the lowest priority is ignored).
Volumes are separate, if you look at an AudioClip's properties you'll see one called DefaultVolume.

Here is the relevant manual page:
https://www.adventuregamestudio.co.uk/manual/ags13.htm#MusAndSound

I know that  :smiley: But my game has only 2 audio channels (until now), only music and sounds.   :smiley:
Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

morganw

Yes, but priority is not related to volume or relative loudness.

Quote from: Amir on Mon 08/04/2019 21:18:59
The music doesn't become quieter.
A lower priority will not make it quieter.

Amir

Quote from: morganw on Mon 08/04/2019 22:22:59
Yes, but priority is not related to volume or relative loudness.

Quote from: Amir on Mon 08/04/2019 21:18:59
The music doesn't become quieter.
A lower priority will not make it quieter.

Oh, ok i admit im wrong  :X So another question, is there something like VolumeReductionWhileSpeech for music but VolumeReductionWhile(SoundWillBePlayed) just a little bit quieter when a sound is playing???
Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

Cassiebsg

Not as far as I know, but if you really want to make that, you can code your own function where you reduce the music volume, then play the audio file, and after it increase the volume back up again...



There are those who believe that life here began out there...

Amir

Quote from: Cassiebsg on Mon 08/04/2019 23:52:41
Not as far as I know, but if you really want to make that, you can code your own function where you reduce the music volume, then play the audio file, and after it increase the volume back up again...


That would take a long time coz i have already 60 sounds in the game, and some of them are connected with frames  :-\ But i'll try that. Thank u.
Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

Crimson Wizard

Quote from: Amir on Tue 09/04/2019 09:50:09
That would take a long time coz i have already 60 sounds in the game, and some of them are connected with frames  :-\ But i'll try that. Thank u.

You could try writing a universal algorithm that does not account for individual clips but tests if any of sound type plays at the moment.

To put briefly, the idea is:
- keep a global variable that tells current state (music muted/unmuted).
- in repeatedly_execute_always test whether sound is playing and compare with the global variable.
- if state has changed, then mute/unmute current music volume.
- for starting music you would probably have to write a custom function to use instead of bare .Play(), that tests that variable and sets starting volume right away.

Most difficult part there imho is how to detect if sound is playing. If you have reserved channel(s) for Sound type, that may be pretty trivial though: you simply test if there's anything in that channel: System.AudioChannels[ sound channel number ].PlayingClip != null

Amir

Quote from: Crimson Wizard on Tue 09/04/2019 11:20:54
Quote from: Amir on Tue 09/04/2019 09:50:09
That would take a long time coz i have already 60 sounds in the game, and some of them are connected with frames  :-\ But i'll try that. Thank u.

You could try writing a universal algorithm that does not account for individual clips but tests if any of sound type plays at the moment.

To put briefly, the idea is:
- keep a global variable that tells current state (music muted/unmuted).
- in repeatedly_execute_always test whether sound is playing and compare with the global variable.
- if state has changed, then mute/unmute current music volume.
- for starting music you would probably have to write a custom function to use instead of bare .Play(), that tests that variable and sets starting volume right away.

Most difficult part there imho is how to detect if sound is playing. If you have reserved channel(s) for Sound type, that may be pretty trivial though: you simply test if there's anything in that channel: System.AudioChannels[ sound channel number ].PlayingClip != null

Cool, thank u so much. It sounds a little bit complicated but i will try to do it  ;-D
Truly, truly, I say to you, blessed are those who play adventure games, for theirs is the kingdom of heaven.

SMF spam blocked by CleanTalk