[Openal] set or enqueue buffer?
Chris Robinson
chris.kcat at gmail.com
Wed Jun 6 20:27:43 PDT 2007
On Wednesday 06 June 2007 07:19:01 pm uray meiviar wrote:
> what is the difference between
> void alSourcei( ALuint source, ALenum param, ALint value );
> and
> void alSourceQueueBuffers( ALuint source, ALsizei n, ALuint* buffers );
> ?
alSourceQueueBuffers allows you to queue one or more buffers to a source,
where alSourcei(..., AL_BUFFER, ...) only allows you to set one. When a
source is played, it'll set buffers to an internal state of "processed" when
it's done playing their data. From here, with queued buffers you could
unqueue the oldest processed buffer, refill it, then requeue it while another
buffer is playing on the source (such is how streaming in AL is done). If you
queue one or more buffers, you can queue more later on, although with
AL_BUFFER, you can only set one buffer at a time.
A queued buffer stays queued even after it plays, and you can stop and replay
a source even if its buffers are queued. The main difference is likely that,
queued buffers are streamed as-needed (so it can deal with buffers being
unqueued and requeued in real-time), where buffers set with AL_BUFFER can be
stored for more efficient mixing.
More information about the Openal
mailing list