Struct sdl2::AudioSubsystem
source · pub struct AudioSubsystem { /* private fields */ }
Implementations§
source§impl AudioSubsystem
impl AudioSubsystem
sourcepub fn open_playback<'a, CB, F, D>(
&self,
device: D,
spec: &AudioSpecDesired,
get_callback: F
) -> Result<AudioDevice<CB>, String>
pub fn open_playback<'a, CB, F, D>( &self, device: D, spec: &AudioSpecDesired, get_callback: F ) -> Result<AudioDevice<CB>, String>
Opens a new audio device given the desired parameters and callback.
If you want to modify the callback-owned data at a later point (for example to update its data buffer) you’re likely to be interested in the AudioDevice.lock method.
sourcepub fn open_capture<'a, CB, F, D>(
&self,
device: D,
spec: &AudioSpecDesired,
get_callback: F
) -> Result<AudioDevice<CB>, String>
pub fn open_capture<'a, CB, F, D>( &self, device: D, spec: &AudioSpecDesired, get_callback: F ) -> Result<AudioDevice<CB>, String>
Opens a new audio device for capture (given the desired parameters and callback). Supported since SDL 2.0.5
If you want to modify the callback-owned data at a later point (for example to update its data buffer) you’re likely to be interested in the AudioDevice.lock method.
sourcepub fn open_queue<'a, Channel, D>(
&self,
device: D,
spec: &AudioSpecDesired
) -> Result<AudioQueue<Channel>, String>
pub fn open_queue<'a, Channel, D>( &self, device: D, spec: &AudioSpecDesired ) -> Result<AudioQueue<Channel>, String>
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 num_audio_capture_devices(&self) -> Option<u32>
pub fn audio_playback_device_name(&self, index: u32) -> Result<String, String>
pub fn audio_capture_device_name(&self, index: u32) -> Result<String, String>
pub fn audio_playback_device_spec( &self, index: u32 ) -> Result<AudioSpec, String>
pub fn audio_capture_device_spec(&self, index: u32) -> Result<AudioSpec, String>
Trait Implementations§
source§impl Clone for AudioSubsystem
impl Clone for AudioSubsystem
source§fn clone(&self) -> AudioSubsystem
fn clone(&self) -> AudioSubsystem
Returns a copy of the value. Read more
1.0.0 · source§fn 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§
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
Mutably borrows from an owned value. Read more