[Openal] Notification of buffers being processed
dpeacock at creativelabs.com
Mon Apr 2 18:29:00 PDT 2007
>Is there a way to tell if buffers in a queue have been processed other
>than polling AL_BUFFERS_PROCESSED?
No there isn't.
> At this point I'd like to give up CPU timeslices
> until one of the buffers is available to fill with the data. Currently
> I enter a loop querying AL_BUFFERS_PROCESSED and sleep for a few
> milliseconds if none are processed.
> Is this a good approach? Or is there a better way? If it is a
> reasonable approach is there a way of calculating an optimal time to
Is your code that checks for Processed Buffers in a separate thread ?
That's normally a good way of handling streaming. You can of course
calculate the duration of your Buffers if you know the sample format and
rate (and pitch if you are setting that parameter) .. but expect some
error, due to things like latency. The amount of time to sleep will be
dependent on the duration of your Buffers. e.g If you have 2 Buffers of
0.5 seconds, I would check the Buffers Processed every 100ms or so, so that
your Source continues to playback even if you miss a couple of timer
The information in this message is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this
message by anyone else is unauthorized. If you are not the intended
recipient, any disclosure, copying or distribution of the message, or
any action taken by you in reliance on it, is prohibited and may be
unlawful. If you have received this message in error, please delete it
and contact the sender immediately. Thank you.
<chris.double at dou
Sent by: openal at opensource.creative.com
openal-bounces at op cc
[Openal] Notification of buffers
Is there a way to tell if buffers in a queue have been processed other
than polling AL_BUFFERS_PROCESSED?
I've written a Vorbis and Theora player in the Factor programming
language  and am using Open AL for the sound. I have two buffers
that I use for storing the sound data. While one is playing I fill the
other with data.
At some point I have decoded Vorbis data available but both buffers
are still queued. At this point I'd like to give up CPU timeslices
until one of the buffers is available to fill with the data. Currently
I enter a loop querying AL_BUFFERS_PROCESSED and sleep for a few
milliseconds if none are processed.
Is this a good approach? Or is there a better way? If it is a
reasonable approach is there a way of calculating an optimal time to
Openal mailing list
Openal at opensource.creative.com
More information about the Openal