[−][src]Struct ttspico::Engine
A Pico TTS engine.
Methods
impl Engine
[src]
pub fn put_text(
&mut self,
utf8_text: impl AsRef<[u8]>
) -> Result<usize, PicoError>
[src]
&mut self,
utf8_text: impl AsRef<[u8]>
) -> Result<usize, PicoError>
Puts UTF-8 text to be spoken into the TTS engine.
Returns the number of bytes of utf8_text
that were in fact put in the engine (or a PicoError
on failure).
Put null terminators (\0
) in the text to flush the engine, forcing speech generation.
See
pub fn flush(&mut self) -> Result<usize, PicoError>
[src]
Flushes the TTS engine, forcing speech generation. Equivalent to `self.put_text("\0").
pub fn reset(&mut self, mode: EngineResetMode) -> Result<(), PicoError>
[src]
pub fn get_data(
&mut self,
buf: impl AsMut<[i16]>
) -> Result<(usize, EngineStatus), PicoError>
[src]
&mut self,
buf: impl AsMut<[i16]>
) -> Result<(usize, EngineStatus), PicoError>
Generates speech audio from the text input via put_text
, outputting to buf
.
Returns either a <number of samples generated, EngineStatus
after stepping> pair (on success) or a
PicoError
(on failure).
Output data is encoded as 16-bit signed PCM, at a sample rate of 16kHz.
buf
should have length <= PICO_INT16_MAX
.
See
Trait Implementations
impl Debug for Engine
[src]
impl Eq for Engine
[src]
impl PartialEq<Engine> for Engine
[src]
impl Send for Engine
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,