pub struct AudioRecorder { /* private fields */ }Expand description
An audio recorder that accumulates PCM samples.
Implementations§
Source§impl AudioRecorder
impl AudioRecorder
pub fn new(sample_rate: u32) -> Self
Sourcepub fn record_frame(&mut self, frame: &[i16])
pub fn record_frame(&mut self, frame: &[i16])
Record a frame of PCM samples.
Sourcepub fn duration_ms(&self) -> u64
pub fn duration_ms(&self) -> u64
Get duration in milliseconds.
Sourcepub fn frame_count(&self) -> usize
pub fn frame_count(&self) -> usize
Get number of frames recorded (assuming 20ms frames).
Trait Implementations§
Source§impl Clone for AudioRecorder
impl Clone for AudioRecorder
Source§fn clone(&self) -> AudioRecorder
fn clone(&self) -> AudioRecorder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto 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