Game Development Community

AudioEmitters - Upgrading

by Edward F. Maurina III · in Torque Game Engine · 07/01/2003 (9:08 pm) · 42 replies

Hi folks. I'm currently working on 'upgrading' the audioemitter object and I would like to get some input from the users, namely you. Currently the emitters are semi-functional but don't provide very good placement feedback and do not behave as I expect them to based on the parameters available. So, before I get into asking questions I'll give a quick run down on how I think they should work:

3D Mode (Looping->is3D == checked)
In this mode, the audio-emitter is a positional + directional emitter.

Directional Component - Two cones of sound to determine how angles affect the sound.

www.hallofworlds.com/pages/Torque/TorqueImages/SoundCone.jpg
The inner cone volume == 100% * Volume Modifiers
The outer cone volume == VAR% * Volume Modifiers
The rest of the area  == [i]coneOutsideVolume[/i] * Volume Modifiers

The direction of the cones is determined by: [i]coneVector[/i]

Positional Component - Distance from the emitter determines the other component of the sound equation.
[i]referenceDistance[/i] - If you are inside the inner cone and within this distance of the emitter, the volume is 100% (except in water).
[i]maxDistance[/i] - If you are outside of this distance, the emitter is off.

NON-3D Mode (Looping->is3D == unchecked)
In this mode, the sound is on at the same volume at all distances from the emitter (with one exception).
[i]outsideAmbient[/i] - Play the sound except when inside an interior.

Looping Settings
[i]isLooping[/i] - If checked, loop [i]loopCount[/i] times.
[i]loopCount[/i] - Number of times to play sound in looping mode. If -1, repeat forever.
[i]min/maxLoopGap[/i] - Still working this out.

Media Settings
[i]type[/i] - Chooses one of 30 (32?) OpenAL filters to apply to sound.

Current upgrades list
- It is my intention to make the emitters as behave described above. In the HEAD version of Torque, some of these features are working and some are not.
- Add better visual feedback for emitter placement. Curently, there is no way to see where the cones are. I am implementing a visual method of showing the following:
-- Inner Cone (DONE)
-- Outer Cone (DONE)
-- referenceDistance
-- maxDistance
-- Aproximate volume drop-off for inner cone.
- Fix spatial issue with 3D. Currently, the sounds are louder (in one ear) when you are facing away from the emitter at an angle than when you are facing them directly. Semi-mathematically, expressed:
- Total volume in right ear when emitter is directly 
       opposite that ear = X
     - Total volume when facing emitter directly < X.

www.hallofworlds.com/pages/Torque/TorqueImages/ae_90_90.jpgInner/Outer == 90/90

www.hallofworlds.com/pages/Torque/TorqueImages/ae_0_90.jpgInner/Outer == 0/90

www.hallofworlds.com/pages/Torque/TorqueImages/ae_60_90.jpgInner/Outer == 60/90

www.hallofworlds.com/pages/Torque/TorqueImages/ae_60_360.jpgInner/Outer == 60/360

www.hallofworlds.com/pages/Torque/TorqueImages/ae_270_360.jpgInner/Outer == 270/360


What I need from you
1. Do you disagree with any of my descriptions or do you have anything to add?
2. Can you think of any other reasonable features to add? (Now is the time).

Thanks in advance for your feedback.

-Ed
Page «Previous 1 2 3 Last »
#1
07/01/2003 (9:31 pm)
I like what you're doing. I was playing with the OpenAL SDK recently and saw how much functionality there could be, yet how much wasn't implemented. I think you've got the right idea, and the visual cues are impressive.

Someone at GG (possibly Jeff??) should set up an SDK forum for addressing sound issues. I got doppler effects working as they should, and will be putting together a patch that basically does what my resource does. I'd also like to get the audio environments working (the basis of the code is there, but it's all "todo"). Additionally, I would like to get some occlusion working in the future.

Drop me a line and let's get together on this!

- Brett
#2
07/01/2003 (9:43 pm)
I've got some code laying around somewhere where I got AudioEnvironments working. I need more people to test it out before posting it as a resource.
#3
07/01/2003 (9:50 pm)
@Brett - Are you still working on that patch? Enabling doppler effects in Torque. If not, I could incorporate it in this one and credit you if you want.

@Kurtis - Drop me some more details. What do you mean by working? Have you made code changes? If so, pls submit a patch or resource. That would be great.

-Ed
#4
07/02/2003 (11:46 am)
Brett, Edward,

Looks like you are both mathing great progress addressing some of the Audio issues. If you e-mail me patches I will make sure they get into the next release 1.2 (to be labeled soon).

--Rick
#5
07/02/2003 (9:05 pm)
@Edward - What you see in the resource is basically what I have. Without even modifying the individual objects, and only modifying the ShapeBase class, you have 99% of the doppler effect working. The only thing I have left to do, really, is get that patch to make projectiles emit sound. I'm gonna grab the latest head and make a patch with the doppler effects and projectile sound. If I have any problems (and considering it would be my *first* patch, I prolly will) I'll give ya a holler!
#6
07/02/2003 (9:09 pm)
@Brett - Sounds good. I'm currently puzzling over settransform() and hooking that to conevector(). Should be simple, but I'm getting some odd clamping (can't rotate beyond N degrees).
#7
07/03/2003 (8:22 pm)
Is conevector what is clamping, or is it settransform? And is it that you can rotate up to N degrees, but no more, each time? So, say it was 45 degrees, you would need to perform 4 rotations to move 180 degrees? Is it maybe expecting radians and you're supplying degrees? (I've made that mistake)
#8
07/03/2003 (9:29 pm)
@Brett - Thanks for the reply. Got the settransform thing figured. Just me being silly and "not seeing the forest for the trees". I'm just about done with the mods I'm going to make to this. I'm not going to incorporate your patch, on the assumption that you've submitted it. Thats easiest anyway, that way there isn't too much going on in one patch.

