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

# ALLEGRO\_SAMPLE\_INSTANCE(3alleg5)

Allegro 5 API

## NAME

ALLEGRO\_SAMPLE\_INSTANCE - Allegro 5 API

## SYNOPSIS

-

  ```
  #include <allegro5/allegro_audio.h>
  typedef struct ALLEGRO_SAMPLE_INSTANCE ALLEGRO_SAMPLE_INSTANCE;
  ```

## DESCRIPTION

An ALLEGRO\_SAMPLE\_INSTANCE object represents a playable instance of a predefined sound effect. It holds information about how the effect should be played: These playback parameters consist of the looping mode, loop start/end points, playing position, speed, gain, pan and the playmode. Whether a sample instance is currently playing or paused is also one of its properties.

An instance uses the data from an ALLEGRO\_SAMPLE(3alleg5) object. Multiple instances may be created from the same ALLEGRO\_SAMPLE. An ALLEGRO\_SAMPLE must not be destroyed while there are instances which reference it.

To actually produce audio output, an ALLEGRO\_SAMPLE\_INSTANCE must be attached to an ALLEGRO\_MIXER(3alleg5) which eventually reaches an ALLEGRO\_VOICE(3alleg5) object.

## SEE ALSO

ALLEGRO\_SAMPLE(3alleg5)
