[Openal] double buffering audio playback

Jason Daly jdaly at ist.ucf.edu
Thu Apr 12 07:51:47 PDT 2007


Filip Iliescu wrote:
>
> Given that Im using wav files and they are already preloaded into a
> single buffer per wav file, Im not sure if I need to do this per
> source. It would make sense to me that all the sources are mixed into
> a final listener buffer for output to device and maybe double
> buffering the listener would be good but Im assuming OpenAL takes care
> of that somewhere. Do I need to load a single wav file into two
> buffers and queue each up for playback per source? Seems like
> overkill.
>

I'm assuming that you just want to play just a one-shot or a looping 
sound from your various sources.  Since you're using sounds that are all 
loaded statically, there is no need to use the buffer queue.  You can 
simply assign a buffer to a source like this:

asSourcei(sourceID, AL_BUFFER, bufferID);

You can share the same buffer across multiple sources as well.  Does 
this help?

--"J"


More information about the Openal mailing list