pub struct AudioCaptureVTable {
pub open: fn(sample_rate: u32, channels: u16) -> u64,
pub read: fn(handle: u64, out: &mut Vec<f32>) -> u32,
pub close: fn(handle: u64),
}Expand description
A platform audio-capture backend (microphone), registered by the dll so
MicrophoneWidget can pull real samples instead of the test tone. Like
CaptureVTable but yields interleaved f32 audio rather than RGBA video.
Fields§
§open: fn(sample_rate: u32, channels: u16) -> u64Open the default mic at sample_rate x channels. Opaque handle, or
0 on failure.
read: fn(handle: u64, out: &mut Vec<f32>) -> u32Block for the next chunk, writing interleaved f32 into out (resized).
Returns the frame count (out.len() / channels), or 0 on error / EOF
(the worker then stops + closes).
close: fn(handle: u64)Close + free the source.
Trait Implementations§
Source§impl Clone for AudioCaptureVTable
impl Clone for AudioCaptureVTable
Source§fn clone(&self) -> AudioCaptureVTable
fn clone(&self) -> AudioCaptureVTable
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for AudioCaptureVTable
Auto Trait Implementations§
impl Freeze for AudioCaptureVTable
impl RefUnwindSafe for AudioCaptureVTable
impl Send for AudioCaptureVTable
impl Sync for AudioCaptureVTable
impl Unpin for AudioCaptureVTable
impl UnsafeUnpin for AudioCaptureVTable
impl UnwindSafe for AudioCaptureVTable
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more