---
name: "al_destroy_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_destroy_sample"
---

# al\_destroy\_sample(3)

Allegro 5 API

## NAME

al\_destroy\_sample - Allegro 5 API

## SYNOPSIS

-

  ```
  #include <allegro5/allegro_audio.h>
  void al_destroy_sample(ALLEGRO_SAMPLE *spl)
  ```

## DESCRIPTION

Free the sample data structure. If it was created with the `free_buf` parameter set to true, then the buffer will be freed with [al\_free(3)](/al_free/3.md).

This function will stop any sample instances which may be playing the buffer referenced by the [ALLEGRO\_SAMPLE(3)](/ALLEGRO_SAMPLE/3.md).

## SEE ALSO

[al\_destroy\_sample\_instance(3)](/al_destroy_sample_instance/3.md), [al\_stop\_sample(3)](/al_stop_sample/3.md), [al\_stop\_samples(3)](/al_stop_samples/3.md)
