Struct rich_sdl2_rust::audio::MicrophoneDevice
source · pub struct MicrophoneDevice { /* private fields */ }
Expand description
An audio device to input sound.
Implementations§
source§impl MicrophoneDevice
impl MicrophoneDevice
sourcepub fn all_devices() -> impl Iterator<Item = String>
pub fn all_devices() -> impl Iterator<Item = String>
Returns all of microphone 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 microphone device.
Trait Implementations§
source§impl AudioDevice for MicrophoneDevice
impl AudioDevice for MicrophoneDevice
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
.Auto Trait Implementations§
impl !RefUnwindSafe for MicrophoneDevice
impl Send for MicrophoneDevice
impl !Sync for MicrophoneDevice
impl Unpin for MicrophoneDevice
impl UnwindSafe for MicrophoneDevice
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