These functions are declared in the following header file. Link with allegro_acodec.

     #include <allegro5/allegro_acodec.h>

# al_init_acodec_addon

    bool al_init_acodec_addon(void)

Source Code

This function registers all the known audio file type handlers for al_load_sample, al_save_sample, al_load_audio_stream, etc.

Depending on what libraries are available, the full set of recognised extensions is: .wav, .flac, .ogg, .opus, .it, .mod, .s3m, .xm, .voc.

Limitations:

- Saving is only supported for wav files.

- The wav file loader currently only supports 8/16 bit little endian PCM files. 16 bits are used when saving wav files. Use flac files if more precision is required.

- Module files (.it, .mod, .s3m, .xm) are often composed with streaming in mind, and sometimes cannot be easily rendered into a finite length sample. Therefore they cannot be loaded with al_load_sample/al_load_sample_f and must be streamed with al_load_audio_stream or al_load_audio_stream_f.

- .voc file streaming is unimplemented.

Return true on success.

Examples:

- ex_stream_file.c
- ex_acodec_multi.c
- ex_kcm_direct.c

# al_is_acodec_addon_initialized

    bool al_is_acodec_addon_initialized(void)

Source Code

Returns true if the acodec addon is initialized, otherwise returns false.

Since: 5.2.6

# al_get_allegro_acodec_version

    uint32_t al_get_allegro_acodec_version(void)

Source Code

Returns the (compiled) version of the addon, in the same format as al_get_allegro_version.

Allegro version 5.2.11 - Last updated: 2026-02-09 02:00:43 UTC