pub trait TTSEngine: Send + Sync {
// Required methods
fn synthesize<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
text: &'life1 str,
voice: &'life2 str,
) -> Pin<Box<dyn Future<Output = PluginResult<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn synthesize_stream<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
text: &'life1 str,
voice: &'life2 str,
callback: Box<dyn Fn(Vec<u8>) + Send + Sync>,
) -> Pin<Box<dyn Future<Output = PluginResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn list_voices<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = PluginResult<Vec<VoiceInfo>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn name(&self) -> &str;
fn as_any(&self) -> &dyn Any;
}Expand description
Abstract TTS engine trait for extensibility
Required Methods§
Sourcefn synthesize<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
text: &'life1 str,
voice: &'life2 str,
) -> Pin<Box<dyn Future<Output = PluginResult<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn synthesize<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
text: &'life1 str,
voice: &'life2 str,
) -> Pin<Box<dyn Future<Output = PluginResult<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Synthesize text to audio data
Sourcefn synthesize_stream<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
text: &'life1 str,
voice: &'life2 str,
callback: Box<dyn Fn(Vec<u8>) + Send + Sync>,
) -> Pin<Box<dyn Future<Output = PluginResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn synthesize_stream<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
text: &'life1 str,
voice: &'life2 str,
callback: Box<dyn Fn(Vec<u8>) + Send + Sync>,
) -> Pin<Box<dyn Future<Output = PluginResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Synthesize with streaming callback for long texts
Sourcefn list_voices<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = PluginResult<Vec<VoiceInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_voices<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = PluginResult<Vec<VoiceInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List available voices