WebSocket Transport

Stream binary PCM audio frames and JSON control messages over WebSocket to the voice pipeline.

Updated Apr 11, 2026
One-click install
npx skills add https://github.com/Nackalalalong/voicebot-rs --skill websocket-transport
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: WebSocket Transport
Source: https://github.com/Nackalalalong/voicebot-rs/tree/main/skills/websocket_transport
Command: npx skills add https://github.com/Nackalalalong/voicebot-rs --skill websocket-transport

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The WebSocket Transport solves the challenge of real-time, bidirectional communication between browser/mobile clients and the voice pipeline by streaming PCM audio frames and coordinating session control via a WebSocket-based protocol.

Core Features & Use Cases

  • Real-time audio streaming: binary PCM frames are converted to AudioFrame and delivered to the core pipeline with proper timing.
  • Protocol translation: JSON messages for session_start and session_end, and server events mapped to client-friendly signals.
  • Safe, transport-agnostic core: ensures no transport types leak into core and envelopes session lifecycle management.

Quick Start

Start the WebSocket server at /session and route WS upgrades to handle_connection to begin a voice session.

Frequently Asked Questions about WebSocket Transport

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I stream real-time binary PCM audio frames over a WebSocket to a voice pipeline?

To stream real-time binary PCM audio frames over a WebSocket, this transport handles incoming binary data, converts it to AudioFrame objects, and delivers them to the core voice pipeline with proper timing. It coordinates session control using JSON-based protocol messages.

How does WebSocket protocol translation work for voicebot session control?

WebSocket protocol translation for voicebot sessions works by mapping JSON messages like session_start and session_end into core pipeline events. This translation ensures transport types do not leak into the core pipeline while managing the session lifecycle.

Can I use this WebSocket transport for server-side voice pipelines without leaking transport types into core logic?

Yes, you can use this transport for server-side voice pipelines without leaking transport types. It establishes a transport-agnostic core by translating WebSocket-specific protocol messages and binary frames into core pipeline events safely.

What is the best way to handle frame-level audio streaming and session lifecycle management for a voicebot?

The best way to handle frame-level audio streaming and session lifecycle management for a voicebot is using a WebSocket-based transport. It manages binary PCM frame handling and envelopes the session lifecycle to coordinate real-time audio delivery.

How do I start a WebSocket server for real-time voice pipeline connections?

To start a WebSocket server for real-time voice pipeline connections, route WebSocket upgrades to the /session path and invoke the connection handler. This initiates the session and begins processing real-time audio frames and protocol messages.