#[repr(C)]
pub struct SDL_AudioSpec { pub freq: c_int, pub format: SDL_AudioFormat, pub channels: u8, pub silence: u8, pub samples: u16, pub padding: u16, pub size: u32, 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: u8

Number of channels: 1 mono, 2 stereo, etc

§silence: u8

Audio buffer silence value (calculated)

§samples: u16

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

§padding: u16

Necessary for some compile environments

§size: u32

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).

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.