StyleTtsBaseOptions

Options & Configuration · AiDotNet.TextToSpeech.StyleEmotion

Shared StyleTTS, StyleTTS 2 and StyleTTS-ZS audio features, style-vector width, decoder residual widths, text aligner, pitch extractor, and optimizer settings. Each model owns its native encoder configuration.

Inheritance: ModelOptions → StyleTtsBaseOptions

Known derived types: StyleTTSOptions, StyleTtsWaveformOptions

For Beginners

These options set the sizes of StyleTTS’s networks, its audio features and how it is trained. The defaults reproduce the paper.

How It Works

The defaults are StyleTTS’s paper’s (§III, Appendix D) with the released code’s configuration where the paper is silent (yl4579/StyleTTS Configs/config.yml): 24 kHz audio, 80-bin mel spectrograms from a 2048-point FFT with a 1200-sample window and 300-sample hop, normalized as (log(1e-5 + mel) + 4) / 4; 178 phoneme symbols; a 512-wide text encoder of three convolutions and a BiLSTM; 128-dimensional styles from a style encoder whose first width is 64; a decoder of seven residual blocks with 64-wide residual features; a three-layer prosody predictor with dropout 0.2; a text aligner pre-trained for ASR (256 wide, 512-dimensional token embeddings) and a JDC pitch extractor. Both stages train with AdamW (β = 0, 0.99, weight decay 1e-4, learning rate 1e-4).

Properties

Property Summary
OnnxModelOptions OnnxOptions { get; set; } Whole-model ONNX runtime settings.
double Beta1 { get; set; } AdamW β₁ (0, §III-B).
double Beta2 { get; set; } AdamW β₂ (0.99, §III-B).
double Epsilon { get; set; } AdamW ε (1e-9, the released code’s).
double HardAlignmentProbability { get; set; } The share of reconstruction steps that read the hard monotonic alignment instead of the soft attention (0.5: the paper’s 50%-50% strategy, §II-B and Appendix A-A).
double LearningRate { get; set; } Native optimizer learning rate.
double MelMean { get; set; } The log mel spectrogram’s normalization mean (−4).
double MelStd { get; set; } The log mel spectrogram’s normalization standard deviation (4).
double WeightDecay { get; set; } Native AdamW weight decay.
int AlignerConvLayers { get; set; } The text aligner’s residual convolution blocks (6).
int AlignerHidden { get; set; } The text aligner’s width (256).
int AlignerTokenEmbedding { get; set; } The text aligner’s token embedding width (512).
int FftSize { get; set; } Analysis FFT size.
int HopSize { get; set; } Samples per mel frame.
int MaxTextLength { get; set; } Maximum input phoneme count.
int MelChannels { get; set; } Mel frequency channels.
int MinTrainingFrames { get; set; } Training segments shorter than this many frames are skipped, as the released code skips them (80).
int PitchExtractorLstm { get; set; } Each direction of the pitch extractor’s BiLSTM (256).
int ResidualDim { get; set; } The decoder’s residual phoneme, pitch and energy feature width (64).
int SampleRate { get; set; } Audio sample rate in Hz.
int SamplingSeed { get; set; } Seed of the training draws and of dropout.
int StyleDim { get; set; } Width of the style vector (128).
int TmaStartStep { get; set; } Reconstruction updates before the aligner’s objectives start and the aligner and pitch extractor learn (0; the released code waits 20 epochs, whose length depends on your data — set it for yours).
int VocabSize { get; set; } Phoneme vocabulary size.
int WindowLength { get; set; } The analysis window, in samples (1200).
int[] PitchExtractorChannels { get; set; } The pitch extractor’s conv block and residual block widths (64, 128, 192, 256: the JDC network’s).
string ModelPath { get; set; } Loaded whole-model ONNX graph path.