---
name: "al_play_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_play_audio_stream/3alleg5"
---

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

Allegro 5 API

## NAME

al\_play\_audio\_stream - Allegro 5 API

## SYNOPSIS

-

  ```
  #include <allegro5/allegro_audio.h>
  ALLEGRO_AUDIO_STREAM *al_play_audio_stream(const char *filename)
  ```

## DESCRIPTION

Loads and plays an audio file, streaming from disk as it is needed. This API can only play one audio stream at a time. This requires a default mixer to be set, which is typically done via al\_reserve\_samples(3alleg5), but can also be done via al\_set\_default\_mixer(3alleg5).

Returns the stream on success, NULL on failure. You must not destroy the returned stream, it will be automatically destroyed when the addon is shut down.

*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\_play\_audio\_stream\_f(3alleg5), al\_load\_audio\_stream(3alleg5)

## SINCE

5\.2.8

*\[Unstable API\]:* New API.
