Skip to main content

JupyterLab extension that captures microphone audio in the browser and streams it to a server-side bridge, exposing it as a virtual audio source so terminal applications running in the container (such as Claude Code voice mode) can record from the user's microphone

Project description

jupyterlab_voice_capture_extension

GitHub Actions npm version PyPI version Total PyPI downloads JupyterLab 4 Brought To You By KOLOMOLO Donate PayPal

Capture microphone audio in the JupyterLab browser tab and stream it to a server-side FIFO, so terminal applications running inside the container - notably Claude Code voice mode - can record from a microphone the container itself has no access to.

The container has no capture device; the browser does. This extension bridges that gap: the browser captures the mic, ships the audio over an authenticated websocket to a Jupyter server handler, and the handler writes raw PCM to a named pipe. A separate, out-of-scope plumbing layer (PulseAudio module-pipe-source + SoX) turns that pipe into the system default audio source.

How it works

  • Capture - a microphone toggle in the status bar calls getUserMedia; an AudioWorklet resamples to 16 kHz mono and encodes signed 16-bit little-endian PCM off the UI thread
  • Transport - 20 ms PCM frames (640 bytes) are sent as binary websocket messages to …/jupyterlab-voice-capture-extension/stream, which lives under the Jupyter base URL and inherits Jupyter token auth - no new port is opened
  • Sink - the server handler writes each frame, in order, to a FIFO (default /run/pulseaudio.fifo); it creates the pipe if absent and tolerates a not-yet-attached reader without blocking the server

Chain: browser mic → AudioWorklet (16 kHz mono s16le) → websocket → server handler → FIFO → (PulseAudio + SoX, out of scope) → terminal app.

[!IMPORTANT] Out of scope - the extension does not manage PulseAudio, invoke SoX or any recorder, or perform speech-to-text; its responsibility ends at delivering correct PCM to the FIFO.

Requirements

  • JupyterLab >= 4.0.0
  • A secure context (https or localhost) - browsers only expose the microphone over a secure origin

Install

pip install jupyterlab-voice-capture-extension

Dependencies

  • Python: jupyter_server and traitlets, installed automatically with the package
  • System (only for the full voice chain into a terminal app): PulseAudio + SoX. Provision and verify them with the bundled CLI:
jupyterlab_voice_capture_extension install    # apt packages + client.conf + Jupyter config line (does NOT start the daemon)
jupyterlab_voice_capture_extension start -d   # start the PulseAudio daemon + pipe-source (run after install and each restart)
jupyterlab_voice_capture_extension validate   # check every component, print what to fix (--json for machine output)
jupyterlab_voice_capture_extension stop       # kill the PulseAudio daemon

See docs/jupyterlab-enable-claude-voice.md for the full setup and troubleshooting.

Usage

  • Click the microphone icon in the status bar (or run Toggle Voice Capture from the command palette) to start capture
  • On the first start the browser asks for microphone permission; the status label moves Disconnected → Connecting → Connected, the icon glows green while streaming, and the browser shows its active-microphone indicator
  • Click again to stop - capture tracks are released and the browser indicator clears
  • Only one tab streams at a time: starting capture in a second tab takes over and stops the first

Configuration

The sink FIFO path defaults to /run/pulseaudio.fifo and is overridable via Jupyter server config:

c.VoiceCapture.sink_path = "/run/pulseaudio.fifo"

Settings → Voice Capture has one option, Auto-connect on startup (autoConnect, default off): when enabled, capture starts automatically as JupyterLab loads instead of waiting for a click.

Uninstall

pip uninstall jupyterlab-voice-capture-extension

Troubleshoot

If you see the frontend extension but it is not working, check that the server extension is enabled:

jupyter server extension list

If the server extension is installed and enabled but you do not see the frontend extension, check the frontend extension is installed:

jupyter labextension list

Contributing

If you would like to contribute to this extension, please refer to the Contributing Guide.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jupyterlab_voice_capture_extension-1.0.6.tar.gz (329.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file jupyterlab_voice_capture_extension-1.0.6.tar.gz.

File metadata

File hashes

Hashes for jupyterlab_voice_capture_extension-1.0.6.tar.gz
Algorithm Hash digest
SHA256 91094e7371ad5c3455ffea714d66681bd8ae9b600c057a2ed1984dc6102e1c40
MD5 c03e74ba7978fb174a5bab8775c1af21
BLAKE2b-256 fed49db46360b980b2108a10c4527666116e96fb82e7c242cb07a0995076eff5

See more details on using hashes here.

File details

Details for the file jupyterlab_voice_capture_extension-1.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for jupyterlab_voice_capture_extension-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 d0466c74377826870992ee6d74d137dc265418a0536fef85aff79ee6b87bf1e2
MD5 352e10f420536291a66d3e0d05fb90d9
BLAKE2b-256 2dd4f94adede7e7082d2ab654bbdb9690d26961fb9bca7bdc0018f572203dd0b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page