pub struct AudioRecorder { /* private fields */ }Implementations§
Source§impl AudioRecorder
impl AudioRecorder
pub fn new() -> Self
Sourcepub fn with_noise_suppression(enabled: bool) -> Self
pub fn with_noise_suppression(enabled: bool) -> Self
Create a recorder with an explicit noise suppression setting.
Sourcepub fn set_noise_suppression(&self, enabled: bool)
pub fn set_noise_suppression(&self, enabled: bool)
Update the noise suppression toggle at runtime.
Sourcepub fn warm(&mut self) -> Result<()>
pub fn warm(&mut self) -> Result<()>
Open the microphone and start capturing into the pre-roll buffer.
Call once at app startup so recording starts instantly on hotkey press. If the stream is already running this is a no-op.
pub fn start_in_memory(&mut self) -> Result<()>
Sourcepub fn stop_samples(&mut self) -> Option<Vec<f32>>
pub fn stop_samples(&mut self) -> Option<Vec<f32>>
Stop recording and return the captured samples. For in-memory recordings (no WAV file).
pub fn start(&mut self, output_path: &Path) -> Result<()>
Sourcepub fn snapshot(&self, offset: usize) -> Vec<f32>
pub fn snapshot(&self, offset: usize) -> Vec<f32>
Return a copy of samples captured since start(), beginning at offset.
Samples are 16 kHz mono f32 in the range [−1, 1].
Sourcepub fn sample_count(&self) -> usize
pub fn sample_count(&self) -> usize
Number of 16 kHz samples captured since start().
Sourcepub fn sample_buffer(&self) -> Arc<Mutex<Vec<f32>>>
pub fn sample_buffer(&self) -> Arc<Mutex<Vec<f32>>>
A shared handle to the sample buffer for streaming access.
pub fn stop(&mut self) -> Option<PathBuf>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AudioRecorder
impl !RefUnwindSafe for AudioRecorder
impl Send for AudioRecorder
impl Sync for AudioRecorder
impl Unpin for AudioRecorder
impl UnsafeUnpin for AudioRecorder
impl !UnwindSafe for AudioRecorder
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