ALmixer  0.0.5
Data Structures | Macros | Typedefs | Functions
Load Audio Functions

Functions for loading and unloading audio data. More...

Data Structures

struct  ALmixer_AudioInfo
 Roughly the equvialent to the Sound_AudioInfo struct in SDL_sound. More...
 

Macros

#define ALMIXER_DEFAULT_BUFFERSIZE   16384
 
#define ALMIXER_DEFAULT_PREDECODED_BUFFERSIZE   ALMIXER_DEFAULT_BUFFERSIZE * 4
 
#define ALMIXER_DEFAULT_QUEUE_BUFFERS   12
 Specifies the maximum number of queue buffers to use for a sound stream. More...
 
#define ALMIXER_DEFAULT_STARTUP_BUFFERS   4
 Specifies the number of queue buffers initially filled when first loading a stream. More...
 
#define ALMIXER_DEFAULT_BUFFERS_TO_QUEUE_PER_UPDATE_PASS   2
 

Typedefs

typedef struct ALmixer_Data ALmixer_Data
 

Functions

ALmixer_DataALmixer_LoadSample_RW (struct ALmixer_RWops *rw_ops, const char *file_ext, ALuint buffer_size, ALboolean decode_mode_is_predecoded, ALuint max_queue_buffers, ALuint num_startup_buffers, ALuint suggested_number_of_buffers_to_queue_per_update_pass, ALuint access_data)
 This is a general loader function to load an audio resource from an RWops. More...
 
ALmixer_DataALmixer_LoadStream_RW (struct ALmixer_RWops *rw_ops, const char *file_ext, ALuint buffer_size, ALuint max_queue_buffers, ALuint num_startup_buffers, ALuint suggested_number_of_buffers_to_queue_per_update_pass, ALuint access_data)
 This is the loader function to load an audio resource from an RWops as a stream. More...
 
ALmixer_DataALmixer_LoadAll_RW (struct ALmixer_RWops *rw_ops, const char *file_ext, ALuint access_data)
 This is the loader function to completely preload an audio resource from an RWops into RAM. More...
 
ALmixer_DataALmixer_LoadSample (const char *file_name, ALuint buffer_size, ALboolean decode_mode_is_predecoded, ALuint max_queue_buffers, ALuint num_startup_buffers, ALuint suggested_number_of_buffers_to_queue_per_update_pass, ALuint access_data)
 This is a general loader function to load an audio resource from a file. More...
 
ALmixer_DataALmixer_LoadStream (const char *file_name, ALuint buffer_size, ALuint max_queue_buffers, ALuint num_startup_buffers, ALuint suggested_number_of_buffers_to_queue_per_update_pass, ALuint access_data)
 This is the loader function to load an audio resource from a file. More...
 
ALmixer_DataALmixer_LoadAll (const char *file_name, ALuint access_data)
 This is the loader function to completely preload an audio resource from a file into RAM. More...
 
ALmixer_DataALmixer_LoadSample_RAW_RW (struct ALmixer_RWops *rw_ops, const char *file_ext, ALmixer_AudioInfo *desired_format, ALuint buffer_size, ALboolean decode_mode_is_predecoded, ALuint max_queue_buffers, ALuint num_startup_buffers, ALuint suggested_number_of_buffers_to_queue_per_update_pass, ALuint access_data)
 This is a back door general loader function for RAW samples or if you need to specify the ALmixer_AudioInfo field. More...
 
ALmixer_DataALmixer_LoadStream_RAW_RW (struct ALmixer_RWops *rw_ops, const char *file_ext, ALmixer_AudioInfo *desired_format, ALuint buffer_size, ALuint max_queue_buffers, ALuint num_startup_buffers, ALuint suggested_number_of_buffers_to_queue_per_update_pass, ALuint access_data)
 This is a back door stream loader function for RAW samples or if you need to specify the ALmixer_AudioInfo field. More...
 
