Table of Contents

Class AudioGenOptions

Namespace
AiDotNet.Audio.AudioGen
Assembly
AiDotNet.dll

Configuration options for audio generation models.

public class AudioGenOptions
Inheritance
AudioGenOptions
Inherited Members

Remarks

AudioGen models generate audio from text descriptions using a language model approach with discrete audio codes (like EnCodec).

For Beginners: AudioGen works differently from TTS: - TTS: Converts specific text to spoken words - AudioGen: Creates sounds/music matching a description

Example prompts:

  • "A dog barking in the distance"
  • "Gentle piano music with rain sounds"
  • "Crowd cheering at a sports event"

Properties

AudioCodecPath

Gets or sets the path to the audio codec (decoder) model.

public string? AudioCodecPath { get; set; }

Property Value

string

Channels

Gets or sets the number of audio channels (1=mono, 2=stereo).

public int Channels { get; set; }

Property Value

int

DurationSeconds

Gets or sets the duration of generated audio in seconds.

public double DurationSeconds { get; set; }

Property Value

double

GuidanceScale

Gets or sets the classifier-free guidance scale. Higher values = stronger prompt following.

public double GuidanceScale { get; set; }

Property Value

double

LanguageModelPath

Gets or sets the path to the language model.

public string? LanguageModelPath { get; set; }

Property Value

string

MaxDurationSeconds

Gets or sets the maximum duration in seconds.

public double MaxDurationSeconds { get; set; }

Property Value

double

ModelSize

Gets or sets the model size to use.

public AudioGenModelSize ModelSize { get; set; }

Property Value

AudioGenModelSize

OnnxOptions

Gets or sets the ONNX execution options.

public OnnxModelOptions OnnxOptions { get; set; }

Property Value

OnnxModelOptions

SampleRate

Gets or sets the output sample rate.

public int SampleRate { get; set; }

Property Value

int

Seed

Gets or sets the random seed for reproducibility. Null for random generation.

public int? Seed { get; set; }

Property Value

int?

Temperature

Gets or sets the temperature for sampling. Higher values = more random, lower = more deterministic.

public double Temperature { get; set; }

Property Value

double

TextEncoderPath

Gets or sets the path to the text encoder model.

public string? TextEncoderPath { get; set; }

Property Value

string

TopK

Gets or sets the top-k value for sampling. Only the top k tokens are considered.

public int TopK { get; set; }

Property Value

int

TopP

Gets or sets the top-p (nucleus) value for sampling.

public double TopP { get; set; }

Property Value

double