Music & Sound volume drop during Speech

Started by TheJBurger, Mon 27/12/2010 19:42:38

Previous topic - Next topic

TheJBurger

When playing speech files in the game, sometimes music and/or sound volume level drops while the speech is playing. I want it to be so that all volume levels remain consistent during any dialog.

I looked this up in the manual and I found Game.SetAudioTypeSpeechVolumeDrop().

Quote from: AGS Manual
static Game.SetAudioTypeSpeechVolumeDrop(AudioType, int volumeReduction)

Changes the VolumeReductionWhileSpeechPlaying of the specified AudioType. This changes the setting, initially set in the Audio Types part of the editor. It specifies how much the volume of clips of this type will be reduced by while speech is playing.
Specify 0 for no volume adjustment, up to 100 which will completely silence these audio clips while speech is playing.

Right now in the function initialize_control_panel() in the global script I have this:

Code: ags

  Game.SetAudioTypeSpeechVolumeDrop(eAudioTypeAmbientSound, 0);
  Game.SetAudioTypeSpeechVolumeDrop(eAudioTypeMusic, 0);
  Game.SetAudioTypeSpeechVolumeDrop(eAudioTypeSound, 0);


But I still hear the volume drop for music & SFX during the game whenever speech is played.

Any thoughts?

Calin Leafshade

are you using the new audio types for music? or still PlayMusic()?

TheJBurger

Quote from: Calin Elephantsittingonface on Mon 27/12/2010 20:09:18
are you using the new audio types for music? or still PlayMusic()?

Mostly PlayMusic().

I think almost all of the audio script commands in the game are the old style, as the new audio types weren't supported when the game was first written.

Could that be causing the problem?

Dualnames

From the AGS Manual:
Quote
game.speech_music_drop    

How much to drop music volume when speech is played (default 60).
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Calin Leafshade

The functions you mentioned are part of the new audio scripting so perhaps PlayMusic() (which is not) is not affected by them

TheJBurger

Quote from: Calin Elephantsittingonface on Mon 27/12/2010 22:58:08
The functions you mentioned are part of the new audio scripting so perhaps PlayMusic() (which is not) is not affected by them

Maybe... it would take quite a bit of backtracking though to replace all the commands.  :-\

Quote from: Dualnames on Mon 27/12/2010 22:43:27
From the AGS Manual:
Quote
game.speech_music_drop    

How much to drop music volume when speech is played (default 60).
Yeah, I actually knew about this command from before but thought it was obsolete now in the new versions of AGS.

---

I tried putting in:
Code: ags

game.speech_music_drop=0;


I think it's working for the music so far. Do you know if there's another version of this command for AmbientSound and Sound to not cut out when speech plays? Those are still cutting out I think.

SMF spam blocked by CleanTalk