# VoiceConversationOptions

> 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.voiceconversationoptions/
> Summary: VoiceConversationOptions: Options of the real-time voice conversation layer.

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

Options of the real-time voice conversation layer.

```csharp
public sealed class VoiceConversationOptions
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.voiceconversationoptions/">VoiceConversationOptions</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

This capability **changes the hosting model**. A conversation
connection stays open for minutes and binds to one server instance (a sticky
session). The capability is therefore optional: no WebSocket endpoint opens and
no behaviour changes until `UseVoiceConversation` is called.

The type is **not** a `record`: option classes must
not produce a `ToString` that can be written to a log.

## Constructors

### <a id="Tracon_VoiceConversationOptions__ctor"></a> VoiceConversationOptions\(\)

```csharp
public VoiceConversationOptions()
```

## Fields

### <a id="Tracon_VoiceConversationOptions_SectionName"></a> SectionName

The default name of the configuration section.

```csharp
public const string SectionName = "Tracon:Voice:Conversation"
```

#### Field Value

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

### <a id="Tracon_VoiceConversationOptions_IdleTimeout"></a> IdleTimeout

Gets or sets the longest time that can pass without a frame. The default is
2 minutes.

```csharp
public TimeSpan IdleTimeout { get; set; }
```

#### Property Value

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

Must be from one millisecond to about 49.7 days; any other value fails at startup.

### <a id="Tracon_VoiceConversationOptions_InputSampleRate"></a> InputSampleRate

Gets or sets the sample rate (Hz) of clients that send raw PCM. The default is
16,000.

```csharp
public int InputSampleRate { get; set; }
```

#### Property Value

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

Raw PCM has no header; before the audio goes to the transcription provider the
server writes a WAV header, and that header carries this value. A wrong value
makes the audio decode at the wrong rate.

### <a id="Tracon_VoiceConversationOptions_MaxConcurrentConnectionsPerTenant"></a> MaxConcurrentConnectionsPerTenant

Gets or sets the maximum number of conversation connections that one tenant
can hold open at the same time. The default is 5.

```csharp
public int MaxConcurrentConnectionsPerTenant { get; set; }
```

#### Property Value

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

An open connection is not a server thread, but it holds a socket, a buffer and
an agent session. An unlimited number of connections would let a single tenant
fill the server.

### <a id="Tracon_VoiceConversationOptions_MaxConnectionDuration"></a> MaxConnectionDuration

Gets or sets the longest time that a connection can stay open. The default is
30 minutes.

```csharp
public TimeSpan MaxConnectionDuration { get; set; }
```

#### Property Value

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

When the time expires the connection closes cleanly and the client reconnects.
An endless connection means that a leaking resource is never noticed.

Must be from one millisecond to about 49.7 days; any other value fails at startup.

### <a id="Tracon_VoiceConversationOptions_MaxSpokenCharactersPerTurn"></a> MaxSpokenCharactersPerTurn

Gets or sets how many characters of one response are spoken. The default is
5,000.

```csharp
public int MaxSpokenCharactersPerTurn { get; set; }
```

#### Property Value

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

When the limit is exceeded the remaining text is **not spoken**,
but it still streams as captions: the user sees the whole answer and does not
get an answer that was silently truncated.

### <a id="Tracon_VoiceConversationOptions_MaxUtteranceBytes"></a> MaxUtteranceBytes

Gets or sets how many bytes a single utterance can hold. The default is 8 MB.

```csharp
public int MaxUtteranceBytes { get; set; }
```

#### Property Value

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

Next to the duration limit there is also a byte limit: when the client sends
arbitrary data instead of audio the duration may never expire.

### <a id="Tracon_VoiceConversationOptions_MaxUtteranceDuration"></a> MaxUtteranceDuration

Gets or sets the longest duration of a single utterance. The default is
60 seconds.

```csharp
public TimeSpan MaxUtteranceDuration { get; set; }
```

#### Property Value

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

End-of-speech detection (VAD) is **on the client**; the server
does no signal processing. This limit is a *safety net*: when the VAD of
the client never fires the utterance closes on its own and goes to
transcription.

### <a id="Tracon_VoiceConversationOptions_OutputMediaType"></a> OutputMediaType

Gets or sets the MIME type of the synthesized audio. The default is
`audio/mpeg`.

```csharp
public string OutputMediaType { get; set; }
```

#### Property Value

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

The value must be the same as the *configured output format* of the
speech provider (`Tracon:Voice:OutputFormat`). Streaming synthesis
returns raw bytes only and does not report the type; the client has to know the
type to decode the audio. A wrong value produces a silent decode failure in the
browser.

### <a id="Tracon_VoiceConversationOptions_PersistAudio"></a> PersistAudio

Gets or sets a value that indicates whether the conversation audio is written
to the `attachments` table. The default is [false](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool).

```csharp
public bool PersistAudio { get; set; }
```

#### Property Value

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

**Voice is personal data.** That it is not stored by default is
deliberate. When it is enabled the retention policy applies and the
user interface **shows** the user that the audio is recorded — no
recording happens silently.

### <a id="Tracon_VoiceConversationOptions_VoiceId"></a> VoiceId

Gets or sets the identifier of the voice that speaks the responses. When it is
empty the default voice of the provider is used
(`Tracon:Voice:DefaultVoiceId`).

```csharp
public string? VoiceId { get; set; }
```

#### Property Value

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