|
Size: 1388
Comment: Fixed callback formatting
|
Size: 1588
Comment: content added
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 5: | Line 5: |
| A structure that contains audio data. This structure ''(function in header)'' is called when the audio device needs more data. | A structure that describes the audio output format. It contains a callback that is called when the audio device needs more data. |
| Line 16: | Line 16: |
| ||[[SDL_AudioCallback]]||'''callback'''|||| ||void*||'''userdata'''|||| |
||[[SDL_AudioCallback]]||'''callback'''||a function that is called when the audio device needs more data; see [[#callback|Remarks]] for details|| ||void*||'''userdata'''||an application-specific parameter saved in the [[SDL_AudioSpec]] structure|| |
| Line 27: | Line 27: |
| Once the callback returns, the buffer will no longer be valid. |
|
| Line 31: | Line 29: |
| The callback is of the form: | <<Anchor(callback)>> '''callback''' is of the form: |
| Line 41: | Line 39: |
| Once the callback returns, the buffer will no longer be valid. |
SDL_AudioSpec
A structure that describes the audio output format. It contains a callback that is called when the audio device needs more data.
Data Fields
int |
freq |
DSP frequency -- samples per second |
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) |
callback |
a function that is called when the audio device needs more data; see Remarks for details |
|
void* |
userdata |
an application-specific parameter saved in the SDL_AudioSpec structure |
Code Examples
You can add your code example here
Remarks
The calculated values in this structure are calculated by SDL_OpenAudio().
Stereo samples are stored in a LRLRLR ordering.
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 |
Once the callback returns, the buffer will no longer be valid.