ALmixer_DataALmixer_LoadAll_RAW_RW (struct ALmixer_RWops *rw_ops, const char *file_ext, ALmixer_AudioInfo *desired_format, ALuint access_data)
 This is a back door loader function for complete preloading RAW samples into RAM or if you need to specify the ALmixer_AudioInfo field. More...
 
ALmixer_DataALmixer_LoadSample_RAW (const char *file_name, ALmixer_AudioInfo *desired_format, ALuint buffer_size, ALboolean decode_mode_is_predecoded, ALuint max_queue_buffers, ALuint num_startup_buffers, ALuint suggested_number_of_buffers_to_queue_per_update_pass, ALuint access_data)
 This is a back door general loader function for RAW samples or if you need to specify the ALmixer_AudioInfo field. More...
 
ALmixer_DataALmixer_LoadStream_RAW (const char *file_name, ALmixer_AudioInfo *desired_format, ALuint buffer_size, ALuint max_queue_buffers, ALuint num_startup_buffers, ALuint suggested_number_of_buffers_to_queue_per_update_pass, ALuint access_data)
 This is a back door stream loader function for RAW samples or if you need to specify the ALmixer_AudioInfo field. More...
 
ALmixer_DataALmixer_LoadAll_RAW (const char *file_name, ALmixer_AudioInfo *desired_format, ALuint access_data)
 This is a back door loader function for complete preloading RAW samples into RAM or if you need to specify the ALmixer_AudioInfo field. More...
 
void ALmixer_FreeData (ALmixer_Data *almixer_data)
 Frees an ALmixer_Data. More...
 
ALboolean ALmixer_IsPredecoded (ALmixer_Data *almixer_data)
 Returns true if the almixer_data was completely loaded into memory or false if it was loaded as a stream. More...
 

Detailed Description

Functions for loading and unloading audio data.

Macro Definition Documentation

◆ ALMIXER_DEFAULT_BUFFERS_TO_QUEUE_PER_UPDATE_PASS

#define ALMIXER_DEFAULT_BUFFERS_TO_QUEUE_PER_UPDATE_PASS   2

◆ ALMIXER_DEFAULT_BUFFERSIZE

#define ALMIXER_DEFAULT_BUFFERSIZE   16384

◆ ALMIXER_DEFAULT_PREDECODED_BUFFERSIZE

#define ALMIXER_DEFAULT_PREDECODED_BUFFERSIZE   ALMIXER_DEFAULT_BUFFERSIZE * 4

◆ ALMIXER_DEFAULT_QUEUE_BUFFERS

#define ALMIXER_DEFAULT_QUEUE_BUFFERS   12

Specifies the maximum number of queue buffers to use for a sound stream.

Default Queue Buffers must be at least 2.

◆ ALMIXER_DEFAULT_STARTUP_BUFFERS

#define ALMIXER_DEFAULT_STARTUP_BUFFERS   4

Specifies the number of queue buffers initially filled when first loading a stream.

Default startup buffers should be at least 1.

Typedef Documentation

◆ ALmixer_Data

typedef struct ALmixer_Data ALmixer_Data

Function Documentation

◆ ALmixer_FreeData()

void ALmixer_FreeData ( ALmixer_Data almixer_data)

Frees an ALmixer_Data.

Releases the memory associated with a ALmixer_Data. Use this when you are done playing the audio sample and wish to release the memory.

Warning
Do not try releasing data that is currently in use (e.g. playing, paused).
Make sure to free your data before calling ALmixer_Quit. Do not free data after ALmixer_Quit(). The implementation may partly handle this case, particularly if you use the hack ALmixer_QuitWithoutFreeData() instead. However, the behavior is considered risky and the hack only exists to deal with systems like garbage collection where order isn't deterministic.
Parameters
almixer_dataThe ALmixer_Data* you want to free.

◆ ALmixer_IsPredecoded()

ALboolean ALmixer_IsPredecoded ( ALmixer_Data almixer_data)

Returns true if the almixer_data was completely loaded into memory or false if it was loaded as a stream.

