[Openal] double buffering audio playback
Filip Iliescu
djpriya at gmail.com
Thu Apr 12 09:58:13 PDT 2007
Ya, it seems that OpenAL buffers sounds for me correctly for wav
files. That is nice. Thank you all for the quick replies.
I have one more question. What is the coordinate system OpenAL uses to
place sources in the scene. It seems that Im having strange things
happen. two symptoms:
1) looping samples of 10 seconds or longer seem to stay positioned
with my listener. As I move my listener to extreme distances from the
source (in x and z) the song still plays like its right on top of my
source.
2) shorter samples that are looping can only be heard at very close
proximity. As I move my listener on top of them, the sounds are heard
perfectly. But as I move away it disapeers way to rapidly.
How can I better control the units of OpenAL's coordinate system and
match it to my viewport settings in OpenGL? and why doesnt the longer
sound dissapate with distance like the shorter sound does?
Thank you again.
On 4/12/07, Jason Daly <jdaly at ist.ucf.edu> wrote:
> 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