IVoiceCloner<T>
Interfaces · AiDotNet.TextToSpeech.Interfaces
Interface for TTS models that support zero-shot or few-shot voice cloning from reference audio.
Implements: ITtsModel<T>
Known implementations: CosyVoiceClone<T>, MetaVoice1B<T>, OpenVoiceV2<T>, OpenVoice<T>, SeedTTSClone<T>, VALLEXClone<T>, XTTSv2Clone<T>
How It Works
Voice cloning models can replicate a target speaker’s voice from a short reference audio sample:
- Zero-shot: VALL-E, CosyVoice (3-10 seconds of reference audio)
- Few-shot: GPT-SoVITS, XTTS-v2 (minutes of reference audio)
- Instant: OpenVoice (separate tone color converter)
Properties
| Property | Summary |
|---|---|
double MinReferenceDuration { get; } |
Gets the minimum reference audio duration in seconds required for cloning. |
int SpeakerEmbeddingDim { get; } |
Gets the speaker embedding dimensionality. |
Methods
| Method | Summary |
|---|---|
Tensor<T> ExtractSpeakerEmbedding(Tensor<T> referenceAudio) |
Extracts a speaker embedding from reference audio. |
Tensor<T> SynthesizeWithVoice(string text, Tensor<T> referenceAudio) |
Synthesizes speech in the voice of a reference speaker. |