void (*callback)(void *userdata, Uint8 *stream, int len);
void *userdata;
} SDL_AudioSpec;\fR
.fi
.PP
.SH"STRUCTURE DATA"
.TP20
\fBfreq\fR
Audio frequency in samples per second
.TP20
\fBformat\fR
Audio data format
.TP20
\fBchannels\fR
Number of channels: 1 mono, 2 stereo
.TP20
\fBsilence\fR
Audio buffer silence value (calculated)
.TP20
\fBsamples\fR
Audio buffer size in samples
.TP20
\fBsize\fR
Audio buffer size in bytes (calculated)
.TP20
\fBcallback(\&.\&.)\fR
Callback function for filling the audio buffer
.TP20
\fBuserdata\fR
Pointer the user data which is passed to the callback function
.SH"DESCRIPTION"
.PP
The \fBSDL_AudioSpec\fR structure is used to describe the format of some audio data\&. This structure is used by \fI\fBSDL_OpenAudio\fP\fR and \fI\fBSDL_LoadWAV\fP\fR\&. While all fields are used by \fBSDL_OpenAudio\fP only \fBfreq\fR, \fBformat\fR, \fBsamples\fR and \fBchannels\fR are used by \fBSDL_LoadWAV\fP\&. We will detail these common members here\&.
.TP20
\fBfreq\fR
The number of samples sent to the sound device every second\&. Common values are 11025, 22050 and 44100\&. The higher the better\&.
.TP20
\fBformat\fR
Specifies the size and type of each sample element
.IP"\fBAUDIO_U8\fP"10Unsigned8-bitsamples
.IP"\fBAUDIO_S8\fP"10Signed8-bitsamples
.IP"\fBAUDIO_U16\fP or \fBAUDIO_U16LSB\fP"10Unsigned16-bitlittle-endiansamples
.IP"\fBAUDIO_S16\fP or \fBAUDIO_S16LSB\fP"10Signed16-bitlittle-endiansamples
The number of seperate sound channels\&. 1 is mono (single channel), 2 is stereo (dual channel)\&.
.TP20
\fBsamples\fR
When used with \fI\fBSDL_OpenAudio\fP\fR this refers to the size of the audio buffer in samples\&. A sample a chunk of audio data of the size specified in \fBformat\fR mulitplied by the number of channels\&. When the \fBSDL_AudioSpec\fR is used with \fI\fBSDL_LoadWAV\fP\fR\fBsamples\fR is set to 4096\&.