---
name: "reallocate_voice"
section: "3alleg"
platform: "linux"
package: "liballegro-doc"
version: "2:4.2.2-2.2"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/reallocate_voice"
---

# reallocate\_voice(3alleg)

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**(3alleg)](/allocate_voice/3alleg.md), [**deallocate\_voice**(3alleg)](/deallocate_voice/3alleg.md), [**load\_sample**(3alleg)](/load_sample/3alleg.md)
