.NET API
VoiceOptions
Tracon.Voice.dllSettings for the voice tools.
public sealed class VoiceOptions- Inheritance
- object ← VoiceOptions
- Inherited Members
- object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”The type cannot be a record: the compiler-generated
ToString writes every property, and a single LogDebug("{Options}", o)
call would leak VoiceOptions.ApiKey into the log.
SecretLeakTests verifies the type does not define its own ToString.
Constructors
Section titled “Constructors”VoiceOptions()
Section titled “ VoiceOptions()”public VoiceOptions()Fields
Section titled “Fields”DefaultOutputFormat
Section titled “ DefaultOutputFormat”Default output format.
public const string DefaultOutputFormat = "mp3_44100_128"Field Value
Section titled “Field Value”Remarks
Section titled “Remarks”MP3 is chosen because the attachment store does type checking from the
magic byte. pcm_* and ulaw_* outputs have no header
and are rejected.
SectionName
Section titled “ SectionName”Default name of the configuration section.
public const string SectionName = "Tracon:Voice"Field Value
Section titled “Field Value”Properties
Section titled “Properties”ApiKey
Section titled “ ApiKey”The API key. A secret: it lives only in
dotnet user-secrets or an environment variable.
public string? ApiKey { get; set; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”The key’s value is held here, not its name. The rule forbids
writing secrets to the DATABASE; voice configuration never reaches the
database, and the other four provider packages also carry a plain ApiKey.
DefaultVoiceId
Section titled “ DefaultVoiceId”Voice to use when the request gives no voice id.
public string? DefaultVoiceId { get; set; }Property Value
Section titled “Property Value”DialogueModelId
Section titled “ DialogueModelId”The dialogue model of the built-in client. When empty, the request names none and the provider uses its own default.
public string? DialogueModelId { get; set; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”VoiceOptions.SynthesisModelId is not used for a dialogue: the single-voice default
(eleven_multilingual_v2) is not a dialogue model. A result made with the
provider’s default reports no model, so its price is looked up without one.
Endpoint
Section titled “ Endpoint”Base address. When empty, the provider’s public address is used.
public Uri? Endpoint { get; set; }Property Value
Section titled “Property Value”Uri?
MaxCharactersPerRequest
Section titled “ MaxCharactersPerRequest”Maximum characters that can be spoken in a single request. Default 5,000.
public int MaxCharactersPerRequest { get; set; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”When the limit is exceeded, the tool returns an error; it does not silently truncate the text. Truncation produces a sentence the user never hears, and the reason becomes invisible.
MaxConcurrentRequests
Section titled “ MaxConcurrentRequests”How many voice requests can run at once. Default 2.
public int MaxConcurrentRequests { get; set; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”Synthesis, dialogue and transcription share this one limit.
MaxDialogueCharactersPerRequest
Section titled “ MaxDialogueCharactersPerRequest”Maximum characters one dialogue request can carry, summed over its turns. Default 2,000, the provider’s guidance for reliable generation.
public int MaxDialogueCharactersPerRequest { get; set; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”A longer dialogue is refused, not split: the caller splits it at a point that suits
its content and joins the audio. ISpeechDialogueSynthesizer.DialogueCapabilities
reports this value.
OutputFormat
Section titled “ OutputFormat”Output format.
public string OutputFormat { get; set; }Property Value
Section titled “Property Value”Provider
Section titled “ Provider”The built-in client to use. Currently only elevenlabs is supported.
public string Provider { get; set; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”This setting, VoiceOptions.ApiKey and VoiceOptions.Endpoint configure the
built-in client only. When your own ISpeechSynthesizer and
ISpeechTranscriber are registered BEFORE UseVoice, the
three are not validated and not required.
Prices in Tracon:Pricing:Voice are keyed by the ProviderName
of the implementation that did the work, not by this value.
RequireApproval
Section titled “ RequireApproval”Whether voice tools require explicit approval before a call. Default false.
public bool RequireApproval { get; set; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”The tool causes no irreversible side effect — it produces a file and spends money. Cost can be a reason on its own; that is why the setting exists, off by default.
SynthesisModelId
Section titled “ SynthesisModelId”Default synthesis model.
public string? SynthesisModelId { get; set; }Property Value
Section titled “Property Value”Timeout
Section titled “ Timeout”Request timeout. 100 seconds when empty.
public TimeSpan? Timeout { get; set; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”Must be from one millisecond to about 24.8 days (Int32.MaxValue milliseconds) when set; any other value fails at startup.
TranscriptionModelId
Section titled “ TranscriptionModelId”Default transcription model.
public string? TranscriptionModelId { get; set; }