SDL_AudioSpec



SDL_AudioSpec

NAME
STRUCTURE DEFINITION
STRUCTURE DATA
DESCRIPTION
SEE ALSO

NAME

SDL_AudioSpec − Audio Specification Structure

STRUCTURE DEFINITION

typedef struct{
  int freq;
  Uint16 format;
  Uint8 channels;
  Uint8 silence;
  Uint16 samples;
  Uint32 size;
  void (*callback)(void *userdata, Uint8 *stream, int len);
  void *userdata;
} SDL_AudioSpec;

STRUCTURE DATA

freq

Audio frequency in samples per second

format

Audio data format

channels

Number of channels: 1 mono, 2 stereo

silence

Audio buffer silence value (calculated)

samples

Audio buffer size in samples

size

Audio buffer size in bytes (calculated)

callback(..)

Callback function for filling the audio buffer

userdata

Pointer the user data which is passed to the callback function

DESCRIPTION

The SDL_AudioSpec structure is used to describe the format of some audio data. This structure is used by SDL_OpenAudio and SDL_LoadWAV. While all fields are used by SDL_OpenAudio only freq, format, samples and channels are used by SDL_LoadWAV. We will detail these common members here.

freq

The number of samples sent to the sound device every second. Common values are 11025, 22050 and 44100. The higher the better.

format

Specifies the size and type of each sample element

AUDIO_U8

AUDIO_S8

AUDIO_U16 or AUDIO_U16LSB
AUDIO_S16
or AUDIO_S16LSB
AUDIO_U16MSB
AUDIO_S16MSB
AUDIO_U16SYS
AUDIO_S16SYS

channels

The number of seperate sound channels. 1 is mono (single channel), 2 is stereo (dual channel).

samples

When used with SDL_OpenAudio this refers to the size of the audio buffer in samples. A sample a chunk of audio data of the size specified in format mulitplied by the number of channels. When the SDL_AudioSpec is used with SDL_LoadWAV samples is set to 4096.

SEE ALSO

SDL_OpenAudio, SDL_LoadWAV



More Linux Commands

manpages/Apache::TestTrace.3pm.html
Apache::TestTrace(3pm) - Helper output generation functions
This module exports a number of functions that make it easier generating various diagnostics messages in your programs in a consistent way and saves some keystr

manpages/gs.1.html
gs(1) - Ghostscript (PostScript and PDF language interpreter
The gs (gswin32c, gswin32, gsos2) command invokes Ghostscript, an interpreter of Adobe Systems PostScript(tm) and Portable Document Format (PDF) languages. gs r

manpages/endutxent.3.html
endutxent(3) - access utmp file entries - Linux manual page
New applications should use the POSIX.1-specified utmpx versions of these functions; see CONFORMING TO. utmpname() sets the name of the utmp-format file for the

manpages/unflatten.1.html
unflatten(1) - adjust directed graphs to improve layout aspe
unflatten is a preprocessor to dot that is used to improve the aspect ratio of graphs having many leaves or disconnected nodes. The usual layout for such a grap

manpages/batcher.8.html
batcher(8) - Article batching for InterNetNews (Man Page)...
batcher reads a list of files and prepares news batches for the specified host. It is generally used to prepare UUCP feeds, but the resulting batches can be use

manpages/pam_misc_paste_env.3.html
pam_misc_paste_env(3) - transcribing an environment to that
This function takes the supplied list of environment pointers and uploads its contents to the PAM environment. Success is indicated by PAM_SUCCESS. SEE ALSO pam

manpages/pluginviewer.8.html
pluginviewer(8) - list loadable SASL plugins and their prope
pluginviewer can be used by a server administrator to troubleshoot SASL installations. The utility can list loadable (properly configured) client and server sid

manpages/libsensors.3.html
libsensors(3) - publicly accessible functions provided by th
sensors_init() loads the configuration file and the detected chips list. If this returns a value unequal to zero, you are in trouble; you can not assume anythin

manpages/auto_execok.n.html
auto_execok(n) - standard library of Tcl procedures.........
Tcl includes a library of Tcl procedures for commonly-needed functions. The procedures defined in the Tcl library are generic ones suitable for use by many diff

manpages/makeg.1.html
makeg(1) - make a debuggable executable - Linux manual page
The makeg script runs make, passing it variable settings to create a debuggable target when used with a Makefile generated by imake. For example, it arranges fo

manpages/sgi2tiff.1.html
sgi2tiff(1) create a TIFF file from an SGI image file.......
sgi2tiff converts a file in the SGI image format to TIFF. By default, the TIFF image is created with data samples packed (PlanarConfiguration=1), compressed wit

manpages/pamdice.1.html
pamdice(1) - slice a Netpbm image into many horizontally and
This program is part of Netpbm(1) pamdice reads a PAM, PBM, PGM, or PPM image as input and splits it horizontally and/or vertically into equal size pieces and w





We can't live, work or learn in freedom unless the software we use is free.