al_load_audio_stream
ALLEGRO_AUDIO_STREAM *al_load_audio_stream(const char *filename,
size_t buffer_count, unsigned int samples)
Introduced in 5.0.0
Loads an audio file from disk as it is needed.
Unlike regular streams, the one returned by this function need not be fed by the user; the library will automatically read more of the file as it is needed. The stream will contain buffer_count buffers with samples samples.
The audio stream will start in the playing state. It should be attached to a voice or mixer to generate any output. See ALLEGRO_AUDIO_STREAM for more details.
Returns the stream on success, NULL on failure.
Note: the allegro_audio library does not support any audio file formats by default. You must use the allegro_acodec addon, or register your own format handler.
See also: al_load_audio_stream_f, al_register_audio_stream_loader, al_init_acodec_addon
Examples: ex_mixer_pp, ex_stream_file, ex_stream_seek
Most helpful discussions:
- Problem loading audio stream from tracker music file
- Dsound undefined reference error when compiling using 5.2.1 binaries
- Allegro 5.1.11 released!
- Random deadlocks playing WAV sounds (Windows, MSVC)
- al_load_sample's loading many data
- ALLEGRO_AUDIO_STREAM possible to add API to access the 'extra' ponter?
- Can only load .ogg??
- Streaming Multiple Audio Files At Once
- Audio drift in Allegro 5.1.8
- allegro audio stream improvements
Other recent discussions:
- [A5]ALLEGRO_SAMPLE_ID return id -1
- Play sound from file in memory
- destroy a newly loaded audio stream will cause program freeze.
- Allegro audio stream outputs no sound
- Looping MOD music
- Using dumb
- [A5] Problem with streaming sound
- Audio sounds weird
- Is A4 abandoned? (-1)
- Multiple audio stream causes static?