Interior and Audio Emitter
by Radoslaw Marcin Kurczewski · in Torque Game Engine · 01/04/2004 (10:07 pm) · 13 replies
Hi,
My level is a city and I would like to put (in some specific places) some Audio Emitters. I don't want one environmental sound for whole city but a few in different places (that's why I talk about Audio Emitters).
I'm able to put them there but I can't hear any sound at all. I noticed that if I move my camera outside this interior, sound appears immediately, but inside I can hear nothing!
Any idea what's wrong?
Best regards
Ania
My level is a city and I would like to put (in some specific places) some Audio Emitters. I don't want one environmental sound for whole city but a few in different places (that's why I talk about Audio Emitters).
I'm able to put them there but I can't hear any sound at all. I noticed that if I move my camera outside this interior, sound appears immediately, but inside I can hear nothing!
Any idea what's wrong?
Best regards
Ania
#2
I found that AmbientAudioManager::update() is responsible for my trouble and particulary one flag called 'mOutsideScale'.
It's set to '0' if you are inside interior. This value is used in AmbientAudioManager::updateEmitter() function to multiply with emmiter volume. So, every time you are inside interior, sound emmiters volume is set to 0.
I removed this multiplication and it works for me quite fine right now :)
Regards
Ania
01/06/2004 (9:00 pm)
Hi again,I found that AmbientAudioManager::update() is responsible for my trouble and particulary one flag called 'mOutsideScale'.
It's set to '0' if you are inside interior. This value is used in AmbientAudioManager::updateEmitter() function to multiply with emmiter volume. So, every time you are inside interior, sound emmiters volume is set to 0.
I removed this multiplication and it works for me quite fine right now :)
Regards
Ania
#3
I have the same problem as Louis my emmitters will only work when i click on them in the world editor. I tried the the fix that Ania mentioned code looks like this:
void AmbientAudioManager::updateEmitter(AudioEmitter * emitter)
{
if(emitter->mOutsideAmbient && (emitter->mAudioHandle != NULL_AUDIOHANDLE))
alxSourcef(emitter->mAudioHandle, AL_GAIN_LINEAR, emitter->mDescription.mVolume /* mOutsideScale*/);
}
however it still won't play until i click on it inside the world editor????
Can anyone suggest anything???
09/23/2005 (3:06 am)
I know this thread is a bit old but i thought i should just continue to post here rather than start a new thread.I have the same problem as Louis my emmitters will only work when i click on them in the world editor. I tried the the fix that Ania mentioned code looks like this:
void AmbientAudioManager::updateEmitter(AudioEmitter * emitter)
{
if(emitter->mOutsideAmbient && (emitter->mAudioHandle != NULL_AUDIOHANDLE))
alxSourcef(emitter->mAudioHandle, AL_GAIN_LINEAR, emitter->mDescription.mVolume /* mOutsideScale*/);
}
however it still won't play until i click on it inside the world editor????
Can anyone suggest anything???
#4
11/08/2005 (6:22 am)
I have just been playing with audio emitters, I have the same problem as above....
#5
HELP!!!!!!
11/08/2005 (7:46 am)
We at ATOMIX have been working on this problem for some time and our results are equally bad. We have great environmental sounds for Ocean, Birds Etc. and want to put them into games. We bought the BraveTree Environmental Pack with the Birds and tried to attach a 3D AudioProfile of a bird cawing to it and could find no way to apply. When I asked for help with this I was simply told to take the Audio Tutorial. Well I took it and I still can't make it work. The other problem is even worse and I will post in Bug area. In the Waterblock parameters area in the World Editor is a place for AudioEnvironment, every time I put something in there it dissapears. I made a AudioProfile for it and tried to place the name in there. Hit apply and it dissapears. Then tried to manually enter it in the .mis file and it dissapeared. No ocean sounds will be emitted. I cannot get Audio Emitters to work at all.HELP!!!!!!
#6
12/11/2005 (10:37 pm)
Hey, not fair. Torque engine audio emitter is broken. You have to write the audio code yourself in C++ and recompile the engine. That's the only way. Looks like the Torque programmers took out the working code and pasted in a non-functional code. :(
#7
12/13/2005 (3:05 pm)
As you can see from this post the powers that be here are ignoring us about the problem and I wish they would address this. I am still trying to hear that stupid bird and witout noise that's is all it is. A stupid bird.
#8
12/14/2005 (1:25 pm)
Who said we are ignoring you?
#9
12/14/2005 (3:41 pm)
Where's the fix?
#10
What version of TGE are you using? v1.3 doesn't work very well and has some bugs. If you are using v1.4 then there is hope. Do this...
datablock AudioProfile(ChirpEffect)
{
filename = "~/data/sound/chirp.wav";
description = "AudioDefaultLooping3d";
preload = false;
};
Its quite complicated why this works without going into the C++ code of the engine and byte code and stuff. I built a 3D audio system in C++ to get around this problem but found that it was just a little quirk in the engine that they left danggling in the code itself. Of course they're not finished with the engine so some of the code is just sitting there loosely. Try it, it works!
12/14/2005 (5:34 pm)
Shon,What version of TGE are you using? v1.3 doesn't work very well and has some bugs. If you are using v1.4 then there is hope. Do this...
datablock AudioProfile(ChirpEffect)
{
filename = "~/data/sound/chirp.wav";
description = "AudioDefaultLooping3d";
preload = false;
};
Its quite complicated why this works without going into the C++ code of the engine and byte code and stuff. I built a 3D audio system in C++ to get around this problem but found that it was just a little quirk in the engine that they left danggling in the code itself. Of course they're not finished with the engine so some of the code is just sitting there loosely. Try it, it works!
#11
12/14/2005 (5:36 pm)
We are working on the problems with the sound layer. Expect to hear more soon.
#12
I got the audio emitter to work real good, but only the directional portion of it is a problem. I created an outer and inner audio cone with a span of 120 and 90 degrees respectively. I pointed it in the positive Y direction 0 1 0. I tried changing the direction of the pointing vector but in the world editor it doesn't show that it was changed. Also, since this is a directional audio emitter shouldn't the sound go to zero when you are standing behind the cone?
12/14/2005 (10:11 pm)
I have no qualms to any of Garage Games people. They have given us a great engine and I am a seasoned programmer and some of thier code just blows my mind. It's great stuff. It would take you years if you tried to reinvent this wheel !@#$ I'd use thier engine any day! :)I got the audio emitter to work real good, but only the directional portion of it is a problem. I created an outer and inner audio cone with a span of 120 and 90 degrees respectively. I pointed it in the positive Y direction 0 1 0. I tried changing the direction of the pointing vector but in the world editor it doesn't show that it was changed. Also, since this is a directional audio emitter shouldn't the sound go to zero when you are standing behind the cone?
#13
OK this is what I discovered looking through the few posts and articles on Audio. I never did find an Audio Tutorial.
I found AudioEmitters to be a 3 stage process.
First use the AudioDescription in starter.fps/server/audioProfiles.cs
You will be given a dialog for Audio Emitters. Type in a name for your emitter and then in the pulldown select your AudioProfile from the list.
Then use the pulldown to select your AudioDescription.
You don't have to Click on the button for your audio filename. Notice it is already defined in your AudioProfile. Follow the dialog and experiment a bit.
This is what the AudioEmitter in the .mis file looks like.

