Main and MiscellaniousSummary | | | | | Stores the major and minor version of the library. | | Returns a string describing the last error encountered. | | Gets an array of device name strings from OpenAL. | | Frees the device name array returned from alureGetDeviceNames. | | Opens the named device, creates a context with the given attributes, and sets that context as current. | | Destroys the current context and closes its associated device. | | Retrieves an OpenAL format for the given sample format. | | Installs callbacks to enable ALURE to handle more file types. | | Rests the calling thread for the given number of seconds. |
alureGetVersionALURE_API void ALURE_APIENTRY alureGetVersion( | ALuint | * | major, | | ALuint | * | minor | ) |
|
Stores the major and minor version of the library. If either major or minor are NULL, that value is not provided.
alureGetErrorStringALURE_API const ALchar* ALURE_APIENTRY alureGetErrorString( | void | ) |
|
Returns a string describing the last error encountered.
alureGetDeviceNamesALURE_API const ALCchar** ALURE_APIENTRY alureGetDeviceNames( | ALCboolean | | all, | | ALCsizei | * | count | ) |
|
Gets an array of device name strings from OpenAL. This encapsulates AL_ENUMERATE_ALL_EXT (if supported and ‘all’ is true) and standard enumeration, with ‘count’ being set to the number of returned device names. ReturnsAn array of device name strings, or NULL on error. See AlsoalureFreeDeviceNames
alureFreeDeviceNamesALURE_API ALvoid ALURE_APIENTRY alureFreeDeviceNames( | const | ALCchar | ** | names | ) |
|
Frees the device name array returned from alureGetDeviceNames. See AlsoalureGetDeviceNames
alureInitDeviceALURE_API ALboolean ALURE_APIENTRY alureInitDevice( | const | ALCchar | * | name, | | const | ALCint | * | attribs | ) |
|
Opens the named device, creates a context with the given attributes, and sets that context as current. The name and attribute list would be the same as what’s passed to alcOpenDevice and alcCreateContext respectively. ReturnsAL_FALSE on error. See AlsoalureShutdownDevice
alureShutdownDeviceALURE_API ALboolean ALURE_APIENTRY alureShutdownDevice( | void | ) |
|
Destroys the current context and closes its associated device. ReturnsAL_FALSE on error. See AlsoalureInitDevice
alureGetSampleFormatALURE_API ALenum ALURE_APIENTRY alureGetSampleFormat( | ALuint | channels, | | ALuint | bits, | | ALuint | floatbits | ) |
|
Retrieves an OpenAL format for the given sample format. If bits is non-0, floatbits must be 0, and if floatbits is non-0, bits must be 0. The application should not rely on any particular format enum being returned as it is dependant on the available extensions. The returned format will be valid for the current context. Requires an active context. ReturnsAn OpenAL format enum for the given sample format, or AL_NONE if one can’t be found.
alureInstallDecodeCallbacksALURE_API ALboolean ALURE_APIENTRY alureInstallDecodeCallbacks( | | ALint | | index, | | void | * | (*open_file)(const ALchar *filename), | | void | * | (*open_memory)(const ALubyte *data, ALuint length), | | ALboolean | | (*get_format)(void *instance, ALenum *format, ALuint *samplerate, ALuint *blocksize), | | ALuint | | (*decode)(void *instance, ALubyte *data, ALuint bytes), | | ALboolean | | (*rewind)(void *instance), | | void | | (*close)(void *instance) | ) |
|
Installs callbacks to enable ALURE to handle more file types. The index is the order that each given set of callbacks will be tried, starting at the most negative number (INT_MIN) and going up. Negative indices will be tried before the built-in decoders, and positive indices will be tried after. Installing callbacks onto the same index multiple times will remove the previous callbacks, and removing old callbacks won’t affect any opened files using them (they’ll continue to use the old functions until properly closed, although newly opened files will use the new ones). Passing NULL for all callbacks is a valid way to remove an installed set, otherwise certain callbacks must be specified. Callbacks that are not specified will assume failure. Parametersopen_file | This callback is expected to open the named file and prepare it for decoding. If the callbacks cannot decode the file, NULL should be returned to indicate failure. Upon success, a non-NULL handle must be returned, which will be used as a unique identifier for the decoder instance. This callback is required if open_memory is not specified. | open_memory | This callback behaves the same as open_file, except it takes a memory segment for input instead of a filename. The given memory will remain valid while the instance is open. This callback is required if open_file is not specified. | get_format | This callback is used to retrieve the format of the decoded data for the given instance. It is the responsibility of the function to make sure the returned format is valid for the current AL context (eg. don’t return AL_FORMAT_QUAD16 if the AL_EXT_MCFORMATS extension isn’t available). Returning 0 for samplerate or blocksize, or returning AL_NONE for format, will cause a failure. Returning AL_FALSE indicates failure. This callback is required. | decode | This callback is called to get more decoded data. Up to the specified amount of bytes should be written to the data pointer. The number of bytes written should be a multiple of the block size, otherwise an OpenAL error may occur during buffering. The function should return the number of bytes written. This callback is required. | rewind | This callback is for rewinding the instance so that the next decode calls for it will get audio data from the start of the sound file. If the stream fails to rewind, AL_FALSE should be returned. | close | This callback is called at the end of processing for a particular instance. The handle will not be used further and any associated data may be deleted. |
ReturnsAL_FALSE on error.
alureSleepALURE_API ALboolean ALURE_APIENTRY alureSleep( | ALfloat | duration | ) |
|
Rests the calling thread for the given number of seconds. ReturnsAL_FALSE on error.
|