[Openal] Stereo Panning

Jason Daly jdaly at ist.ucf.edu
Fri Jun 29 08:49:38 PDT 2007


Paul Wilkinson wrote:
> We're implementing an audio system for 2D games and are trying to 
> decide between OpenAL and DirectX as a renderer.
>
> I read somewhere in the archives that stereo panning had to be 
> implemented manually. What exactly does this mean? Do I need to stream 
> and scale the sample data?

To put it simply, if you have a mono sound sample or stream, and you 
want to position it in 3D space, OpenAL will do this for you (including 
panning, distance attenuation, etc.). 

If you have a stereo sample or stream, OpenAL assumes that you want this 
to be played normally (not spatialized), so it will not apply any 
panning, attenuation, etc. 


>
> How exactly would I implement stereo panning of mono and stereo sources?
>

For a mono source, you simply set the listener and source's position, 
and OpenAL takes care of the rest.  For a stereo source, you'd have to 
do some more work.  A common method is to split the stereo sound into 
left/right mono sounds and render it using two sources.

-- 

--"J"

"I'm a castaway stranded in a desolate land,
 I can see the footprints in the virtual sand."
	--Neil Peart



More information about the Openal mailing list