pub enum Voice {
MimoDefault,
DefaultEn,
DefaultZh,
Bingtang,
Moli,
Suda,
Baihua,
Mia,
Chloe,
Milo,
Dean,
Custom(String),
}Expand description
Available voice options for text-to-speech.
This enum supports both preset voices and custom voices (for voice cloning).
Variants§
MimoDefault
MiMo default voice - balanced tone
DefaultEn
Default English female voice (legacy)
DefaultZh
Default Chinese female voice (legacy)
Bingtang
冰糖 - Chinese female voice
Moli
茉莉 - Chinese female voice
Suda
苏打 - Chinese male voice
Baihua
白桦 - Chinese male voice
Mia
Mia - English female voice
Chloe
Chloe - English female voice
Milo
Milo - English male voice
Dean
Dean - English male voice
Custom(String)
Custom voice string (for voice cloning with base64 audio)
Implementations§
Source§impl Voice
impl Voice
Sourcepub fn custom<S: Into<String>>(voice: S) -> Self
pub fn custom<S: Into<String>>(voice: S) -> Self
Create a custom voice from a string (for voice cloning).
The string should be in the format: data:{MIME_TYPE};base64,$BASE64_AUDIO
Sourcepub async fn from_audio_file<P: AsRef<Path>>(path: P) -> Result<Self>
pub async fn from_audio_file<P: AsRef<Path>>(path: P) -> Result<Self>
Create a voice clone from an audio file path.
Reads the audio file, encodes it as base64, and creates a custom voice string. Supported formats: MP3, WAV.