Now if we could just set this up on a path for birds and other flying thingies.
I would appreciate anyone out there sharing any ideas on implementing this on paths. Paths seem to take the biggest CPU hit and we really had to cut down on the size and number of paths in our level. So I don't really want to place an AudioEmitter at each path marker, because we may use a marker for multiple paths or as an intersection point and that would mean multiple AudioEmitters on that marker. What would be nice is if there was a way to attach a sound or AudioStream to a .dts that had a 3d environment. As you move closer yada yada. This would be a nicwe addition ton the datablock descripbing the item. This may already be available, but I can't find it. I hypothesize something along the line of a vehicle which can have sounds attached to it, such as acceleration and braking. I will continue to investigate this avenue.
Don't get me wrong guys. I may complain, but after spending 30+ years programming a ton of systems in 15 or so different languages. I love the GarageGames setup and own all of the source code packs, TGE, TSE, RTS and LP. Almost everything they make and that includes several content packs. I love you guys work and love the community. But there are still major holes in the learning cycle. I have used many SDK's in my career and have never found one that took so long to learn. Most have learning curves of about 2 weeks. But this is one extremely complicated system and the discovery curve is almost like having Christmas all year long.
Anyhoo hope this helps a little and I will continue the quest. Audio Rules!!!
Shon Gale
VP Research & Development
ATOMIX Productions
www.theatomizer.com
12/15/2005 (6:47 am)
Thanks Matt. Nice to hear from ya. Read the post on the 1.4 AL problems. OK this is what I discovered looking through the few posts and articles on Audio. I never did find an Audio Tutorial.
I found AudioEmitters to be a 3 stage process.
First use the AudioDescription in starter.fps/server/audioProfiles.cs
datablock AudioDescription(AudioClosest3d)
{
volume = 1.0;
isLooping= false;
is3D = true;
ReferenceDistance= 5.0;
MaxDistance= 30.0;
type = $SimAudioType;
};Next setup an AudioProfiledatablock AudioProfile(OceanWaves)
{
filename = "base/data/sound/Ocean.ogg"; // Your sound file
description = "AudioDefaultLooping3d"; // see above datablock
preload = false; // Don't preload
};Then go into the game editor (F11) and find where you want your sound to be. Hit (F4) and select Mission Objects then click environment.You will be given a dialog for Audio Emitters. Type in a name for your emitter and then in the pulldown select your AudioProfile from the list.
Then use the pulldown to select your AudioDescription.
You don't have to Click on the button for your audio filename. Notice it is already defined in your AudioProfile. Follow the dialog and experiment a bit.
This is what the AudioEmitter in the .mis file looks like.

