Skip to content
Tracon

VoiceConversationBuilderExtensions

Namespace Tracon · Assembly Tracon.Core.dll

Extensions that enable the real-time voice conversation layer.

public static class VoiceConversationBuilderExtensions

objectVoiceConversationBuilderExtensions

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

This call changes the hosting model. A voice connection stays open for minutes and binds to one server instance; a multi-instance deployment requires sticky sessions, and the reverse proxy must allow WebSocket passthrough. For this reason the feature is opt-in: if the call is not made, no WebSocket endpoint is opened and behavior does not change.

The layer is provider-agnostic: it uses only the ISpeechTranscriber and ISpeechSynthesizer abstractions. This call does not register them — a voice provider must be enabled separately (e.g. UseVoice(...)).

UseVoiceConversation(ITraconBuilder, IConfiguration)

Section titled “ UseVoiceConversation(ITraconBuilder, IConfiguration)”

Enables the conversation layer, reading its settings from configuration.

public static ITraconBuilder UseVoiceConversation(this ITraconBuilder builder, IConfiguration configurationSection)

builder ITraconBuilder

The Tracon chain.

configurationSection IConfiguration

The Tracon:Voice:Conversation section.

ITraconBuilder

The continuation of the chain.

A speech provider is registered separately; this call only opens the conversation layer over it.

builder.AddTracon()
.UseVoice(builder.Configuration.GetSection("Tracon:Voice"))
.UseVoiceConversation(builder.Configuration.GetSection("Tracon:Voice:Conversation"));

ArgumentNullException

One of the dependencies is null.

Enables the conversation layer with default settings.

public static ITraconBuilder UseVoiceConversation(this ITraconBuilder builder)

builder ITraconBuilder

The Tracon chain.

ITraconBuilder

The continuation of the chain.

Registrations are made with TryAdd*: if the consumer registered its own IVoiceSessionStore implementation before this call, theirs is preserved.

The transcription and synthesis providers are resolved optionally with ``ServiceProviderServiceExtensions.GetService```. Requesting a nullable dependency through constructor injection is not enough: the built-in DI container can treat an unregistered type as required even when a C# default value exists. This is why a factory is used.

ArgumentNullException

builder is null.

UseVoiceConversation(ITraconBuilder, Action<VoiceConversationOptions>)

Section titled “ UseVoiceConversation(ITraconBuilder, Action<VoiceConversationOptions>)”

Enables the conversation layer with settings given in code.

public static ITraconBuilder UseVoiceConversation(this ITraconBuilder builder, Action<VoiceConversationOptions> configure)

builder ITraconBuilder

The Tracon chain.

configure Action<VoiceConversationOptions>

The settings.

ITraconBuilder

The continuation of the chain.

ArgumentNullException

One of the parameters is null.