| OpenAL Specification and Reference | ||
|---|---|---|
| <<< Previous | Buffers | Next >>> |
Table 1. Buffer FREQUENCY Attribute
| Name | Signature | Values | Default |
|---|---|---|---|
| FREQUENCY | float | none | (0, any] |
![]() | Annotation/ variable Frequency attribute |
|---|---|
As the implementation has to support conversion from one frequency to another to implement pitch, it is feasible to offer support for arbitrary sample frequencies, instead of restricting the application to an enumeration of supported sample frequencies. Another reason not to limit frequency to an enumerated set is that future hardware might support variable frequencies as well (it might be preferable to choose the sampling frequency according to the PSD of the signal then). However, it is desirable to avoid conversions due to differences between the sample frequency used in the original data, the frequency supported during the mixing, and the frequency expected by the output device. |
![]() | Annotation/ Implied Frequency |
|---|---|
To account for the possibility of future AL implementations supporting encoding formats for the application might not want, or be able, to retrieve the actual frequency from the encoded sample, the specification will be amended to guarantee the following behavior: If a nonzero frequency is specified, it will force a conversion from the actual to the requested frequency. If the application specifies a 0 frequency, AL will use the actual frequency. If there is no frequency information implied by the format or contained in the encoded data, specifying a 0 frequency will yield INVALID_VALUE. It is recommended that applications use IMPLIED instead of the literal value. |
![]() | Annotation: No Format query |
|---|---|
As of this time there is no query for FORMAT, or format related state information. Query of the channels or bits of a given buffer make little sense if the query the internal (canonical, not buffer specific) format. Query of the original sample data format makes little sense unless the implementation is obliged to preserve the original data. |
Table 2. Buffer SIZE Attribute
| Name | Signature | Values | Default |
|---|---|---|---|
| SIZE | ui | [0, MAX_UINT] | 0 |
Querying the attributes of a Buffer with a Name that is not valid throws an INVALID_OPERATION. Passing in a pname that is invalid throws an INVALID_VALUE error.
Buffer state is maintained inside the OpenAL implementation and can be queried in full. The valid values for the param parameter 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 data for non-streaming Buffers 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.
| <<< Previous | Home | Next >>> |
| Managing Buffer Names | Up | Processing Queue |