Hi,
I have these audio channels in the function function game_start()
Code: ags They are also defined as global variables. Then I have 3 sliders to control the volume:
Code: ags But every time an audio plays, I have to indicate its volume afterwards, because if I don't do it, it has the volume at 100%:
Code: ags Is there any way not to have to indicate each time its volume? Maybe this can be done in a more correct way. Thanks!
I have these audio channels in the function function game_start()
chansound = System.AudioChannels[1]; //ambient sound
chanmusic = System.AudioChannels[2]; //music
chanSoundE1 = System.AudioChannels[3]; //sound effect
chanSoundE2 = System.AudioChannels[4]; //sound effect
chanSoundE3 = System.AudioChannels[5]; //sound effect
function Slider1_OnChange(GUIControl *control) //ambient sound.
{
Game.SetAudioTypeVolume(eAudioTypeAmbientSound, Slider1.Value, eVolExistingAndFuture);
chansound.Volume = Slider1.Value;
}
function Slider2_OnChange(GUIControl *control) //Music.
{
Game.SetAudioTypeVolume(eAudioTypeMusic, Slider2.Value, eVolExistingAndFuture);
chanmusic.Volume = Slider2.Value;
}
function Slider3_OnChange(GUIControl *control) //sound effect.
{
Game.SetAudioTypeVolume(eAudioTypeSound, Slider3.Value, eVolExistingAndFuture);
chanSoundE1.Volume = Slider3.Value;
chanSoundE2.Volume = Slider3.Value;
chanSoundE3.Volume = Slider3.Value;
}
chanmusic = aHideout.Play();
chanmusic.Volume = Slider2.Value;