MeloTTSOptions

Options & Configuration · AiDotNet.TextToSpeech.EndToEnd

Options for MeloTTS. The defaults are MeloTTS’s (myshell-ai/MeloTTS configs/config.json, train.py and api.py): a 44.1 kHz Bert-VITS2 synthesizer for one language.

Inheritance: ModelOptions → TtsModelOptions → EndToEndTtsOptions → MeloTTSOptions

For Beginners

MeloTTS speaks one language per model; Language picks which (it decides the text front end and the BERT model the synthesizer listens to). A released checkpoint loads with LoadCheckpoint and its BERT with LoadBertWeights.

Constructors

Constructor Summary
MeloTTSOptions() Creates MeloTTS’s defaults.
MeloTTSOptions(MeloTTSOptions other) Copies another instance.

Properties

Property Summary
MeloLanguage Language { get; set; } The language the model speaks (default English).
bool UseDurationDiscriminator { get; set; } Whether VITS2’s duration discriminator trains alongside (true).
double Beta1 { get; set; } AdamW’s β₁ (0.8).
double Beta2 { get; set; } AdamW’s β₂ (0.99).
double DurationDiscriminatorDropout { get; set; } The duration discriminator’s dropout (0.1).
double DurationDropout { get; set; } Dropout in the stochastic and deterministic duration predictors (0.5).
double Epsilon { get; set; } AdamW’s ε (1e-9).
double KlLossWeight { get; set; } The KL loss weight c_kl (1).
double LearningRateDecay { get; set; } The learning rate’s decay per epoch (0.999875).
double MasNoiseDecay { get; set; } The alignment noise scale’s decrease per training step (2e-6).
double MasNoiseInitial { get; set; } The alignment search’s starting noise scale (0.01).
double MelLossWeight { get; set; } The mel reconstruction loss weight c_mel (45).
double NoiseScale { get; set; } The prior’s noise scale at synthesis (0.6).
double NoiseScaleW { get; set; } The stochastic duration predictor’s noise scale at synthesis (0.8).
double SdpRatio { get; set; } The stochastic predictor’s share of the durations at synthesis (0.2).
double Speed { get; set; } The speaking speed (1.0); durations scale by its inverse.
int BertChannels { get; set; } The width of the Chinese BERT features (chinese-roberta-wwm-ext-large: 1024).
int DiscriminatorWidthDivisor { get; set; } A divisor on every multi-period discriminator width (1: MeloTTS’s; larger values shrink it for tests).
int FlowTransformerLayers { get; set; } Transformer layers in each flow coupling, n_layers_trans_flow (3).
int JaBertChannels { get; set; } The width of every other language’s BERT features (768).
int KernelSize { get; set; } The text encoder’s feed-forward kernel (3).
int NumSpeakers { get; set; } Rows of the speaker table (256).
int SamplingSeed { get; set; } The seed of training’s and synthesis’s random draws (0).
int SegmentSize { get; set; } The training segment the decoder synthesizes, in samples (16384).
int SpeakerChannels { get; set; } The speaker embedding width, gin_channels (256).
int SpeakerId { get; set; } The speaker synthesis uses (0).
int UpdatesPerEpoch { get; set; } The updates in one epoch, after which the learning rate decays once (2084: LJSpeech’s 12,500 clips at MeloTTS’s batch of 6; set it for your dataset).
int UpsampleInitialChannels { get; set; } The decoder’s first width (512).
int WindowSize { get; set; } The STFT window length (2048).
int? BertHeads { get; set; } The BERT’s attention heads; null for the language’s released model (16 Chinese, 12 others).
int? BertIntermediate { get; set; } The BERT’s feed-forward width; null for the language’s released model (4096 Chinese, 3072 others).
int? BertLayers { get; set; } The BERT’s layer count; null for the language’s released model (24 Chinese, 12 others).
int[] ResblockKernelSizes { get; set; } The decoder’s residual-block kernels (3, 7, 11).
int[] UpsampleKernelSizes { get; set; } The decoder’s upsampling kernels (16, 16, 8, 2, 2).
int[] UpsampleRates { get; set; } The decoder’s upsampling rates (8, 8, 2, 2, 2); their product is the hop size.
int[][] ResblockDilationSizes { get; set; } The decoder’s residual-block dilations ((1, 3, 5) for each kernel).