new AudioEmitter(OceanAudio) {
position = "-115.252 39.0507 25.2";
rotation = "1 0 0 0";
scale = "1 1 1";
profile = "OceanWaves";
useProfileDescription = "1";
fileName = "0";
type = "2";
volume = "1";
outsideAmbient = "1";
referenceDistance = "5";
maxDistance = "35";
isLooping = "1";
loopCount = "-1";
minLoopGap = "0";
maxLoopGap = "0";
enableVisualFeedback = "1";
is3D = "1";
coneInsideAngle = "90";
coneOutsideAngle = "120";
coneOutsideVolume = "0.25";
coneVector = "0 1 0";
};This appears to work great for mini environments such as groves of trees, Buildings and other small areas. When I used it on a large ocean file I had to put in multiple emitters. I couldn't set a range like you can with triggers and so I worry about the CPU hit with lots of emitters. I only setup one so I can't comment on that.Now if we could just set this up on a path for birds and other flying thingies.
I would appreciate anyone out there sharing any ideas on implementing this on paths. Paths seem to take the biggest CPU hit and we really had to cut down on the size and number of paths in our level. So I don't really want to place an AudioEmitter at each path marker, because we may use a marker for multiple paths or as an intersection point and that would mean multiple AudioEmitters on that marker. What would be nice is if there was a way to attach a sound or AudioStream to a .dts that had a 3d environment. As you move closer yada yada. This would be a nicwe addition ton the datablock descripbing the item. This may already be available, but I can't find it. I hypothesize something along the line of a vehicle which can have sounds attached to it, such as acceleration and braking. I will continue to investigate this avenue.
Don't get me wrong guys. I may complain, but after spending 30+ years programming a ton of systems in 15 or so different languages. I love the GarageGames setup and own all of the source code packs, TGE, TSE, RTS and LP. Almost everything they make and that includes several content packs. I love you guys work and love the community. But there are still major holes in the learning cycle. I have used many SDK's in my career and have never found one that took so long to learn. Most have learning curves of about 2 weeks. But this is one extremely complicated system and the discovery curve is almost like having Christmas all year long.
Anyhoo hope this helps a little and I will continue the quest. Audio Rules!!!
Shon Gale
VP Research & Development
ATOMIX Productions
www.theatomizer.com
Torque Owner Louis Dufresne