Game Development Community

changing sound volume on-the-fly?

by Stefan Beffy Moises · in Torque Game Engine · 06/22/2002 (9:19 am) · 2 replies

Hi there!
Is there a way to change a specific sound volume on the fly?
E.g. I got an AudioDescription
new AudioDescription(AudioMusic)
{
   volume   = 0.8;
   isLooping = true;
   isStreaming = true;
   is3D     = false;
   type     = $DefaultAudioType;
};
and an AudioProfile
new AudioProfile(Mission_Music) {
      fileName = "~/data/sound/music/Track10.ogg";
      description = "AudioMusic";
      preload = "0";
   };
Can I change the volume of Mission_Music temporaily (while another sound - a car engine - should still play at normal volume)??
Thanx alot!!

#1
06/22/2002 (4:30 pm)
new AudioDescription(AudioMusic)
{
   volume   = 0.8;
   isLooping = true;
   isStreaming = true;
   is3D     = false;
   type     = $DefaultMusicType;
};

new AudioProfile(Mission_Music) {
      fileName = "~/data/sound/music/Track10.ogg";
      description = "AudioMusic";
      preload = "0";
   };

You have to use an own channel if you want to change the musics volume without changing the other sounds' volume.

alxSetChannelVolume($DefaultMusicType, 0.5);

greetings
Daniel
#2
06/23/2002 (12:43 am)
Works like a charm!! Thanks a lot!! :-)