OpenAL's 3D sound not so 3D

Moderator
Posts: 1,140
Joined: 2005.07
Post: #1
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?
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
are you using a mono sound?

stereo sounds aren't localized in AL.
Quote this message in a reply
Moderator
Posts: 1,140
Joined: 2005.07
Post: #3
That was the problem. Thanks.
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #4
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.
Quote this message in a reply
Moderator
Posts: 1,140
Joined: 2005.07
Post: #5
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.)
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #6
*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...
Quote this message in a reply
Moderator
Posts: 1,140
Joined: 2005.07
Post: #7
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...
Quote this message in a reply
Post Reply