AudioHyperparameterOptions

Options & Configuration · AiDotNet.Models.Options

Shared configuration for audio and speech models: text-to-speech, speech recognition, speech enhancement and denoising, audio classification and audio generation.

Inheritance: ModelOptions → NeuralNetworkOptions → ModelHyperparameterOptions → AudioHyperparameterOptions

For Beginners

Audio models first turn a sound wave into a picture-like grid of numbers (a spectrogram) and then work on that. Most of the settings here describe how that conversion is done — how many samples per second the audio has, how finely it is chopped up in time, and how many frequency bands are kept. Each model’s own options class ships the values from the paper that introduced it, so you do not normally set any of these.

How It Works

Derived options classes assign their paper’s values in their parameterless constructor. See ModelHyperparameterOptions for why these properties are non-nullable.

This base spans src/TextToSpeech, src/SpeechRecognition and src/Audio because they share the same signal parameters. It lives beside DocumentNeuralNetworkOptions rather than in any one of those areas for the same reason.

Naming. The constructors being replaced use two names for each of two concepts — hopLength and hopSize, fftSize and frameSize. This base picks one of each (HopLength, FftSize), which is the usual naming in the audio literature and in librosa.

Properties

Property Summary
double SpeakingRate { get; set; } Gets or sets the speaking-rate multiplier for synthesised speech.
int FftSize { get; set; } Gets or sets the FFT window size, in samples, used to build each spectrogram frame.
int HiddenDim { get; set; } Gets or sets the width of the model’s main hidden representation.
int HopLength { get; set; } Gets or sets the hop length, in samples, between consecutive spectrogram frames.
int NumDecoderLayers { get; set; } Gets or sets the number of decoder layers, for models that generate audio or text.
int NumEncoderLayers { get; set; } Gets or sets the number of encoder layers.
int NumHeads { get; set; } Gets or sets the number of attention heads.
int NumMels { get; set; } Gets or sets the number of mel frequency bands in the spectrogram.
int SampleRate { get; set; } Gets or sets the audio sample rate in hertz.
string Language { get; set; } Gets or sets the BCP-47 language tag the model is configured for, or null when the model is language-agnostic.