Parameters
almixer_dataThe audio resource you want to know about.
Returns
AL_TRUE is predecoded, or AL_FALSE if streamed.

◆ ALmixer_LoadAll()

ALmixer_Data* ALmixer_LoadAll ( const char *  file_name,
ALuint  access_data 
)

This is the loader function to completely preload an audio resource from a file into RAM.

Parameters
file_nameThe file to the audio resource you want to load.
access_dataA boolean that specifies if you want the data contained in the currently playing buffer to be handed to you in a callback function. Note that for predecoded data, you get back the entire buffer in one callback when the audio first starts playing. With streamed data, you get the data in buffer_size chunks. Callbacks are not guarnanteed to be perfectly in-sync as this is a best-effort implementaiton. There are memory and performance considerations for using this feature, so if you don't need data callbacks, you should pass false to this function.
Returns
Returns an ALmixer_Data* of the loaded sample or NULL if failed.

◆ ALmixer_LoadAll_RAW()

ALmixer_Data* ALmixer_LoadAll_RAW ( const char *  file_name,
ALmixer_AudioInfo desired_format,
ALuint  access_data 
)

This is a back door loader function for complete preloading RAW samples into RAM or if you need to specify the ALmixer_AudioInfo field.

Use at your own risk.

Parameters
file_nameThe file to the audio resource you want to load. Extension should be "raw" for raw formats.
desired_formatThe format you want audio decoded to. NULL will pick a default for you.
access_dataA boolean that specifies if you want the data contained in the currently playing buffer to be handed to you in a callback function. Note that for predecoded data, you get back the entire buffer in one callback when the audio first starts playing. With streamed data, you get the data in buffer_size chunks. Callbacks are not guarnanteed to be perfectly in-sync as this is a best-effort implementaiton. There are memory and performance considerations for using this feature, so if you don't need data callbacks, you should pass false to this function.
Returns
Returns an ALmixer_Data* of the loaded sample or NULL if failed.

◆ ALmixer_LoadAll_RAW_RW()

ALmixer_Data* ALmixer_LoadAll_RAW_RW ( struct ALmixer_RWops rw_ops,
const char *  file_ext,
ALmixer_AudioInfo desired_format,
ALuint  access_data 
)

This is a back door loader function for complete preloading RAW samples into RAM or if you need to specify the ALmixer_AudioInfo field.

Use at your own risk.

Parameters
rw_opsThe rwops pointing to the audio resource you want to load. Note: The RWops will automatically be closed for you. Do not call RW_Close yourself.
file_extThe file extension of your audio type which is used as a hint by the backend to decide which decoder to use. Pass "raw" for raw formats.
desired_formatThe format you want audio decoded to. NULL will pick a default for you.
access_dataA boolean that specifies if you want the data contained in the currently playing buffer to be handed to you in a callback function. Note that for predecoded data, you get back the entire buffer in one callback when the audio first starts playing. With streamed data, you get the data in buffer_size chunks. Callbacks are not guarnanteed to be perfectly in-sync as this is a best-effort implementaiton. There are memory and performance considerations for using this feature, so if you don't need data callbacks, you should pass false to this function.
Returns
Returns an ALmixer_Data* of the loaded sample or NULL if failed.

◆ ALmixer_LoadAll_RW()

ALmixer_Data* ALmixer_LoadAll_RW ( struct ALmixer_RWops rw_ops,
const char *  file_ext,
ALuint  access_data 
)

This is the loader function to completely preload an audio resource from an RWops into RAM.

Parameters
rw_opsThe rwops pointing to the audio resource you want to load. Note: The RWops will automatically be closed for you. Do not call RW_Close yourself.
file_extThe file extension of your audio type which is used as a hint by the backend to decide which decoder to use.
access_dataA boolean that specifies if you want the data contained in the currently playing buffer to be handed to you in a callback function. Note that for predecoded data, you get back the entire buffer in one callback when the audio first starts playing. With streamed data, you get the data in buffer_size chunks. Callbacks are not guarnanteed to be perfectly in-sync as this is a best-effort implementaiton. There are memory and performance considerations for using this feature, so if you don't need data callbacks, you should pass false to this function.
Returns
Returns an ALmixer_Data* of the loaded sample or NULL if failed.

