pub struct AudioCapture { /* private fields */ }Expand description
Audio capture stream that reads from a microphone.
Implementations§
Source§impl AudioCapture
impl AudioCapture
Sourcepub fn start(
selector: &DeviceSelector,
config: &AudioConfig,
) -> Result<Self, String>
pub fn start( selector: &DeviceSelector, config: &AudioConfig, ) -> Result<Self, String>
Start capturing audio from the selected input device.
If the device doesn’t support the requested sample rate, we find the nearest supported rate and downsample in the capture callback.
Sourcepub async fn next_frame(&mut self) -> Option<Vec<i16>>
pub async fn next_frame(&mut self) -> Option<Vec<i16>>
Receive the next audio frame.
Auto Trait Implementations§
impl Freeze for AudioCapture
impl !RefUnwindSafe for AudioCapture
impl !Send for AudioCapture
impl !Sync for AudioCapture
impl Unpin for AudioCapture
impl UnsafeUnpin for AudioCapture
impl !UnwindSafe for AudioCapture
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