| OpenAL Specification and Reference | ||
|---|---|---|
| <<< Previous | Next >>> | |
A Buffer encapsulates AL state related to storing sample data. The application can request and release Buffer objects, and fill them with data. Data can be supplied compressed and encoded as long as the format is supported. Buffers can, internally, contain waveform data as uncompressed or compressed samples,
Unlike Sources and Listener, Buffer Objects can be shared among AL contexts. Buffers are referenced by Sources. A single Buffer can be referred to by multiple Sources. This separation allows driver and hardware to optimize storage and processing where applicable.
The simplest supported format for buffer data is PCM.
At this time, Buffer states are defined for purposes of discussion. The states described in this section are not exposed through the API (can not be queried, or be set directly), and the state description used in the implementation might differ from this.
A Buffer is considered to be in one of the following States, with respect to all Sources:
UNUSED: the Buffer is no included in any queue for any Source. In particular, the Buffer is neither pending nor current for any Source. The Buffer name can be deleted at this time.
PROCESSED: the Buffer is listed in the queue of at least one Source, but is neither pending nor current for any Source. The Buffer can be deleted as soon as it has been unqueued for all Sources it is queued with.
PENDING: there is at least one Source for which the Buffer has been queued, for which the Buffer data has not yet been dereferenced. The Buffer can only be unqueued for those Sources which have dereferenced the data in the Buffer in its entirety, and can not be deleted or changed.
A single queue entry with a single Source for which the Buffer is not yet PROCESSED propagates the buffer's queueing state to PENDING.
Buffers that are PROCESSED for a given Source can be unqueued from that Source's queue. Buffers that have been unqueued from all Sources are UNUSED. Buffers that are UNUSED can be deleted, or changed by BufferData commands.
| <<< Previous | Home | Next >>> |
| Source Objects | Managing Buffer Names |