pub struct MicrophoneBuilder { /* private fields */ }Available on crate feature
microphone and non-target_family=wasm only.Implementations§
Source§impl MicrophoneBuilder
impl MicrophoneBuilder
Sourcepub fn spool_dir(self, directory: impl Into<PathBuf>) -> Self
pub fn spool_dir(self, directory: impl Into<PathBuf>) -> Self
Where the bounded temporary WAV lives while recording. It holds everything the microphone hears, so use a directory only your user can read. Without one, loading creates a private per-user directory.
Sourcepub fn maximum_duration(self, maximum_duration: Duration) -> Self
pub fn maximum_duration(self, maximum_duration: Duration) -> Self
The most a single recording may hold, up to about 37 hours. The spool grows with it, about 115 MB per hour, and each reader holds what it has not released, about 230 MB per hour.
pub fn open(self) -> Result<Microphone, CaptureError>
pub fn load(self) -> Result<PreparedMicrophone, CaptureError>
Sourcepub fn load_with<V>(self, vad: V) -> Result<PreparedMicrophone<V>, CaptureError>where
V: VoiceActivityDetector + Send + 'static,
pub fn load_with<V>(self, vad: V) -> Result<PreparedMicrophone<V>, CaptureError>where
V: VoiceActivityDetector + Send + 'static,
Uses vad instead of the bundled Silero model, for both endpointing
and the wake-word gate. A panic while it scores fails the recording
in progress, or drops the held stream when idle; a panic in its
reset ends the microphone.
Auto Trait Implementations§
impl Freeze for MicrophoneBuilder
impl RefUnwindSafe for MicrophoneBuilder
impl Send for MicrophoneBuilder
impl Sync for MicrophoneBuilder
impl Unpin for MicrophoneBuilder
impl UnsafeUnpin for MicrophoneBuilder
impl UnwindSafe for MicrophoneBuilder
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