pub struct LocalTtsProvider { /* private fields */ }Expand description
On-device KittenTTS via ONNX Runtime + misaki-rs G2P (no espeak / GPL).
Implementations§
Source§impl LocalTtsProvider
impl LocalTtsProvider
pub fn new(cache_dir: PathBuf) -> Self
pub fn with_progress(self, v: bool) -> Self
pub fn with_local_only(self, v: bool) -> Self
pub fn with_max_chars(self, n: usize) -> Self
Sourcepub fn clear_sessions(&self)
pub fn clear_sessions(&self)
Drop loaded ONNX sessions for this provider (frees ORT graphs held in RAM).
Safe to call anytime; the next synthesize/preload reloads from the on-disk pack. Does not delete cached files under the TTS cache directory.
Trait Implementations§
Source§impl SynthesisProvider for LocalTtsProvider
impl SynthesisProvider for LocalTtsProvider
fn name(&self) -> &'static str
fn synthesize<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
text: &'life1 str,
opts: &'life2 SynthesisOptions,
) -> Pin<Box<dyn Future<Output = Result<SynthesisResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn preload<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
model: &'life1 str,
voice: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Auto Trait Implementations§
impl !Freeze for LocalTtsProvider
impl RefUnwindSafe for LocalTtsProvider
impl Send for LocalTtsProvider
impl Sync for LocalTtsProvider
impl Unpin for LocalTtsProvider
impl UnsafeUnpin for LocalTtsProvider
impl UnwindSafe for LocalTtsProvider
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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