---
name: "reallocate_voice"
section: "3alleg4"
platform: "linux"
package: "allegro4-doc"
version: "2:4.4.3.1-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/reallocate_voice/3alleg4"
---

# reallocate\_voice(3alleg4)

Switches the sample of an already-allocated voice. Allegro game programming library.

## NAME

reallocate\_voice - Switches the sample of an already-allocated voice. Allegro game programming library.

## SYNOPSIS

**#include \<allegro.h\>**

**void reallocate\_voice(int voice, const SAMPLE \*spl);**

## DESCRIPTION

Switches an already-allocated voice to use a different sample. Calling  reallocate\_voice(voice, sample) is equivalent to:

```
   deallocate_voice(voice);
   voice = allocate_voice(sample);
```

## SEE ALSO

**allocate\_voice**(3alleg4), **deallocate\_voice**(3alleg4), **load\_sample**(3alleg4)
