Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: TheLoneRanger on Tue 16/08/2011 19:28:11

Title: Problem with changing music / sound volume separately
Post by: TheLoneRanger on Tue 16/08/2011 19:28:11
  I’ve looked through the forums but can’t seem to find anything relevant to my problem.

 Whenever I use the  â€œGame.SetAudioTypeVolume” command to set  the music or sound volume to (0),  the sound is always reset to the default value whenever my player character talks to an NPC. But if I use the “System.Volume” to change the music & sound volume to (0) the volume is not reset when the player character talks to an NPC. But this won’t work for me because I need to be able to change the music and sound volumes separately.
 My game does not use audio voices, just text for talking.

 I have two sliders in my in-Game menu that change these settings and this is their code:


function sldMusic_OnChange(GUIControl *control)
{
 //This sets the music volume
 Game.SetAudioTypeVolume(eAudioTypeMusic, sldMusic.Value, eVolExistingAndFuture);
}

function sldSound_OnChange(GUIControl *control)
{
 // This sets the sound volume.
 Game.SetAudioTypeVolume(eAudioTypeSound, sldSound.Value, eVolExistingAndFuture);
 Game.SetAudioTypeVolume(eAudioTypeAmbientSound, sldSound.Value, eVolExistingAndFuture);
}


 I don’t know if this is the way it’s supposed to work, or if I’m doing something wrong. I’m pretty new to this sort of thing (game making and posting on forums). Is there anyone who could help me? Is there a work around for this?
By the way I’m using .wav for the sounds and .mp3 for the music. I’m running AGS 3.2.1 on a Windows XP SP3 Machine.
 Please let me know if I’m not being clear enough.
Title: Re: Problem with changing music / sound volume separately
Post by: pcj on Sat 10/09/2011 02:59:24
EDIT: [deleted, sorry about that]