iDevGames Forums

Full Version: OpenAL's 3D sound not so 3D
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I just compiled the source for OpenAL to include with my game and added my sound effects, and I got the sound playing. However, the sound output's left and right channels doesn't change with the scene. I change the listener's position and orientation each frame, and the object's position when they change. I set the context to use the default device. Any ideas to get the channel panning working?
are you using a mono sound?

stereo sounds aren't localized in AL.
That was the problem. Thanks.
Wait, mono sounds aren't localised? What does it do with the two channels in a stereo sound then? I thought the point was that it did the panning and such for you.

I guess that explains why my ogg music doesn't pan. Can you force the behavior on a source? So that you can have stereo music and mono sounds that use less memory/disk space.
He was saying that stereo sounds aren't localized, mono sounds are. It makes sense when you think about it: if it's already using both channels in a certain amount, how does it know about which one to use in how much when panning? Since it's not sure what you want, it does nothing. (it doesn't even fade with distance) With mono, however, it just does the calculations based on where the sound is. compared to the listener's location and orientation, since it only has one channel to deal with anyway. I'm sure you can emulate a stereo sound by having 2 sources that are a little bit apart, but I can't think of when you'd ever really want that. It makes it useful when doing music, though, since it doesn't change with position etc. (I just used QuickTime and MP3s for my music, though.)
*smack's forehead*

So I should read things closer.

Yeah, so as it turns out the ogg really is stereo. Blush That makes much more sense.
It certainly did seem bizarre that only stereo sounds would pan...
I can see where you were confused, because he asked if my sounds were mono and I said that was the problem. I was actually saying the problem was they were stereo and not mono. Seriously, though, you'd think that they'd include that minor requirement for it to work at all in the tutorials I was reading...
Reference URL's