Wiki Page Content

Differences between revisions 4 and 5
Revision 4 as of 2009-12-13 06:21:07
Size: 1440
Editor: SheenaSmith
Comment: content changed
Revision 5 as of 2009-12-13 06:24:16
Size: 1388
Editor: Sam Lantinga
Comment: Fixed callback formatting
Deletions are marked like this. Additions are marked like this.
Line 9: Line 9:
== Structure Parameters ==
||'''stream'''||a pointer to the audio data buffer||
||'''len'''||the length of that buffer in bytes||
Line 20: Line 16:
||[[SDL_AudioCallback]]||'''callback'''||||
Line 21: Line 18:
||[[SDL_AudioCallback]]||'''callback'''||||
Line 37: Line 33:
void (SDLCALL* callback)
     
(void*   userdata,
      Uint8*   stream,
      int   len);
void* userdata
void callback(void* userdata,
              Uint8* stream,
              int len);
Line 43: Line 37:

||'''stream'''||a pointer to the audio data buffer||
||'''len'''||the length of that buffer in bytes||

SDL_AudioSpec

A structure that contains audio data. This structure (function in header) is called when the audio device needs more data.

Data Fields

int

freq

DSP frequency -- samples per second

SDL_AudioFormat

format

audio data format

Uint8

channels

number of channels: 1 mono, 2 stereo

Uint8

silence

audio buffer silence value (calculated)

Uint16

samples

audio buffer size in samples (power of 2)

Uint32

size

audio buffer size in bytes (calculated)

SDL_AudioCallback

callback

void*

userdata

Code Examples

You can add your code example here

Remarks

The calculated values in this structure are calculated by SDL_OpenAudio().

Once the callback returns, the buffer will no longer be valid.

Stereo samples are stored in a LRLRLR ordering.

The callback is of the form:

void callback(void*  userdata, 
              Uint8* stream, 
              int    len);

stream

a pointer to the audio data buffer

len

the length of that buffer in bytes


CategoryStruct

None: SDL_AudioSpec (last edited 2019-05-15 14:14:25 by ColaEuphoria)

(Page Info.)
Feedback
Please include your contact information if you'd like to receive a reply.
Submit