Voxa.Transports.WebSocket
0.7.2-alpha
dotnet add package Voxa.Transports.WebSocket --version 0.7.2-alpha
NuGet\Install-Package Voxa.Transports.WebSocket -Version 0.7.2-alpha
<PackageReference Include="Voxa.Transports.WebSocket" Version="0.7.2-alpha" />
<PackageVersion Include="Voxa.Transports.WebSocket" Version="0.7.2-alpha" />
<PackageReference Include="Voxa.Transports.WebSocket" />
paket add Voxa.Transports.WebSocket --version 0.7.2-alpha
#r "nuget: Voxa.Transports.WebSocket, 0.7.2-alpha"
#:package Voxa.Transports.WebSocket@0.7.2-alpha
#addin nuget:?package=Voxa.Transports.WebSocket&version=0.7.2-alpha&prerelease
#tool nuget:?package=Voxa.Transports.WebSocket&version=0.7.2-alpha&prerelease
Voxa.Transports.WebSocket
WebSocket source and sink processors for Voxa. Operates over any System.Net.WebSockets.WebSocket — works with ASP.NET Core, ClientWebSocket, or any custom WebSocket subclass.
Tip: for ASP.NET Core hosts, prefer the fluent surface in
Voxa.AspNetCore—app.MapVoxaVoice("/voice", voice => voice.UseSpeechToText(...).UseMicrosoftAgent(agent).UseTextToSpeech(...))wires source, sink, and the agent loop for you. The lower-level API documented below is for hosts that want to build pipelines by hand.
Install
dotnet add package Voxa.Transports.WebSocket --prerelease
Quickstart (ASP.NET Core, lower-level)
app.Map("/voice", async context =>
{
using var ws = await context.WebSockets.AcceptWebSocketAsync();
var pipeline = Pipeline.Build()
.Source(new WebSocketAudioSource(ws))
.Then(new AzureVoiceLiveProcessor(opts))
.Sink(new WebSocketAudioSink(ws));
await using var runner = new PipelineRunner(pipeline, context.RequestAborted);
await runner.StartAsync(ct: context.RequestAborted);
await runner.WaitAsync().WaitAsync(context.RequestAborted);
});
Wire protocol
Binary WebSocket frames carry raw 16-bit PCM (sample rate per WebSocketAudioOptions). Text WebSocket frames carry typed JSON envelopes via WireProtocol:
Client → Server: hello, end, text, toolResult
Server → Client: transcription, text, toolCall, speaking, interruption, status, error, end
The status envelope carries sanitized progress hints for client UI (e.g. "Checking your spending..."). Voxa's MicrosoftAgentVoice driver emits these via StatusFrame whenever a host has configured MicrosoftAgentVoiceOptions.BuildBackendToolStatus for a backend tool.
Custom envelopes — host-defined frames
WebSocketAudioSink accepts a customSerializer hook so hosts can ship their own JSON envelopes for frame types Voxa doesn't know about — without subclassing the sink and re-implementing the send discipline. Return a non-null string to emit it as a text frame; return null to fall through to Voxa's built-in switch.
var sink = new WebSocketAudioSink(ws, customSerializer: frame =>
frame is MyHostFrame f
? JsonSerializer.Serialize(new { type = "myEnvelope", value = f.Value })
: null);
Caller owns the WebSocket lifetime; the processors will not dispose it.
License
MIT.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Voxa.Core (>= 0.7.2-alpha)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Voxa.Transports.WebSocket:
| Package | Downloads |
|---|---|
|
Voxa.AspNetCore
Fluent ASP.NET Core integration for Voxa. Provides MapVoxaVoice + a VoicePipelineBuilder so MAF-using apps can drop in a voice pipeline with a single fluent expression: app.MapVoxaVoice("/voice", v => v.UseSpeechToText(...).UseMicrosoftAgent(agent).UseTextToSpeech(...)). |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.7.2-alpha | 105 | 7/10/2026 |
| 0.7.1-alpha | 74 | 7/10/2026 |
| 0.7.0-alpha | 84 | 7/10/2026 |
| 0.6.0-alpha | 92 | 6/22/2026 |
| 0.5.0-alpha | 81 | 6/13/2026 |
| 0.4.0-alpha | 1,252 | 5/10/2026 |
| 0.3.0-alpha | 76 | 5/9/2026 |
| 0.2.0-alpha | 77 | 5/8/2026 |
| 0.1.0-alpha.2 | 72 | 5/8/2026 |
| 0.1.0-alpha | 76 | 5/8/2026 |