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 Freeze for MicrophoneDevice
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