[−][src]Trait sdl2::audio::AudioFormatNum
A phantom type for retrieving the SDL_AudioFormat
of a given generic type.
All format types are returned as native-endian.
Associated Constants
const SILENCE: Self
The appropriately typed silence value for the audio format used.
Examples
// The AudioFormatNum trait has to be imported for the Channel::SILENCE part to work. use sdl2::audio::{AudioCallback, AudioFormatNum}; struct Silence; impl AudioCallback for Silence { type Channel = u16; fn callback(&mut self, out: &mut [u16]) { for dst in out.iter_mut() { *dst = Self::Channel::SILENCE; } } }
Required methods
fn audio_format() -> AudioFormat
Implementations on Foreign Types
impl AudioFormatNum for i8
[src]
AUDIO_S8
fn audio_format() -> AudioFormat
[src]
const SILENCE: i8
[src]
impl AudioFormatNum for u8
[src]
AUDIO_U8
fn audio_format() -> AudioFormat
[src]
const SILENCE: u8
[src]
impl AudioFormatNum for i16
[src]
AUDIO_S16
fn audio_format() -> AudioFormat
[src]
const SILENCE: i16
[src]
impl AudioFormatNum for u16
[src]
AUDIO_U16
fn audio_format() -> AudioFormat
[src]
const SILENCE: u16
[src]
impl AudioFormatNum for i32
[src]
AUDIO_S32
fn audio_format() -> AudioFormat
[src]
const SILENCE: i32
[src]
impl AudioFormatNum for f32
[src]
AUDIO_F32