Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: TheJBurger on Mon 27/12/2010 19:42:38

Title: Music & Sound volume drop during Speech
Post by: TheJBurger on Mon 27/12/2010 19:42:38
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:


  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?
Title: Re: Music & Sound volume drop during Speech
Post by: Calin Leafshade on Mon 27/12/2010 20:09:18
are you using the new audio types for music? or still PlayMusic()?
Title: Re: Music & Sound volume drop during Speech
Post by: TheJBurger on Mon 27/12/2010 20:34:48
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?
Title: Re: Music & Sound volume drop during Speech
Post by: 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).
Title: Re: Music & Sound volume drop during Speech
Post by: Calin Leafshade 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
Title: Re: Music & Sound volume drop during Speech
Post by: TheJBurger on Tue 28/12/2010 20:26:13
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:

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.