---
name: "al_get_sample"
section: "3"
platform: "linux"
package: "allegro"
version: "5.2.11.3-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/al_get_sample"
---

# al\_get\_sample(3)

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(3)](/ALLEGRO_SAMPLE/3.md) that you may have passed to [al\_set\_sample(3)](/al_set_sample/3.md). 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(3)](/al_create_sample/3.md)). You can use [al\_get\_sample\_data(3)](/al_get_sample_data/3.md) on the return value to retrieve and compare it.

## SEE ALSO

[al\_set\_sample(3)](/al_set_sample/3.md)
