---
name: "load_voc"
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/load_voc/3alleg4"
---

# load\_voc(3alleg4)

Loads a sample from a Creative Labs VOC file. Allegro game programming library.

## NAME

load\_voc - Loads a sample from a Creative Labs VOC file. Allegro game programming library.

## SYNOPSIS

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

**SAMPLE \*load\_voc(const char \*filename);**

## DESCRIPTION

Loads a sample from a Creative Labs VOC file. Example:

```
   SAMPLE *sample = load_voc("alarm.voc");
   if (!sample)
      abort_on_error("Couldn't alert user!");
```

## RETURN VALUE

Returns a pointer to the SAMPLE or NULL on error. Remember to free this sample later to avoid memory leaks.

## SEE ALSO

**load\_sample**(3alleg4), **register\_sample\_file\_type**(3alleg4)
