Struct rich_sdl2_rust::audio::SpeakerDevice
source · pub struct SpeakerDevice { /* private fields */ }
Expand description
An audio device to output sound.
Implementations§
source§impl SpeakerDevice
impl SpeakerDevice
sourcepub fn all_devices() -> impl Iterator<Item = String>
pub fn all_devices() -> impl Iterator<Item = String>
Returns all of speaker audio device names on now.
sourcepub fn open<'callback, T: AudioCallback<'callback>>(
device: Option<String>,
spec: &'callback AudioSpec<'callback, T>,
fallback: FallbackFlag
) -> Result<(Self, AudioDeviceProperty)>
pub fn open<'callback, T: AudioCallback<'callback>>( device: Option<String>, spec: &'callback AudioSpec<'callback, T>, fallback: FallbackFlag ) -> Result<(Self, AudioDeviceProperty)>
Opens the audio device named device
with the specification and fallback flag.
If device is None
, the default audio device is used.
§Errors
Returns Err
if failed to open a specific speaker device.
Trait Implementations§
source§impl AudioDevice for SpeakerDevice
impl AudioDevice for SpeakerDevice
source§fn status(&self) -> AudioStatus
fn status(&self) -> AudioStatus
Returns the status of an audio device.
source§fn lock(&mut self) -> AudioDeviceLock<'_>
fn lock(&mut self) -> AudioDeviceLock<'_>
Obtains the lock preventing from calling the callback
spec::AudioCallback
.source§impl Debug for SpeakerDevice
impl Debug for SpeakerDevice
Auto Trait Implementations§
impl !RefUnwindSafe for SpeakerDevice
impl Send for SpeakerDevice
impl !Sync for SpeakerDevice
impl Unpin for SpeakerDevice
impl UnwindSafe for SpeakerDevice
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