---
name: "al_load_audio_stream"
section: "3alleg5"
platform: "linux"
package: "allegro5-doc"
version: "2:5.2.10.1+dfsg-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/al_load_audio_stream/3alleg5"
---

# al\_load\_audio\_stream(3alleg5)

Allegro 5 API

## NAME

al\_load\_audio\_stream - Allegro 5 API

## SYNOPSIS

-

  ```
  #include <allegro5/allegro_audio.h>
  ALLEGRO_AUDIO_STREAM *al_load_audio_stream(const char *filename,
     size_t buffer_count, unsigned int samples)
  ```

## DESCRIPTION

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(3alleg5) 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(3alleg5), al\_register\_audio\_stream\_loader(3alleg5), al\_init\_acodec\_addon(3alleg5)
