Skip to content
Tracon

VoiceConversationProtocol

Namespace Tracon · Assembly Tracon.Core.dll

The frame names and the audio formats of the conversation WebSocket.

public static class VoiceConversationProtocol

objectVoiceConversationProtocol

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

The names stay aligned with the existing SSE contract; the user interface does not carry two different mental models. These are a stable contract: to change them breaks clients.

Text frames are JSON and binary frames are raw audio. The direction follows from the name of the frame, not from its type.

Interruption (barge-in): stop the generation.

public const string ClientCancel = "cancel"

string

Speech ended; answer now.

public const string ClientCommit = "commit"

string

Starts the conversation.

public const string ClientStart = "start"

string

Closes the connection.

public const string ClientStop = "stop"

string

The audio chunks ended.

public const string ServerAudioEnd = "audioEnd"

string

The binary frames that follow are audio chunks.

public const string ServerAudioStart = "audioStart"

string

The turn ended.

public const string ServerDone = "done"

string

An error.

public const string ServerError = "error"

string

The commit closed nothing: it arrived before any audio, so no turn ran and the conversation is listening again.

public const string ServerIdle = "idle"

string

This is not an error - a short cough can trigger the client’s voice activity detection, and pressing send inside the recorder’s first timeslice commits before a chunk has been sent. It is a separate frame from VoiceConversationProtocol.ServerDone on purpose: done closes a turn that exists and carries that turn’s number and cancellation flag, so a client that treats the two alike would rewrite the record of the PREVIOUS turn. A client that receives this returns to listening and reopens its microphone; it must not add a transcript entry.

The server is ready for the conversation.

public const string ServerReady = "ready"

string

The run started; the frame carries its identifier.

public const string ServerRunStarted = "runStarted"

string

A text response (caption).

public const string ServerText = "text"

string

The transcribed speech text.

public const string ServerTranscript = "transcript"

string

The name of the WebSocket sub-protocol. The handshake echoes it back.

public const string SubProtocol = "tracon.voice.v1"

string

The sub-protocol prefix that carries the bearer token.

public const string TokenSubProtocolPrefix = "tracon.token."

string

The token is not put in the query string: the address is written to server logs, to reverse proxy logs and to the browser history. A browser cannot add a custom header to a WebSocket handshake; the standard way out is the Sec-WebSocket-Protocol header.