◆ ALmixer_LoadSample()

ALmixer_Data* ALmixer_LoadSample ( const char *  file_name,
ALuint  buffer_size,
ALboolean  decode_mode_is_predecoded,
ALuint  max_queue_buffers,
ALuint  num_startup_buffers,
ALuint  suggested_number_of_buffers_to_queue_per_update_pass,
ALuint  access_data 
)

This is a general loader function to load an audio resource from a file.

Generally, you should use the LoadStream and LoadAll specializations of this function instead which call this.

Parameters
file_nameThe file of the audio resource you want to load.
buffer_sizeThe size of a buffer to allocate for read chunks. This number should be in quantized with the valid frame sizes of your audio data. If the data is streamed, the data will be read in buffer_size chunks. If the file is to be predecoded, optimizations may occur and this value might be ignored.
decode_mode_is_predecodedSpecifies whether you want to completely preload the data or stream the data in chunks.
max_queue_buffersFor streamed data, specifies the maximum number of buffers that can be queued at any given time.
num_startup_buffersFor streamed data, specifies the number of buffers to fill before playback starts. Buffer underrun conditions will also attempt to restart using this value.
suggested_number_of_buffers_to_queue_per_update_passFor each ALmixer_Update() pass, this is the targeted number of buffers that will be queued.
access_dataA boolean that specifies if you want the data contained in the currently playing buffer to be handed to you in a callback function. Note that for predecoded data, you get back the entire buffer in one callback when the audio first starts playing. With streamed data, you get the data in buffer_size chunks. Callbacks are not guarnanteed to be perfectly in-sync as this is a best-effort implementaiton. There are memory and performance considerations for using this feature, so if you don't need data callbacks, you should pass false to this function.
Returns
Returns an ALmixer_Data* of the loaded sample or NULL if failed.

◆ ALmixer_LoadSample_RAW()

ALmixer_Data* ALmixer_LoadSample_RAW ( const char *  file_name,
ALmixer_AudioInfo desired_format,
ALuint  buffer_size,
ALboolean  decode_mode_is_predecoded,
ALuint  max_queue_buffers,
ALuint  num_startup_buffers,
ALuint  suggested_number_of_buffers_to_queue_per_update_pass,
ALuint  access_data 
)

This is a back door general loader function for RAW samples or if you need to specify the ALmixer_AudioInfo field.

Use at your own risk. Generally, you should use the LoadStream and LoadAll specializations of this function instead which call this.

Parameters
file_nameThe file to the audio resource you want to load. Extension should be "raw" for raw formats.
desired_formatThe format you want audio decoded to. NULL will pick a default for you.
buffer_sizeThe size of a buffer to allocate for read chunks. This number should be in quantized with the valid frame sizes of your audio data. If the data is streamed, the data will be read in buffer_size chunks. If the file is to be predecoded, optimizations may occur and this value might be ignored.
decode_mode_is_predecodedSpecifies whether you want to completely preload the data or stream the data in chunks.
max_queue_buffersFor streamed data, specifies the maximum number of buffers that can be queued at any given time.
num_startup_buffersFor streamed data, specifies the number of buffers to fill before playback starts. Buffer underrun conditions will also attempt to restart using this value.
suggested_number_of_buffers_to_queue_per_update_passFor each ALmixer_Update() pass, this is the targeted number of buffers that will be queued.
access_dataA boolean that specifies if you want the data contained in the currently playing buffer to be handed to you in a callback function. Note that for predecoded data, you get back the entire buffer in one callback when the audio first starts playing. With streamed data, you get the data in buffer_size chunks. Callbacks are not guarnanteed to be perfectly in-sync as this is a best-effort implementaiton. There are memory and performance considerations for using this feature, so if you don't need data callbacks, you should pass false to this function.
Returns
Returns an ALmixer_Data* of the loaded sample or NULL if failed.

