Struct sdl2::AudioSubsystem
source · pub struct AudioSubsystem { /* private fields */ }
Implementations
sourceimpl AudioSubsystem
impl AudioSubsystem
sourceimpl AudioSubsystem
impl AudioSubsystem
sourcepub fn open_playback<'a, CB, F, D>(
&self,
device: D,
spec: &AudioSpecDesired,
get_callback: F
) -> Result<AudioDevice<CB>, String>where
CB: AudioCallback,
F: FnOnce(AudioSpec) -> CB,
D: Into<Option<&'a str>>,
pub fn open_playback<'a, CB, F, D>(
&self,
device: D,
spec: &AudioSpecDesired,
get_callback: F
) -> Result<AudioDevice<CB>, String>where
CB: AudioCallback,
F: FnOnce(AudioSpec) -> CB,
D: Into<Option<&'a str>>,
Opens a new audio device given the desired parameters and callback.
sourcepub fn open_capture<'a, CB, F, D>(
&self,
device: D,
spec: &AudioSpecDesired,
get_callback: F
) -> Result<AudioDevice<CB>, String>where
CB: AudioCallback,
F: FnOnce(AudioSpec) -> CB,
D: Into<Option<&'a str>>,
pub fn open_capture<'a, CB, F, D>(
&self,
device: D,
spec: &AudioSpecDesired,
get_callback: F
) -> Result<AudioDevice<CB>, String>where
CB: AudioCallback,
F: FnOnce(AudioSpec) -> CB,
D: Into<Option<&'a str>>,
Opens a new audio device for capture (given the desired parameters and callback). Supported since SDL 2.0.5
sourcepub fn open_queue<'a, Channel, D>(
&self,
device: D,
spec: &AudioSpecDesired
) -> Result<AudioQueue<Channel>, String>where
Channel: AudioFormatNum,
D: Into<Option<&'a str>>,
pub fn open_queue<'a, Channel, D>(
&self,
device: D,
spec: &AudioSpecDesired
) -> Result<AudioQueue<Channel>, String>where
Channel: AudioFormatNum,
D: Into<Option<&'a str>>,
Opens a new audio device which uses queueing rather than older callback method.
pub fn current_audio_driver(&self) -> &'static str
pub fn num_audio_playback_devices(&self) -> Option<u32>
pub fn audio_playback_device_name(&self, index: u32) -> Result<String, String>
Trait Implementations
sourceimpl Clone for AudioSubsystem
impl Clone for AudioSubsystem
sourcefn clone(&self) -> AudioSubsystem
fn clone(&self) -> AudioSubsystem
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations
impl RefUnwindSafe for AudioSubsystem
impl !Send for AudioSubsystem
impl !Sync for AudioSubsystem
impl Unpin for AudioSubsystem
impl UnwindSafe for AudioSubsystem
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more