Audio I/O for Python,
running in the browser.
Record the microphone and play audio back from Python inside the browser — Pyodide, JupyterLite, thebe — straight to and from a NumPy array. No native PortAudio, no server.
Features
01Record
Capture mic input to a float32 NumPy array.
→
02Play
Push any NumPy buffer to the speakers.
→
03sounddevice facade
Drop-in
browseraudio.sounddevice: query_devices, default, single-cell play, and a rec that guides you to the two-cell flow.
→
04Streaming
Generator → ring buffer → AudioWorklet.
roadmap
Why it exists
Python can't reach the speakers, so it asks the page
In the browser, Python usually runs in a Web Worker with no access to
getUserMedia or the Web Audio API — so the usual
sounddevice → PortAudio stack can't run. browseraudio does the
capture and playback on the page's main thread, through a small
anywidget frontend, and ships the samples
across to the kernel.