Struct sdl2::AudioSubsystem
source · [−]pub struct AudioSubsystem { /* private fields */ }
Implementations
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.
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> 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
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> 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 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>
sourceimpl AudioSubsystem
impl AudioSubsystem
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 more
Auto 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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more