Voxa.Transports.WebSocket 0.7.2-alpha

This is a prerelease version of Voxa.Transports.WebSocket.
dotnet add package Voxa.Transports.WebSocket --version 0.7.2-alpha
                    
NuGet\Install-Package Voxa.Transports.WebSocket -Version 0.7.2-alpha
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Voxa.Transports.WebSocket" Version="0.7.2-alpha" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Voxa.Transports.WebSocket" Version="0.7.2-alpha" />
                    
Directory.Packages.props
<PackageReference Include="Voxa.Transports.WebSocket" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Voxa.Transports.WebSocket --version 0.7.2-alpha
                    
#r "nuget: Voxa.Transports.WebSocket, 0.7.2-alpha"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Voxa.Transports.WebSocket@0.7.2-alpha
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Voxa.Transports.WebSocket&version=0.7.2-alpha&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Voxa.Transports.WebSocket&version=0.7.2-alpha&prerelease
                    
Install as a Cake Tool

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.AspNetCoreapp.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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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