pub struct Stream { /* private fields */ }Implementations§
Source§impl Stream
impl Stream
Sourcepub fn feed_audio(&mut self, buffer: &[i16])
pub fn feed_audio(&mut self, buffer: &[i16])
Feed audio samples to the stream
The input buffer must consist of mono 16-bit samples.
Sourcepub fn intermediate_decode(&mut self) -> Result<String, DeepspeechError>
pub fn intermediate_decode(&mut self) -> Result<String, DeepspeechError>
Decodes the intermediate state of what has been spoken up until now
Note that as of DeepSpeech version 0.2.0, this function is non-trivial as the decoder can’t do streaming yet.
Sourcepub fn finish(self) -> Result<String, DeepspeechError>
pub fn finish(self) -> Result<String, DeepspeechError>
Deallocates the stream and returns the decoded text
Sourcepub fn finish_with_metadata(
self,
num_transcripts: u32,
) -> Result<Metadata, DeepspeechError>
pub fn finish_with_metadata( self, num_transcripts: u32, ) -> Result<Metadata, DeepspeechError>
Deallocates the stream and returns the extended metadata
The num_transcripts param contains the maximum number of
CandidateTranscripts to return. The actually returned number
might be smaller.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Stream
impl RefUnwindSafe for Stream
impl !Send for Stream
impl !Sync for Stream
impl Unpin for Stream
impl UnwindSafe for Stream
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