| OpenAL Specification and Reference | ||
|---|---|---|
| <<< Previous | Buffers | Next >>> |
This section lists the attributes that can be set, or queried, per Buffer. Note that some of these attributes can not be set using the Buffer commands, but are set using commands like BufferData.
Querying the attributes of a Buffer with a buffer name that is not valid throws an INVALID_OPERATION. Passing in an attribute name that is invalid throws an INVALID_VALUE error.
Table 1. Buffer FREQUENCY Attribute
| Name | Signature | Values | Default |
|---|---|---|---|
| FREQUENCY | float | none | (0, any] |
Table 2. Buffer SIZE Attribute
| Name | Signature | Values | Default |
|---|---|---|---|
| SIZE | sizei | [0, MAX_UINT] | 0 |
Buffer state is maintained inside the AL implementation and can be queried in full. The valid values for paramName are identical to the ones for Buffer*.
void GetBuffer{n}{sifd}{v} ( uint bufferName, enum paramName , T * values );
A special case of Buffer state is the actual sound sample data stored in asociation with the Buffer. Applications can specify sample data using BufferData.
void BufferData{n}{sifd}{v} ( uint bufferName, enum format, void *; data , sizei size , uint frequency);
Applications should always check for an error condition after attempting to specify buffer data in case an implementation has to generate an OUT_OF_MEMORY or conversion related INVALID_VALUE error. The application is free to reuse the memory specified by the data pointer once the call to BufferData returns. The implementation has to dereference, e.g. copy, the data during BufferData execution.
| <<< Previous | Home | Next >>> |
| Managing Buffer Names | Up | AL Contexts and the ALC API |