Wiki Page Content

Differences between revisions 12 and 13
Revision 12 as of 2010-02-24 06:17:20
Size: 2317
Editor: SheenaSmith
Comment: added DRAFT, updated contents per header Rev 5387
Revision 13 as of 2010-03-09 19:35:55
Size: 2259
Editor: SheenaSmith
Comment: minor change
Deletions are marked like this. Additions are marked like this.
Line 12: Line 12:
<<Color2(green,added '''padding''' value - seems to be new)>> <<Color2(green,added '''padding''' value - seems to be new; should SDL_Audio``Callback not be a link because there won't be a page?)>>
Line 33: Line 33:
<<Color2(green,Is the following still necessary w/ the creation of an SDL_Audio``Callback page? Should we just reference the page above or change this to an include? How much of this now needs to change?)>> <<Color2(green,No page for SDL_Audio``Callback right? Is this sufficient?)>>

DRAFT

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

green

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)

SDL_AudioCallback

callback

a function that is called when the audio device needs more data; see Remarks for details

void*

userdata

a pointer that is passed as the first parameter to callback

Code Examples

You can add your code example here

Remarks

The calculated values silence and size are calculated by SDL_OpenAudio().

Stereo samples are stored in a LRLRLR ordering.

green

callback is of the form:

##alt 1st line from header rev 5387?
typedef void (SDLCALL * SDL_AudioCallback)(void*  userdata,
##w/ wiki formatting adjustments?
void* SDL_AudioCallback(void*  userdata,
##original content below 
void callback(void*  userdata, 
              Uint8* stream, 
              int    len);

userdata

an application-specific parameter saved in the SDL_AudioSpec structure

stream

a pointer to the audio data buffer to be filled in by the callback

len

the length of that buffer in bytes

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


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