.NET API
SpeechRequest
Tracon.Abstractions.dllA 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()
Constructors
Section titled “Constructors”SpeechRequest()
Section titled “ SpeechRequest()”public SpeechRequest()Properties
Section titled “Properties”Credential
Section titled “ Credential”The tenant’s own credential for the provider, or null to use the credential the synthesizer was configured with.
public ModelProviderCredential? Credential { get; init; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”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.
IncludeTimestamps
Section titled “ IncludeTimestamps”Requests character-level timing alongside the audio. Default false.
public bool IncludeTimestamps { get; init; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”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.
LanguageCode
Section titled “ LanguageCode”The language’s ISO 639-1 code. The provider detects it itself if empty.
public string? LanguageCode { get; init; }Property Value
Section titled “Property Value”ModelId
Section titled “ ModelId”The synthesis model to use. When empty, the synthesizer uses its own default
(the built-in client: VoiceOptions.SynthesisModelId).
public string? ModelId { get; init; }Property Value
Section titled “Property Value”OutputFormat
Section titled “ OutputFormat”The provider’s output format name (for example, mp3_44100_128).
public string? OutputFormat { get; init; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”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.
ProviderSettings
Section titled “ ProviderSettings”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; }Property Value
Section titled “Property Value”IReadOnlyDictionary<string, JsonElement>
Remarks
Section titled “Remarks”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; }Property Value
Section titled “Property Value”VoiceId
Section titled “ VoiceId”The identifier of the voice to use. VoiceOptions.DefaultVoiceId if empty.
public string? VoiceId { get; init; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”Equals(object?)
Section titled “ Equals(object?)”public override bool Equals(object? obj)Parameters
Section titled “Parameters”obj object?
Returns
Section titled “Returns”Equals(SpeechRequest?)
Section titled “ Equals(SpeechRequest?)”public bool Equals(SpeechRequest? other)Parameters
Section titled “Parameters”other SpeechRequest?
Returns
Section titled “Returns”GetHashCode()
Section titled “ GetHashCode()”public override int GetHashCode()Returns
Section titled “Returns”ToString()
Section titled “ ToString()”public override string ToString()Returns
Section titled “Returns”Operators
Section titled “Operators”operator ==(SpeechRequest?, SpeechRequest?)
Section titled “ operator ==(SpeechRequest?, SpeechRequest?)”public static bool operator ==(SpeechRequest? left, SpeechRequest? right)Parameters
Section titled “Parameters”left SpeechRequest?
right SpeechRequest?
Returns
Section titled “Returns”operator !=(SpeechRequest?, SpeechRequest?)
Section titled “ operator !=(SpeechRequest?, SpeechRequest?)”public static bool operator !=(SpeechRequest? left, SpeechRequest? right)Parameters
Section titled “Parameters”left SpeechRequest?
right SpeechRequest?