Skip to content

VoiceConversationOptions

Namespace AgentPrism · Assembly AgentPrism.Core.dll

Options of the real-time voice conversation layer.

public sealed class VoiceConversationOptions

objectVoiceConversationOptions

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

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.

public VoiceConversationOptions()

The default name of the configuration section.

public const string SectionName = "AgentPrism:Voice:Conversation"

string

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

public TimeSpan IdleTimeout { get; set; }

TimeSpan

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

public int InputSampleRate { get; set; }

int

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.

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

public int MaxConcurrentConnectionsPerTenant { get; set; }

int

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.

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

public TimeSpan MaxConnectionDuration { get; set; }

TimeSpan

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

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

public int MaxSpokenCharactersPerTurn { get; set; }

int

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.

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

public int MaxUtteranceBytes { get; set; }

int

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.

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

public TimeSpan MaxUtteranceDuration { get; set; }

TimeSpan

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.

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

public string OutputMediaType { get; set; }

string

The value must be the same as the configured output format of the speech provider (AgentPrism: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.

Gets or sets a value that indicates whether the conversation audio is written to the attachments table. The default is false.

public bool PersistAudio { get; set; }

bool

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.

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

public string? VoiceId { get; set; }

string?