create_sample(3alleg4)

create_sample3alleg4

Constructs a new sample structure of the specified type. allegro game programming library.

Usage

#include <allegro.h>

SAMPLE *create_sample(int bits, int stereo, int freq, int len);

Overview

Constructs a new sample structure of the specified type. Read chapter "Structures and types defined by Allegro" for an internal description of the SAMPLE structure. The `bits' parameter can be 8 or 16, `stereo' can be zero for mono samples and non-zero for stereo samples, `freq' is the frequency in hertz, and `len' is the number of samples you want to allocate for the full sound buffer.

Return value

Returns a pointer to the created sample, or NULL if the sample could not be created. Remember to free this sample later to avoid memory leaks.

Releases

7 releases since Debian 7 (Wheezy); the text changed 1 time.

  1. 7–10
  2. 11–13

From allegro4-doc 2:4.4.3.1-5 in Debian 13 (Trixie). Parsed by carta from the page's man source.