# LiveVoiceBuilderExtensions

> 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.livevoicebuilderextensions/
> Summary: LiveVoiceBuilderExtensions: Extensions that enable the provider-hosted live voice layer.

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

Extensions that enable the provider-hosted live voice layer.

```csharp
public static class LiveVoiceBuilderExtensions
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.livevoicebuilderextensions/">LiveVoiceBuilderExtensions</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.memberwiseclone">object.MemberwiseClone()</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 call changes the hosting model.** A live session binds to
one server instance for as long as it lasts, so a multi-instance deployment needs
sticky routing. It is therefore opt-in: without the call no live route is mapped
and nothing about the application changes.

The call is **independent** of `UseVoiceConversation`.
That layer has Tracon transcribe, run and synthesize; this one has the
provider host the whole conversation and hand work back. They are different
designs for different providers and can be enabled together or separately.

This call registers no provider. A live voice provider is enabled separately —
for example `UseOpenAILive(...)` — and until one is, the live endpoints
answer `501`.

## Methods

### <a id="Tracon_LiveVoiceBuilderExtensions_UseLiveVoice_Tracon_ITraconBuilder_Microsoft_Extensions_Configuration_IConfiguration_"></a> UseLiveVoice\(ITraconBuilder, IConfiguration\)

Enables the live voice layer, reading its settings from configuration.

```csharp
public static ITraconBuilder UseLiveVoice(this ITraconBuilder builder, IConfiguration configurationSection)
```

#### Parameters

`builder` [ITraconBuilder](/api/tracon.itraconbuilder/)

The Tracon chain.

`configurationSection` [IConfiguration](https://learn.microsoft.com/dotnet/api/microsoft.extensions.configuration.iconfiguration)

The `Tracon:Voice:Live` section.

#### Returns

 [ITraconBuilder](/api/tracon.itraconbuilder/)

The continuation of the chain.

#### Examples

```csharp
builder.AddTracon()
       .UseOpenAI(builder.Configuration.GetSection(OpenAIProviderOptions.SectionName))
       .UseOpenAILive(builder.Configuration.GetSection(OpenAILiveOptions.SectionName))
       .UseLiveVoice(builder.Configuration.GetSection(VoiceLiveOptions.SectionName));
```

#### Exceptions

 [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception)

One of the parameters is [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null).

### <a id="Tracon_LiveVoiceBuilderExtensions_UseLiveVoice_Tracon_ITraconBuilder_"></a> UseLiveVoice\(ITraconBuilder\)

Enables the live voice layer with default settings.

```csharp
public static ITraconBuilder UseLiveVoice(this ITraconBuilder builder)
```

#### Parameters

`builder` [ITraconBuilder](/api/tracon.itraconbuilder/)

The Tracon chain.

#### Returns

 [ITraconBuilder](/api/tracon.itraconbuilder/)

The continuation of the chain.

#### Exceptions

 [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception)

`builder` is [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null).

### <a id="Tracon_LiveVoiceBuilderExtensions_UseLiveVoice_Tracon_ITraconBuilder_System_Action_Tracon_VoiceLiveOptions__"></a> UseLiveVoice\(ITraconBuilder, Action<VoiceLiveOptions\>\)

Enables the live voice layer with settings given in code.

```csharp
public static ITraconBuilder UseLiveVoice(this ITraconBuilder builder, Action<VoiceLiveOptions> configure)
```

#### Parameters

`builder` [ITraconBuilder](/api/tracon.itraconbuilder/)

The Tracon chain.

`configure` [Action](https://learn.microsoft.com/dotnet/api/system.action\-1)<[VoiceLiveOptions](/api/tracon.voiceliveoptions/)\>

The settings.

#### Returns

 [ITraconBuilder](/api/tracon.itraconbuilder/)

The continuation of the chain.

#### Exceptions

 [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception)

One of the parameters is [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null).
