Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Stranga on Sun 22/01/2017 14:22:32

Title: Making Audio Slider for Music and Sound Channel?[SOLVED]
Post by: Stranga on Sun 22/01/2017 14:22:32
Hello everyone.

I'm not sure on how to go about this. I have made the GUI for the settings menu with the sliders and the global variables for the audio channels. Now I have the music one working fine but the sound one isn't working at all. Has anyone made this before and if so could possibly help me wrap my head around this.

Thank you in advanced.

here is the script I have set up

Code (ags) Select
global script

function game_start()
{
chansound = System.AudioChannels[3];
chanmusic = System.AudioChannels[2];
}

function SliderSound_OnChange(GUIControl *control)
{
   chansound.Volume= SliderSound.Value;
}


function SliderMusic_OnChange(GUIControl *control)
{
   chanmusic.Volume= SliderMusic.Value;
}
Title: Re: Making Audio Slider for Music and Sound Channel?
Post by: Khris on Sun 22/01/2017 14:38:00
You need Game.SetAudioTypeVolume() afaik.
Title: Re: Making Audio Slider for Music and Sound Channel?
Post by: Stranga on Sun 22/01/2017 14:45:20
Thanks for your help Khris. Where should I place that line of code?
Title: Re: Making Audio Slider for Music and Sound Channel?
Post by: Stranga on Sun 22/01/2017 15:17:35
Quote from: Khris on Sun 22/01/2017 14:38:00
You need Game.SetAudioTypeVolume() afaik.

Thank you very much! Works perfectly! :)