Struct deepspeech::Stream
source · 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, FromUtf8Error>
pub fn intermediate_decode(&mut self) -> Result<String, FromUtf8Error>
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, FromUtf8Error>
pub fn finish(self) -> Result<String, FromUtf8Error>
Deallocates the stream and returns the decoded text