Thanks again,

Ed
#9
07/03/2003 (9:50 pm)
@Brett - Thanks for the reply. Got the settransform thing figured. Just me being silly and "not seeing the forest for the trees". I'm just about done with the mods I'm going to make to this. I'm not going to incorporate your patch, on the assumption that you've submitted it. Thats easiest anyway, that way there isn't too much going on in one patch.

Thanks again,

Ed
#10
07/03/2003 (9:51 pm)
Grrr. Well, I just wasted my fixes (backed up wrong code prior to getting latest for patch). Fortunately, I took notes. I'll probably submit the patch in the morning.

sigh...
#11
07/03/2003 (11:21 pm)
Ohh no... dual posts from Edward?! Either he is hitting refresh after submission to get latest posts or there is a forum problem here. :o

Edit: Well it looks like it's just an Edward problem ;)
#12
07/04/2003 (5:42 pm)
I've completed the work I'm going to do for now on this patch.
The patch includes:
- Allow rotation to affect cone vector.
- provided visual feedback mechanims for 3D MODE
- INNER_CONE
- 0..Referenced Distance => RED
- ReferenceDistance thru MaxDistance => RED Fading to BLACK
- OUTER CONE (only if OutsideVolume > 0)
- PURPLE
- OUTSIDE [remaining area] (only if OutsideVolume > 0)
- BLUE
- Provided 'Is Playing' Feedback
- Is Playing => Center Box GREEN
- Is Not Playing => Center Box BLACK
- Modified objectBuilderGui
- Modified code to insure that ConeVector is always used for AL_DIRECTION

Things not fixed/done:
- Was unable to fix spatial issue (louder at oblique angles)
- Did not add additional 3D sound effects.

Here is the patch:
Take me for a test drive!.

Here are some images:

www.hallofworlds.com/pages/Torque/TorqueImages/ae_final_360_0_0.jpgInner/Outer/OutsideVolume :: 360,0,0

www.hallofworlds.com/pages/Torque/TorqueImages/ae_final_45_90_50.jpgInner/Outer/OutsideVolume :: 45,90,0.5

www.hallofworlds.com/pages/Torque/TorqueImages/ae_final_90_270_0.jpgInner/Outer/OutsideVolume :: 90,270,0

www.hallofworlds.com/pages/Torque/TorqueImages/ae_final_90_270_50.jpgInner/Outer/OutsideVolume :: 0, 90, 0.5

www.hallofworlds.com/pages/Torque/TorqueImages/ae_final_0_0_50.jpgInner/Outer/OutsideVolume :: 0, 0, 0.5

www.hallofworlds.com/pages/Torque/TorqueImages/ae_final_on_box.jpgPLAYING

www.hallofworlds.com/pages/Torque/TorqueImages/ae_final_off_box.jpgNOT PLAYING

For those who want to see it in action without installing it, here is a video:
2.6MB AVI
This was captured with Fraps and copressed with VirtualDub. Way too cool and fun! Thanks to eXoDuS and Shinobi1 on the IRC for hooking me up with these.
#13
07/04/2003 (6:15 pm)
For projectile sound I suggest you check out this patch: http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=4201

That projectile patch, which adds water interaction to projectiles also gets the sound 'looping' for projectiles while traveling through the air.
#14
07/06/2003 (12:44 pm)
Sorry to keep waking this thread up, but I want it to be complete for future searches.

WARNING: Only use MONO audio files for emitters. You can use the freeware tool Audacity to convert stereo to mono.

Stereo with one silent track is not acceptable, only single track sounds will work. By work I mean that they will attenuate in 3D mode.

Thats all for now.

-Ed
#15
07/06/2003 (1:10 pm)
Edward,

This is really cool ! Works great. Only the maxDistance wasn't working but Brett Law has a solution here : www.garagegames.com/mg/forums/result.thread.php?qt=3852

With your patch + Robert's projectile patch + Brett's maxDistance fix, it's becoming really cool :)

Great work ! Thanks much !
#16
07/07/2003 (3:52 pm)
@Ed, does this patch work against head? Cause I couldn't check it in...
#17
07/07/2003 (6:37 pm)
Sorry I've been so quiet... Been busy with the house! I have a patch for doppler here. I haven't added the projectile sounds...

Here is the patch

- Brett
#18
08/06/2003 (9:17 am)
Edward. This looks really cool. One capability I'd like to see you incorporate, if possible, would be to permit streamed sounds to follow this model so that (say) voice chat could sounds louder in front of the speaker than on his flank. This would help players better understand when they were being addressed.

tone
#19
06/05/2004 (1:15 pm)
For all who have been waiting, I have finally re-done this code such that it works with the current HEAD version of Torque. I'm creating a patch now and will be submitting it today.
[HOW]EdM-EGTGE
#20
06/05/2004 (1:23 pm)
Edward!

You're my god!
Page «Previous 1 2 3 Last »