pub struct Microphone { /* private fields */ }Available on crate feature
microphone and non-target_family=wasm only.Expand description
The default microphone, ready to record. open() chooses a private
per-user spool directory and a 60-second maximum duration; the builder
overrides either.
Implementations§
Source§impl Microphone
impl Microphone
pub fn open() -> Result<Self, CaptureError>
pub fn builder() -> MicrophoneBuilder
Sourcepub fn record(
&mut self,
mode: RecordingMode,
) -> Result<(RecordingReader, Stopper), CaptureError>
pub fn record( &mut self, mode: RecordingMode, ) -> Result<(RecordingReader, Stopper), CaptureError>
Records one utterance. The recording fills in the background; hand the stopper to whatever should be able to end it early.
Trait Implementations§
Source§impl AudioCapture for Microphone
impl AudioCapture for Microphone
Source§fn start(
&self,
mode: RecordingMode,
stop: StopSignal,
) -> Result<RecordingReader, CaptureError>
fn start( &self, mode: RecordingMode, stop: StopSignal, ) -> Result<RecordingReader, CaptureError>
Starts capturing and returns a reader for the new recording. Returns
once capture is live or the recording has ended, and fails if it
ended in error. Read more
Auto Trait Implementations§
impl Freeze for Microphone
impl RefUnwindSafe for Microphone
impl Send for Microphone
impl Sync for Microphone
impl Unpin for Microphone
impl UnsafeUnpin for Microphone
impl UnwindSafe for Microphone
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