Jibble

Author Topic: No Priority for Music and Sounds  (Read 241 times)

No Priority for Music and Sounds
« on: 08 Apr 2019, 21:18 »
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.

Re: No Priority for Music and Sounds
« Reply #1 on: 08 Apr 2019, 21:31 »
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

Re: No Priority for Music and Sounds
« Reply #2 on: 08 Apr 2019, 21:49 »
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.

Re: No Priority for Music and Sounds
« Reply #3 on: 08 Apr 2019, 22:22 »
Yes, but priority is not related to volume or relative loudness.

The music doesn't become quieter.
A lower priority will not make it quieter.

Re: No Priority for Music and Sounds
« Reply #4 on: 08 Apr 2019, 22:55 »
Yes, but priority is not related to volume or relative loudness.

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

  • Cavefish
  • Fleeing the Cylon tyrrany...
    • Cassiebsg worked on one or more games that won an AGS Award!
    •  
    • Cassiebsg worked on one or more games that was nominated for an AGS Award!
Re: No Priority for Music and Sounds
« Reply #5 on: 08 Apr 2019, 23:52 »
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...

Re: No Priority for Music and Sounds
« Reply #6 on: 09 Apr 2019, 09:50 »
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.

Re: No Priority for Music and Sounds
« Reply #7 on: 09 Apr 2019, 11:20 »
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

Re: No Priority for Music and Sounds
« Reply #8 on: 09 Apr 2019, 15:07 »
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.