---
name: "al_get_sample"
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_get_sample/3alleg5"
---

# al\_get\_sample(3alleg5)

Allegro 5 API

## NAME

al\_get\_sample - Allegro 5 API

## SYNOPSIS

-

  ```
  #include <allegro5/allegro_audio.h>
  ALLEGRO_SAMPLE *al_get_sample(ALLEGRO_SAMPLE_INSTANCE *spl)
  ```

## DESCRIPTION

Return the sample data that the sample instance plays.

Note this returns a pointer to an internal structure, *not* the ALLEGRO\_SAMPLE(3alleg5) that you may have passed to al\_set\_sample(3alleg5). However, the sample buffer of the returned ALLEGRO\_SAMPLE will be the same as the one that was used to create the sample (passed to al\_create\_sample(3alleg5)). You can use al\_get\_sample\_data(3alleg5) on the return value to retrieve and compare it.

## SEE ALSO

al\_set\_sample(3alleg5)
