My Project
Loading...
Searching...
No Matches
SDL_AudioSpec Struct Reference

#include <SDL_audio.h>

Data Fields

int freq
 
SDL_AudioFormat format
 
Uint8 channels
 
Uint8 silence
 
Uint16 samples
 
Uint16 padding
 
Uint32 size
 
SDL_AudioCallback callback
 
void * userdata
 

Detailed Description

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

For multi-channel audio, the default SDL channel mapping is: 2: FL FR (stereo) 3: FL FR LFE (2.1 surround) 4: FL FR BL BR (quad) 5: FL FR LFE BL BR (4.1 surround) 6: FL FR FC LFE SL SR (5.1 surround - last two can also be BL BR) 7: FL FR FC LFE BC SL SR (6.1 surround) 8: FL FR FC LFE BL BR SL SR (7.1 surround)

Field Documentation

◆ callback

Callback that feeds the audio device (NULL to use SDL_QueueAudio()).

◆ channels

Uint8 channels

Number of channels: 1 mono, 2 stereo

◆ format

Audio data format

◆ freq

int freq

DSP frequency – samples per second

◆ padding

Uint16 padding

Necessary for some compile environments

◆ samples

Uint16 samples

Audio buffer size in sample FRAMES (total samples divided by channel count)

◆ silence

Uint8 silence

Audio buffer silence value (calculated)

◆ size

Uint32 size

Audio buffer size in bytes (calculated)

◆ userdata

void* userdata

Userdata passed to callback (ignored for NULL callbacks).


The documentation for this struct was generated from the following file: