pub struct CaptureHandle { /* private fields */ }Expand description
Handle for receiving AEC-processed audio samples. Capture stops automatically when dropped (channel disconnect stops backend).
Implementations§
Source§impl CaptureHandle
impl CaptureHandle
Sourcepub fn new(config: AecConfig) -> Result<Self, AecError>
pub fn new(config: AecConfig) -> Result<Self, AecError>
Create and start a new AEC capture stream. Audio samples are received via the async recv() or blocking recv_blocking() methods.
Sourcepub async fn recv(&self) -> Option<Result<Vec<f32>, AecError>>
pub async fn recv(&self) -> Option<Result<Vec<f32>, AecError>>
Receive audio samples asynchronously. Returns None when the capture stream is closed.
Sourcepub fn recv_blocking(&self) -> Option<Result<Vec<f32>, AecError>>
pub fn recv_blocking(&self) -> Option<Result<Vec<f32>, AecError>>
Receive audio samples, blocking the current thread. Returns None when the capture stream is closed.
Sourcepub fn try_recv(&self) -> Option<Result<Vec<f32>, AecError>>
pub fn try_recv(&self) -> Option<Result<Vec<f32>, AecError>>
Try to receive audio samples without blocking. Returns None if no samples are available or stream is closed.
Sourcepub fn native_sample_rate(&self) -> u32
pub fn native_sample_rate(&self) -> u32
Get the actual sample rate being used by the backend. May differ from requested rate if resampling is active.
Auto Trait Implementations§
impl Freeze for CaptureHandle
impl RefUnwindSafe for CaptureHandle
impl Send for CaptureHandle
impl Sync for CaptureHandle
impl Unpin for CaptureHandle
impl UnwindSafe for CaptureHandle
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