◆ ALmixer_LoadSample_RAW_RW()

ALmixer_Data* ALmixer_LoadSample_RAW_RW ( struct ALmixer_RWops rw_ops,
const char *  file_ext,
ALmixer_AudioInfo desired_format,
ALuint  buffer_size,
ALboolean  decode_mode_is_predecoded,
ALuint  max_queue_buffers,
ALuint  num_startup_buffers,
ALuint  suggested_number_of_buffers_to_queue_per_update_pass,
ALuint  access_data 
)

This is a back door general loader function for RAW samples or if you need to specify the ALmixer_AudioInfo field.

Use at your own risk. Generally, you should use the LoadStream and LoadAll specializations of this function instead which call this.

Parameters
rw_opsThe rwops pointing to the audio resource you want to load. Note: The RWops will automatically be closed for you. Do not call RW_Close yourself.
file_extThe file extension of your audio type which is used as a hint by the backend to decide which decoder to use. Pass "raw" for raw formats.
desired_formatThe format you want audio decoded to. NULL will pick a default for you.
buffer_sizeThe size of a buffer to allocate for read chunks. This number should be in quantized with the valid frame sizes of your audio data. If the data is streamed, the data will be read in buffer_size chunks. If the file is to be predecoded, optimizations may occur and this value might be ignored.
decode_mode_is_predecodedSpecifies whether you want to completely preload the data or stream the data in chunks.
max_queue_buffersFor streamed data, specifies the maximum number of buffers that can be queued at any given time.
num_startup_buffersFor streamed data, specifies the number of buffers to fill before playback starts. Buffer underrun conditions will also attempt to restart using this value.
suggested_number_of_buffers_to_queue_per_update_passFor each ALmixer_Update() pass, this is the targeted number of buffers that will be queued.
access_dataA boolean that specifies if you want the data contained in the currently playing buffer to be handed to you in a callback function. Note that for predecoded data, you get back the entire buffer in one callback when the audio first starts playing. With streamed data, you get the data in buffer_size chunks. Callbacks are not guarnanteed to be perfectly in-sync as this is a best-effort implementaiton. There are memory and performance considerations for using this feature, so if you don't need data callbacks, you should pass false to this function.
Returns
Returns an ALmixer_Data* of the loaded sample or NULL if failed.

◆ ALmixer_LoadSample_RW()

ALmixer_Data* ALmixer_LoadSample_RW ( struct ALmixer_RWops rw_ops,
const char *  file_ext,
ALuint  buffer_size,
ALboolean  decode_mode_is_predecoded,
ALuint  max_queue_buffers,
ALuint  num_startup_buffers,
ALuint  suggested_number_of_buffers_to_queue_per_update_pass,
ALuint  access_data 
)

This is a general loader function to load an audio resource from an RWops.

Generally, you should use the LoadStream and LoadAll specializations of this function instead which call this.

Parameters
rw_opsThe rwops pointing to the audio resource you want to load. Note: The RWops will automatically be closed for you. Do not call RW_Close yourself.
file_extThe file extension of your audio type which is used as a hint by the backend to decide which decoder to use.
buffer_sizeThe size of a buffer to allocate for read chunks. This number should be in quantized with the valid frame sizes of your audio data. If the data is streamed, the data will be read in buffer_size chunks. If the file is to be predecoded, optimizations may occur and this value might be ignored.
decode_mode_is_predecodedSpecifies whether you want to completely preload the data or stream the data in chunks.
max_queue_buffersFor streamed data, specifies the maximum number of buffers that can be queued at any given time.
num_startup_buffersFor streamed data, specifies the number of buffers to fill before playback starts. Buffer underrun conditions will also attempt to restart using this value.
suggested_number_of_buffers_to_queue_per_update_passFor each ALmixer_Update() pass, this is the targeted number of buffers that will be queued.
access_dataA boolean that specifies if you want the data contained in the currently playing buffer to be handed to you in a callback function. Note that for predecoded data, you get back the entire buffer in one callback when the audio first starts playing. With streamed data, you get the data in buffer_size chunks. Callbacks are not guarnanteed to be perfectly in-sync as this is a best-effort implementaiton. There are memory and performance considerations for using this feature, so if you don't need data callbacks, you should pass false to this function.
Returns
Returns an ALmixer_Data* of the loaded sample or NULL if failed.

