Sound engine
by Vern Jensen · in Torque Game Builder · 08/28/2006 (3:42 pm) · 24 replies
We really need a lot more built-in support for having control over sounds, without having to do dump(), or look at the C source, to figure out what's going on. For instance:
- Ability to specify the stereo panning of a sound (its balance in left vs. right speakers)
- Function to tell if a given sound is currently playing, and if so, how long (in milliseconds) it has been playing
- Option to play a sound in such a way that it stops any previous playback of that same sample
Hmm, I'm sure there's more.... But this would be a good start.
Currently, if you have an event trigger a sound to play, and lots of that event occur at almost the same time, then you get a huge amplification in sound volume for that sound, because all the sounds are overlapping and playing at nearly the same time, which sounds terrible. Two of the above suggestions are intended to allow the developer to avoid this problem.
- Ability to specify the stereo panning of a sound (its balance in left vs. right speakers)
- Function to tell if a given sound is currently playing, and if so, how long (in milliseconds) it has been playing
- Option to play a sound in such a way that it stops any previous playback of that same sample
Hmm, I'm sure there's more.... But this would be a good start.
Currently, if you have an event trigger a sound to play, and lots of that event occur at almost the same time, then you get a huge amplification in sound volume for that sound, because all the sounds are overlapping and playing at nearly the same time, which sounds terrible. Two of the above suggestions are intended to allow the developer to avoid this problem.
#22
But at least it DOES work on my Mac. Now I just need to figure out why it only works for some sounds, and not for others.
09/01/2006 (1:18 pm)
Okay, even more strangeness. The playing with 0, 0, 0 works just fine on my Mac, and playing with 0.1 doesn't make it super-loud. It just plays the same as it would with 1. Odd. But at least it DOES work on my Mac. Now I just need to figure out why it only works for some sounds, and not for others.
#23
I've love to hear from a GarageGames employee if this is intended behavior. Does this mean I can't have stereo sounds if I want 3D positioning?
09/01/2006 (1:28 pm)
Okay, with looking at the WAV files, it appears that the sounds that respond well to 3D positioning are *mono* sounds. The ones that are unaffected are *stereo* sounds. I've love to hear from a GarageGames employee if this is intended behavior. Does this mean I can't have stereo sounds if I want 3D positioning?
#24
09/01/2006 (1:39 pm)
Ah yes, that is a very good point. I do recall something about that, perhaps in the old-old TGE docs, or a blurb from a GG employee on the forums. In TGE, I recall using almost exclusively mono sounds, probably for this very reason. Been a couple of years since I did TGE stuff though, so I've forgotten most of the details. :)
Torque Owner Vern Jensen
When I use:
it makes the volume *incredibly* loud. No doubt the 0.1 for the x direction, and 0's for the other 2, means the source is right on top of you, so it's like it's overdriving the sound effect's volume. And when I use
*nothing* plays. It's like it is "too close" and/or too loud to play.
TO GARAGE GAMES STAFF:
If anyone is reading this thread. Hopefully you see we have need for better documentation of the audio functions. Currently it's "try this and see if that works" or "let's see what this does".