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
Thanx alot!!
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 AudioProfilenew 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!!
About the author
Torque Owner AIDan
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