|
Size: 1787
Comment: format update
|
Size: 1440
Comment: content changed
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 8: | Line 8: |
/* Remove this comment from the Struct page when creating page. To automatically show Data Fields content from this page on a function page place the following markup in the Remarks section of the related function(s), where structure is replaced by the actual structure name: <<Include(SDL_structure, , , from="== Data Fields ==", to="== Code Examples ==")>> */ == Syntax == {{{#!highlight cpp void (SDLCALL* callback) (void* userdata, Uint8* stream, int len); void* userdata }}} |
|
| Line 32: | Line 19: |
| ||Uint16||'''padding'''||necessary for some compile environments|| | |
| Line 34: | Line 20: |
| ||void*||'''userdata'''|||| ||[[SDL_AudioCallback]]||'''callback'''|||| |
|
| Line 47: | Line 35: |
| The callback is of the form: {{{#!highlight cpp void (SDLCALL* callback) (void* userdata, Uint8* stream, int len); void* userdata }}} |
SDL_AudioSpec
A structure that contains audio data. This structure (function in header) is called when the audio device needs more data.
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 |
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) |
void* |
userdata |
|
callback |
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 (SDLCALL* callback)
(void* userdata,
Uint8* stream,
int len);
void* userdata
