How do I...?

Control Volume Settings at Run Time

As an example, we will create a project with two buttons: a volume increase button, and a volume decrease button.

  1. Insert the following code into the On Click event of the volume increase button:

audio_channel = CHANNEL_USER1;
Audio.SetVolume(audio_channel, Audio.GetVolume(audio_channel)+20);

  1. Insert the following code into the On Click event of the volume decrease button:

audio_channel = CHANNEL_USER1;
Audio.SetVolume(audio_channel, Audio.GetVolume(audio_channel)-20);