pub struct SharedAsyncStream { /* private fields */ }Expand description
A shared async stream for multiple producers
Implementations§
Sourcepub async fn new(
context: &WhisperContext,
params: FullParams,
config: WhisperStreamConfig,
) -> Result<Self>
pub async fn new( context: &WhisperContext, params: FullParams, config: WhisperStreamConfig, ) -> Result<Self>
Create a new shared async stream
Sourcepub async fn feed_and_process(&self, audio: Vec<f32>) -> Result<Vec<Segment>>
pub async fn feed_and_process(&self, audio: Vec<f32>) -> Result<Vec<Segment>>
Feed audio and get segments atomically
Sourcepub async fn drain_segments(&self) -> Vec<Segment>
pub async fn drain_segments(&self) -> Vec<Segment>
Drain all pending segments
Trait Implementations§
Auto Trait Implementations§
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