Skip to content
Tracon

SpeechRequest

Namespace Tracon · Assembly Tracon.Abstractions.dll

A text-to-speech generation request.

public sealed record SpeechRequest : IEquatable<SpeechRequest>
Inheritance
object ← SpeechRequest
Implements
IEquatable<SpeechRequest>
Inherited Members
object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
public SpeechRequest()

The tenant’s own credential for the provider, or null to use the credential the synthesizer was configured with.

public ModelProviderCredential? Credential { get; init; }

ModelProviderCredential?

Tracon sets it from the tenant’s provider binding for ISpeechSynthesizer.ProviderName, and only for a synthesizer whose ISpeechSynthesizer.SupportsTenantCredentials is true. It lives in memory for the call and is never persisted; its text form never shows the key.

Requests character-level timing alongside the audio. Default false.

public bool IncludeTimestamps { get; init; }

bool

Not supported together with ISpeechSynthesizer.SynthesizeStreamingAsync: that method returns raw audio chunks only and has no channel for alignment data. A synthesizer implementation MUST reject the combination explicitly rather than silently drop the alignment.

The language’s ISO 639-1 code. The provider detects it itself if empty.

public string? LanguageCode { get; init; }

string?

The synthesis model to use. When empty, the synthesizer uses its own default (the built-in client: VoiceOptions.SynthesisModelId).

public string? ModelId { get; init; }

string?

The provider’s output format name (for example, mp3_44100_128).

public string? OutputFormat { get; init; }

string?

This is not a MIME type. Also, not every format can be stored as an attachment: pcm_* and ulaw_* outputs are headerless, match no file signature, and are rejected by the attachment type check.

Gets the provider-specific settings, keyed under the provider’s prefix (for example elevenlabs.stability). Empty by default.

public IReadOnlyDictionary<string, JsonElement> ProviderSettings { get; init; }

IReadOnlyDictionary<string, JsonElement>

A synthesizer refuses an unknown key, another provider’s key and a value of the wrong type before it calls the service; it never ignores one. The message names the key, never the value. A synthesizer that supports no setting refuses every key (ModelProviderSettings.Validate with an empty list). One exception: a synthesizer that serves a Microsoft.Extensions.AI client through AddSpeechSynthesizer(name, binding) hands the keys to the client unchanged, because Tracon cannot tell which keys the client reads.

Code sets it; the speak tool and POST /api/voice/speak send none.

The text to speak.

public required string Text { get; init; }

string

The identifier of the voice to use. VoiceOptions.DefaultVoiceId if empty.

public string? VoiceId { get; init; }

string?

public override bool Equals(object? obj)

obj object?

bool

public bool Equals(SpeechRequest? other)

other SpeechRequest?

bool

public override int GetHashCode()

int

public override string ToString()

string

operator ==(SpeechRequest?, SpeechRequest?)

Section titled “ operator ==(SpeechRequest?, SpeechRequest?)”
public static bool operator ==(SpeechRequest? left, SpeechRequest? right)

left SpeechRequest?

right SpeechRequest?

bool

operator !=(SpeechRequest?, SpeechRequest?)

Section titled “ operator !=(SpeechRequest?, SpeechRequest?)”
public static bool operator !=(SpeechRequest? left, SpeechRequest? right)

left SpeechRequest?

right SpeechRequest?

bool