Struct sdl2_sys::SDL_AudioSpec
source · #[repr(C)]pub struct SDL_AudioSpec {
pub freq: c_int,
pub format: SDL_AudioFormat,
pub channels: Uint8,
pub silence: Uint8,
pub samples: Uint16,
pub padding: Uint16,
pub size: Uint32,
pub callback: SDL_AudioCallback,
pub userdata: *mut c_void,
}
Expand 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 FC BL BR (quad + center) 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)
Fields§
§freq: c_int
< DSP frequency – samples per second
format: SDL_AudioFormat
< Audio data format
channels: Uint8
< Number of channels: 1 mono, 2 stereo
silence: Uint8
< Audio buffer silence value (calculated)
samples: Uint16
< Audio buffer size in sample FRAMES (total samples divided by channel count)
padding: Uint16
< Necessary for some compile environments
size: Uint32
< Audio buffer size in bytes (calculated)
callback: SDL_AudioCallback
< Callback that feeds the audio device (NULL to use SDL_QueueAudio()).
userdata: *mut c_void
< Userdata passed to callback (ignored for NULL callbacks).
Trait Implementations§
source§impl Clone for SDL_AudioSpec
impl Clone for SDL_AudioSpec
source§fn clone(&self) -> SDL_AudioSpec
fn clone(&self) -> SDL_AudioSpec
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreimpl Copy for SDL_AudioSpec
Auto Trait Implementations§
impl Freeze for SDL_AudioSpec
impl RefUnwindSafe for SDL_AudioSpec
impl !Send for SDL_AudioSpec
impl !Sync for SDL_AudioSpec
impl Unpin for SDL_AudioSpec
impl UnwindSafe for SDL_AudioSpec
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)