# SpeechAudio

> Tracon documentation. Tracon is a .NET package family that adds a control
> plane on Microsoft Agent Framework, published as NuGet packages that run
> inside your own ASP.NET Core application.
>
> Page: https://tracon.dev/api/tracon.speechaudio/
> Summary: SpeechAudio: Generated audio.

<div class="api-provenance">Namespace Tracon · Assembly <code>Tracon.Abstractions.dll</code></div>

Generated audio.

```csharp
public sealed class SpeechAudio
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.speechaudio/">SpeechAudio</a></dd><dt>Inherited Members</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a></dd></dl>

## Remarks

The type is **not** a `record`: since the
[SpeechAudio.Data](/api/tracon.speechaudio/#Tracon_SpeechAudio_Data) field can be large, the generated `ToString`/equality
comparison must not accidentally copy the entire content. The same
reason applies to `AttachmentContent`.

## Constructors

### <a id="Tracon_SpeechAudio__ctor"></a> SpeechAudio\(\)

```csharp
public SpeechAudio()
```

## Properties

### <a id="Tracon_SpeechAudio_Alignment"></a> Alignment

Character-level timing, requested via `SpeechRequest.IncludeTimestamps`.
[null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when not requested, or when the provider does not support it.

```csharp
public IReadOnlyList<SpeechAlignment>? Alignment { get; init; }
```

#### Property Value

 [IReadOnlyList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist\-1)<[SpeechAlignment](/api/tracon.speechalignment/)\>?

### <a id="Tracon_SpeechAudio_CharactersBilled"></a> CharactersBilled

The billed character count.

```csharp
public int? CharactersBilled { get; init; }
```

#### Property Value

 [int](https://learn.microsoft.com/dotnet/api/system.int32)?

### <a id="Tracon_SpeechAudio_Data"></a> Data

The raw audio bytes.

```csharp
public required ReadOnlyMemory<byte> Data { get; init; }
```

#### Property Value

 [ReadOnlyMemory](https://learn.microsoft.com/dotnet/api/system.readonlymemory\-1)<[byte](https://learn.microsoft.com/dotnet/api/system.byte)\>

### <a id="Tracon_SpeechAudio_Duration"></a> Duration

The audio's duration. [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) if the provider does not report it.

```csharp
public TimeSpan? Duration { get; init; }
```

#### Property Value

 [TimeSpan](https://learn.microsoft.com/dotnet/api/system.timespan)?

### <a id="Tracon_SpeechAudio_MediaType"></a> MediaType

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

```csharp
public required string MediaType { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)

### <a id="Tracon_SpeechAudio_ModelId"></a> ModelId

The model that produced the audio, as the synthesizer reports it;
[null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when the synthesizer does not report one.

```csharp
public string? ModelId { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)?

#### Remarks

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.

### <a id="Tracon_SpeechAudio_ProviderRequestId"></a> ProviderRequestId

Gets the provider's identifier for this generation, as it reports it;
[null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when it reports none.

```csharp
public string? ProviderRequestId { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)?

#### Remarks

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`).

### <a id="Tracon_SpeechAudio_UsageSource"></a> UsageSource

Where the [SpeechAudio.CharactersBilled](/api/tracon.speechaudio/#Tracon_SpeechAudio_CharactersBilled) value came from.

```csharp
public SpeechUsageSource UsageSource { get; init; }
```

#### Property Value

 [SpeechUsageSource](/api/tracon.speechusagesource/)

#### Remarks

If the provider does not report the count, the text's length is used
and the value becomes [SpeechUsageSource.Estimated](/api/tracon.speechusagesource/).
Showing an estimate as a measurement fabricates a price.
