Skip to content
Tracon

SpeechAudio

Namespace Tracon · Assembly Tracon.Abstractions.dll

Generated audio.

public sealed class SpeechAudio
Inheritance
object ← SpeechAudio
Inherited Members
object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

The type is not a record: since the SpeechAudio.Data field can be large, the generated ToString/equality comparison must not accidentally copy the entire content. The same reason applies to AttachmentContent.

public SpeechAudio()

Character-level timing, requested via SpeechRequest.IncludeTimestamps. null when not requested, or when the provider does not support it.

public IReadOnlyList<SpeechAlignment>? Alignment { get; init; }

IReadOnlyList<SpeechAlignment>?

The billed character count.

public int? CharactersBilled { get; init; }

int?

The raw audio bytes.

public required ReadOnlyMemory<byte> Data { get; init; }

ReadOnlyMemory<byte>

The audio’s duration. null if the provider does not report it.

public TimeSpan? Duration { get; init; }

TimeSpan?

The verified MIME type (for example, audio/mpeg).

public required string MediaType { get; init; }

string

The model that produced the audio, as the synthesizer reports it; null when the synthesizer does not report one.

public string? ModelId { get; init; }

string?

The price is looked up under this model first, then under the model the request named. A synthesizer that reports it is priced correctly even when the caller did not name a model.

Gets the provider’s identifier for this generation, as it reports it; null when it reports none.

public string? ProviderRequestId { get; init; }

string?

The built-in ElevenLabs client reads the request-id response header. A later request names it to keep the speech continuous across requests (elevenlabs.previousRequestIds).

Where the SpeechAudio.CharactersBilled value came from.

public SpeechUsageSource UsageSource { get; init; }

SpeechUsageSource

If the provider does not report the count, the text’s length is used and the value becomes SpeechUsageSource.Estimated. Showing an estimate as a measurement fabricates a price.