|
⇤ ← Revision 1 as of 2009-12-05 20:18:18
Size: 1689
Comment: create page, add content
|
Size: 1738
Comment: format update
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 5: | Line 5: |
| This ''structure'' (function) is called when the audio device needs more data. | A structure that contains audio data. This structure ''(function in header)'' is called when the audio device needs more data. |
SDL_AudioSpec
A structure that contains audio data. This structure (function in header) is called when the audio device needs more data.
Contents
Syntax
void (SDLCALL* callback)
(void* userdata,
Uint8* stream,
int len);
void* userdata
Structure Parameters
stream |
a pointer to the audio data buffer |
len |
the length of that buffer in bytes |
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) |
Uint16 padding |
necessary for some compile environments |
Uint32 size |
audio buffer size in bytes (calculated) |
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.