◆ ALmixer_LoadStream()

ALmixer_Data* ALmixer_LoadStream ( const char *  file_name,
ALuint  buffer_size,
ALuint  max_queue_buffers,
ALuint  num_startup_buffers,
ALuint  suggested_number_of_buffers_to_queue_per_update_pass,
ALuint  access_data 
)

This is the loader function to load an audio resource from a file.

Parameters
file_nameThe file to the audio resource you want to load.
buffer_sizeThe size of a buffer to allocate for read chunks. This number should be in quantized with the valid frame sizes of your audio data. If the data is streamed, the data will be read in buffer_size chunks.
max_queue_buffersFor streamed data, specifies the maximum number of buffers that can be queued at any given time.
num_startup_buffersFor streamed data, specifies the number of buffers to fill before playback starts. Buffer underrun conditions will also attempt to restart using this value.
suggested_number_of_buffers_to_queue_per_update_passFor each ALmixer_Update() pass, this is the targeted number of buffers that will be queued. *
num_startup_buffersFor streamed data, specifies the number of buffers to fill before playback starts. Buffer underrun conditions will also attempt to restart using this value.
suggested_number_of_buffers_to_queue_per_update_passFor each ALmixer_Update() pass, this is the targeted number of buffers that will be queued.
access_dataA boolean that specifies if you want the data contained in the currently playing buffer to be handed to you in a callback function. Note that for predecoded data, you get back the entire buffer in one callback when the audio first starts playing. With streamed data, you get the data in buffer_size chunks. Callbacks are not guarnanteed to be perfectly in-sync as this is a best-effort implementaiton. There are memory and performance considerations for using this feature, so if you don't need data callbacks, you should pass false to this function.
Returns
Returns an ALmixer_Data* of the loaded sample or NULL if failed.

◆ ALmixer_LoadStream_RAW()

ALmixer_Data* ALmixer_LoadStream_RAW ( const char *  file_name,
ALmixer_AudioInfo desired_format,
ALuint  buffer_size,
ALuint  max_queue_buffers,
ALuint  num_startup_buffers,
ALuint  suggested_number_of_buffers_to_queue_per_update_pass,
ALuint  access_data 
)

This is a back door stream loader function for RAW samples or if you need to specify the ALmixer_AudioInfo field.

Use at your own risk.

Parameters
file_nameThe file to the audio resource you want to load.Extension should be "raw" for raw formats.
desired_formatThe format you want audio decoded to. NULL will pick a default for you.
buffer_sizeThe size of a buffer to allocate for read chunks. This number should be in quantized with the valid frame sizes of your audio data. If the data is streamed, the data will be read in buffer_size chunks. If the file is to be predecoded, optimizations may occur and this value might be ignored.
max_queue_buffersFor streamed data, specifies the maximum number of buffers that can be queued at any given time.
num_startup_buffersFor streamed data, specifies the number of buffers to fill before playback starts. Buffer underrun conditions will also attempt to restart using this value.
suggested_number_of_buffers_to_queue_per_update_passFor each ALmixer_Update() pass, this is the targeted number of buffers that will be queued.
access_dataA boolean that specifies if you want the data contained in the currently playing buffer to be handed to you in a callback function. Note that for predecoded data, you get back the entire buffer in one callback when the audio first starts playing. With streamed data, you get the data in buffer_size chunks. Callbacks are not guarnanteed to be perfectly in-sync as this is a best-effort implementaiton. There are memory and performance considerations for using this feature, so if you don't need data callbacks, you should pass false to this function.
Returns
Returns an ALmixer_Data* of the loaded sample or NULL if failed.

