Sound questions
by Very Interactive Person · in Torque Game Builder · 12/16/2006 (6:51 am) · 5 replies
I have a couple of questions regarding sounds.
-I want to create a config GUI, with 2 sliders. One for the background music volume, the other for effect sound volume. My question is, how should I set this up so when the the user moves this slider, the sound volume changes? I noticed commands like setChannelVolume, but I don't see how to play sounds in a specific channel.
Anyone has an example?
-I noticed when sounds are playing at the same time, on some computers the sounds play louder. For example I have 1 sounds, and just before it ends, i play that same sound again. Now this second sounds volume is a lot louder then the first. This only happens on some computers. Should I play each sound in a different channel? and rotate trough channels or something? Or...? How do I fix this?
-I want to create a config GUI, with 2 sliders. One for the background music volume, the other for effect sound volume. My question is, how should I set this up so when the the user moves this slider, the sound volume changes? I noticed commands like setChannelVolume, but I don't see how to play sounds in a specific channel.
Anyone has an example?
-I noticed when sounds are playing at the same time, on some computers the sounds play louder. For example I have 1 sounds, and just before it ends, i play that same sound again. Now this second sounds volume is a lot louder then the first. This only happens on some computers. Should I play each sound in a different channel? and rotate trough channels or something? Or...? How do I fix this?
#2
12/16/2006 (7:56 am)
How do I create a channel... and how do I assign sounds to a specific channel? I must be missing something here...
#3
Then you would assign it to a description:
Then assign the description to an audio profile:
12/16/2006 (11:30 am)
Here is how you assign a channel:$MyAudioType = 2;
Then you would assign it to a description:
new AudioDescription(MyLoopingAudio)
{
volume = 1.0;
isLooping= true;
is3D = false;
type = $MyAudioType;
};Then assign the description to an audio profile:
new AudioProfile(MyCoolSound)
{
filename = "~/data/audio/myCoolSound.ogg";
description = "MyLoopingAudio";
preload = true;
};
#4
I've got the channel part but can someone give an example of this? Are prefs just variables?
05/26/2007 (7:30 pm)
Quote:I would create an audio channel for the music and one for the sound effects, then add a pref to each of them. once this is complete, you can associate a slider with each of the prefs. See your pref.cs or default prefs for an example.
I've got the channel part but can someone give an example of this? Are prefs just variables?
#5
05/27/2007 (10:15 pm)
Quote:Are prefs just variables?I think he said about a channel volume. Since the channel is a number from 0 to 31, you can associate sliders with each channel and change its value. So this value you can hold in a variable or not, it doesn't matter
Torque Owner Jon Jorajuria
Your sound question is an openAL issue and how sound cards process openAL. As far as fixing the issue, I would make sure the sound is playing at the appropriate length and/or the scripts are handling when to play the sound correctly.