3d audio questions and issues
by Robert Garrett · in Torque Game Engine · 07/17/2002 (2:52 pm) · 7 replies
I'm currently working on implementing sounds for my spell system. The spells work the same as weapons, with a muzzle point and everything.
My first question has to do with the distance variables used in 3d audio descriptions. My current understanding is that minDistance represents the furthest radial distance away from the source at which the sound will still play at full volume, and the range between minDistance and MaxDistance is the area in which the sound volume fades as you move further from the source. Is this interpretation correct?
I've tried toying with those two variables, but they don't seem to have any effect when the sounds play. The sounds ARE playing in 3d, but they are very quiet and fade out way too quickly as you move away from the source.
Another question I have has to do with the way sounds are "heard" by the client. It's apparent that the current functionality bases sound "hearing" off the camera transform. Being that in my game the player can use 1st person or my modified 3rd person camera, I want the sound to be the same in either mode. I still have more research to do on it, but does anyone know offhand a way to base sound "listening" on the player transform instead of the camera?
-rob
My first question has to do with the distance variables used in 3d audio descriptions. My current understanding is that minDistance represents the furthest radial distance away from the source at which the sound will still play at full volume, and the range between minDistance and MaxDistance is the area in which the sound volume fades as you move further from the source. Is this interpretation correct?
I've tried toying with those two variables, but they don't seem to have any effect when the sounds play. The sounds ARE playing in 3d, but they are very quiet and fade out way too quickly as you move away from the source.
Another question I have has to do with the way sounds are "heard" by the client. It's apparent that the current functionality bases sound "hearing" off the camera transform. Being that in my game the player can use 1st person or my modified 3rd person camera, I want the sound to be the same in either mode. I still have more research to do on it, but does anyone know offhand a way to base sound "listening" on the player transform instead of the camera?
-rob
#2
Anyway, I've been looking through source and scripts alike to track down these audio description variables. One thing I immediately noticed is that minDistance does not even appear to exist in the console function declaration in audioDatablock.cc. It does, however, appear in the DirectX8 header file dsound.h.
Again, if anyone could provide some insight on the specifics of these distance variables, it would be appreciated. I'll continue my research and post any findings here.
-rob
07/17/2002 (3:24 pm)
Yes, I've actually looked through every thread I could find on audio and sound. In fact, you'll notice I had already posted in the thread you just provided the link for. After looking through these forums, I feel my questions and concerns vary enough from the other posts to warrant this new thread.Anyway, I've been looking through source and scripts alike to track down these audio description variables. One thing I immediately noticed is that minDistance does not even appear to exist in the console function declaration in audioDatablock.cc. It does, however, appear in the DirectX8 header file dsound.h.
Again, if anyone could provide some insight on the specifics of these distance variables, it would be appreciated. I'll continue my research and post any findings here.
-rob
#3
And at least you can get sounds to fade. Mine play in 3D but they dont seem to move with the object they are attached to(ie: positional sound doesnt work for me) :/
07/17/2002 (7:41 pm)
minDistance has been replaced with ReferenceDistance in the sound datablock.And at least you can get sounds to fade. Mine play in 3D but they dont seem to move with the object they are attached to(ie: positional sound doesnt work for me) :/
#4
By the way Robert, what I mean by sounds fading is that the further you are from the source, the quieter the sound becomes. Even that is only working properly on my notebook, but not my desktop. My sound sources don't actually move in either case.
-rob
07/18/2002 (1:26 pm)
OK, so I was basically right about the purpose of the distance variables, except that referenceDistance replaces MaxDistance as the furthest distance from the sound source that still plays the sound at full volume. That makes sense, but that really threw me for a loop with minDistance being used in the example code that comes with the SDK.By the way Robert, what I mean by sounds fading is that the further you are from the source, the quieter the sound becomes. Even that is only working properly on my notebook, but not my desktop. My sound sources don't actually move in either case.
-rob
#5
I had created some tailored audio descriptions for my spell sounds in the server's audioProfiles.cs script. At one point I renamed a pair of descriptions associated with a particular spell. Later on, I revised them again back to their original descriptions. After doing that, those sounds would no longer play on a client machine in a multiplayer game.
For the last two days I've been trying to track down why this has been happening. I checked the wav files and all kinds of reconfiguring in the declaration and calling of those audio profiles. It's been quite a maddening process, but I think I've discovered something.
I believe that, somewhere in the scripts or engine code, those datablock audio descriptions and/or profiles are being cached. I'm not talking about the .dso files, because I've already tried deleting all of them to force recompiling of all the scripts. I think this caching is happening somewhere else, but have absolutely no clue where.
Would really appreciate if anyone can provide some insight on this, or tell me that I'm completely wrong about this whole caching thing and send me further into lunacy =).
-rob
07/19/2002 (7:43 pm)
OK, some progress has been made, but a new, very strange issue has arisen.I had created some tailored audio descriptions for my spell sounds in the server's audioProfiles.cs script. At one point I renamed a pair of descriptions associated with a particular spell. Later on, I revised them again back to their original descriptions. After doing that, those sounds would no longer play on a client machine in a multiplayer game.
For the last two days I've been trying to track down why this has been happening. I checked the wav files and all kinds of reconfiguring in the declaration and calling of those audio profiles. It's been quite a maddening process, but I think I've discovered something.
I believe that, somewhere in the scripts or engine code, those datablock audio descriptions and/or profiles are being cached. I'm not talking about the .dso files, because I've already tried deleting all of them to force recompiling of all the scripts. I think this caching is happening somewhere else, but have absolutely no clue where.
Would really appreciate if anyone can provide some insight on this, or tell me that I'm completely wrong about this whole caching thing and send me further into lunacy =).
-rob
#6
Lunacy draws closer.
-rob
07/19/2002 (8:30 pm)
It also appears that the profiles in the server audioProfiles script only work if they remain in the same order. If I move them around they start screwing up.Lunacy draws closer.
-rob
#7
08/21/2002 (6:33 am)
Any developments on this Robert?
Torque Owner Mike Stoddart
www.garagegames.com/index.php?sec=mg&mod=forums&page=result.thread&qt=5028