◆ ALmixer_LoadStream_RAW_RW()

ALmixer_Data* ALmixer_LoadStream_RAW_RW ( struct ALmixer_RWops rw_ops,
const char *  file_ext,
ALmixer_AudioInfo desired_format,
ALuint  buffer_size,
ALuint  max_queue_buffers,
ALuint  num_startup_buffers,
ALuint  suggested_number_of_buffers_to_queue_per_update_pass,
ALuint  access_data 
)

This is a back door stream loader function for RAW samples or if you need to specify the ALmixer_AudioInfo field.

Use at your own risk.

Parameters
rw_opsThe rwops pointing to the audio resource you want to load. Note: The RWops will automatically be closed for you. Do not call RW_Close yourself.
file_extThe file extension of your audio type which is used as a hint by the backend to decide which decoder to use. Pass "raw" for raw formats.
desired_formatThe format you want audio decoded to. NULL will pick a default for you.
buffer_sizeThe size of a buffer to allocate for read chunks. This number should be in quantized with the valid frame sizes of your audio data. If the data is streamed, the data will be read in buffer_size chunks. If the file is to be predecoded, optimizations may occur and this value might be ignored.
max_queue_buffersFor streamed data, specifies the maximum number of buffers that can be queued at any given time.
num_startup_buffersFor streamed data, specifies the number of buffers to fill before playback starts. Buffer underrun conditions will also attempt to restart using this value.
suggested_number_of_buffers_to_queue_per_update_passFor each ALmixer_Update() pass, this is the targeted number of buffers that will be queued.
access_dataA boolean that specifies if you want the data contained in the currently playing buffer to be handed to you in a callback function. Note that for predecoded data, you get back the entire buffer in one callback when the audio first starts playing. With streamed data, you get the data in buffer_size chunks. Callbacks are not guarnanteed to be perfectly in-sync as this is a best-effort implementaiton. There are memory and performance considerations for using this feature, so if you don't need data callbacks, you should pass false to this function.
Returns
Returns an ALmixer_Data* of the loaded sample or NULL if failed.

◆ ALmixer_LoadStream_RW()

ALmixer_Data* ALmixer_LoadStream_RW ( struct ALmixer_RWops rw_ops,
const char *  file_ext,
ALuint  buffer_size,
ALuint  max_queue_buffers,
ALuint  num_startup_buffers,
ALuint  suggested_number_of_buffers_to_queue_per_update_pass,
ALuint  access_data 
)

This is the loader function to load an audio resource from an RWops as a stream.

Parameters
rw_opsThe rwops pointing to the audio resource you want to load. Note: The RWops will automatically be closed for you. Do not call RW_Close yourself.
file_extThe file extension of your audio type which is used as a hint by the backend to decide which decoder to use.
buffer_sizeThe size of a buffer to allocate for read chunks. This number should be in quantized with the valid frame sizes of your audio data. If the data is streamed, the data will be read in buffer_size chunks.
max_queue_buffersFor streamed data, specifies the maximum number of buffers that can be queued at any given time.
num_startup_buffersFor streamed data, specifies the number of buffers to fill before playback starts. Buffer underrun conditions will also attempt to restart using this value.
suggested_number_of_buffers_to_queue_per_update_passFor each ALmixer_Update() pass, this is the targeted number of buffers that will be queued.
access_dataA boolean that specifies if you want the data contained in the currently playing buffer to be handed to you in a callback function. Note that for predecoded data, you get back the entire buffer in one callback when the audio first starts playing. With streamed data, you get the data in buffer_size chunks. Callbacks are not guarnanteed to be perfectly in-sync as this is a best-effort implementaiton. There are memory and performance considerations for using this feature, so if you don't need data callbacks, you should pass false to this function.
Returns
Returns an ALmixer_Data* of the loaded sample or NULL if failed.