.NET API
TextToSpeechClientBinding
Tracon.Core.dllBinds a Microsoft.Extensions.AI text-to-speech client in the container to a named
Tracon speech synthesizer.
public sealed record TextToSpeechClientBinding : IEquatable<TextToSpeechClientBinding>- Inheritance
- object ← TextToSpeechClientBinding
- Implements
- IEquatable<TextToSpeechClientBinding>
- Inherited Members
- object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”Pass it to TraconBuilderExtensions.AddSpeechSynthesizer.
The client itself stays in the container: register it with the extension of its
own package, or with AddTextToSpeechClient / AddKeyedTextToSpeechClient.
The record declares what the client cannot say about itself. Microsoft.Extensions.AI
reports no character limit, no voice list and, for many clients, no provider name,
and Tracon needs all three: the limit guards speak and
POST /api/voice/speak, the list feeds GET /api/voice/voices, and the name
is what a tenant’s egress policy and provider bindings name.
Constructors
Section titled “Constructors”TextToSpeechClientBinding()
Section titled “ TextToSpeechClientBinding()”public TextToSpeechClientBinding()Properties
Section titled “Properties”MaxCharactersPerRequest
Section titled “ MaxCharactersPerRequest”Gets the most characters one synthesis call accepts. Must be greater than zero.
public required int MaxCharactersPerRequest { get; init; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”Read by the speak tool and by POST /api/voice/speak, which refuse longer
text before the provider is called.
ProviderName
Section titled “ ProviderName”Gets the provider name, or null to read it from the client’s metadata.
public string? ProviderName { get; init; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”A tenant’s egress policy and provider bindings name this value, so it must be the process’s own word for the service, not the client’s. A client with neither this name nor metadata stops the host at startup: a provider with no name could not be checked against any policy.
ServiceKey
Section titled “ ServiceKey”Gets the service key the client is registered under, or null for the unkeyed registration.
public object? ServiceKey { get; init; }Property Value
Section titled “Property Value”Voices
Section titled “ Voices”Gets the voices GET /api/voice/voices lists for this synthesizer. Empty by default.
public IReadOnlyList<VoiceDescriptor> Voices { get; init; }Property Value
Section titled “Property Value”IReadOnlyList<VoiceDescriptor>
Remarks
Section titled “Remarks”A static declaration: the client has no way to list its voices. A call that names no voice leaves the choice to the client.
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(TextToSpeechClientBinding?)
Section titled “ Equals(TextToSpeechClientBinding?)”public bool Equals(TextToSpeechClientBinding? other)Parameters
Section titled “Parameters”other TextToSpeechClientBinding?
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 ==(TextToSpeechClientBinding?, TextToSpeechClientBinding?)
Section titled “ operator ==(TextToSpeechClientBinding?, TextToSpeechClientBinding?)”public static bool operator ==(TextToSpeechClientBinding? left, TextToSpeechClientBinding? right)Parameters
Section titled “Parameters”left TextToSpeechClientBinding?
right TextToSpeechClientBinding?
Returns
Section titled “Returns”operator !=(TextToSpeechClientBinding?, TextToSpeechClientBinding?)
Section titled “ operator !=(TextToSpeechClientBinding?, TextToSpeechClientBinding?)”public static bool operator !=(TextToSpeechClientBinding? left, TextToSpeechClientBinding? right)Parameters
Section titled “Parameters”left TextToSpeechClientBinding?
right TextToSpeechClientBinding?