CosyVoiceClone<T>

Models & Types · AiDotNet.TextToSpeech.VoiceCloning

Voice-cloning facade over the released CosyVoice supervised-token, conditional-flow-matching, and HiFT pipeline.

Inheritance: NeuralNetworkBase<T> → TtsModelBase<T> → CosyVoiceBase<T> → CosyVoice<T> → CosyVoiceClone<T>

Implements: IVoiceCloner<T>

For Beginners

Give the model a recording and it creates a reusable CosyVoice prompt internally before synthesizing the requested text in that voice. All generation and training behavior comes from the real CosyVoice implementation, so this convenience API cannot drift into a placeholder model.

How It Works

This class deliberately inherits CosyVoice. Voice cloning is an inference task of the same CosyVoice checkpoint, not a second neural architecture: CAM++ extracts the speaker x-vector, the S3 tokenizer extracts prompt speech tokens, the conditional flow reads the prompt mel, and HiFT synthesizes the final waveform.

Constructors

Constructor Summary
CosyVoiceClone(NeuralNetworkArchitecture<T> architecture, CosyVoiceCloneOptions options, IGradientBasedOptimizer<T, Tensor<T>, Tensor<T>> optimizer) Creates the facade with CosyVoice’s native paper architecture.
CosyVoiceClone(NeuralNetworkArchitecture<T> architecture, string modelPath, CosyVoiceCloneOptions options) Creates the facade with CosyVoice’s native paper architecture.

Properties

Property Summary
double MinReferenceDuration { get; }
int SpeakerEmbeddingDim { get; }

Methods

Method Summary
ModelMetadata<T> GetModelMetadata()
Tensor<T> ExtractSpeakerEmbedding(Tensor<T> referenceAudio)
Tensor<T> SynthesizeWithVoice(string text, Tensor<T> referenceAudio)