Soundboard

Soundboard

Lightweight web-based soundboard server for low-latency audio playback on Linux

2025WebAudioPythonGitHub

Overview

My roommates and I wanted an easy to way to play sound clips on demand in our living room, accessible from any of our devices and with instant playback. We built a simple, lightweight soundboard web server that can be deployed on any Linux machine. The entire interface runs in the browser, making it easy to trigger sounds from any device on your network. It turns out this was a pretty difficult problem to solve, and I learned a lot about audio programming and low-latency audio processing.

Sounds can be uploaded directly through the web UI. The backend automatically processes the uploaded sounds to remove leading and trailing silence, then converts them to uncompressed WAV format. The server loads all of the sounds into memory, so they can be played instantly when you press a button without the latency of a disk read. It also supports concurrent playback, which means you and your friends can spam the buttons at will!


Features

  • Low Latency Playback: All sounds are loaded into RAM at startup for instant playback
  • Web-Based Interface: Control the soundboard from any device on your network
  • Automatic Processing: Uploaded sounds are trimmed and converted to WAV automatically
  • High Concurrency: Supports many simultaneous audio streams
  • Password Protection: Secure access with authentication
  • Easy Upload: Drag and drop sounds directly in the browser

Technical Details

The server is built with:

  • FastAPI: High-performance Python web framework
  • HTMX: Lightweight frontend interactivity without heavy JavaScript
  • UV: Modern Python package manager for fast dependency installation

When the server starts, all sounds are preloaded into memory. This eliminates disk I/O latency during playback, ensuring sounds trigger instantly when you press a button. The audio buffer size can be adjusted to support more concurrent streams if needed.

Audio Drivers on Linux

Linux audio drivers are a bit of a mess. I found that the PulseAudio driver was the most reliable for low-latency concurrent audio playback, but your mileage may vary.

The app uses cookie-based authentication to protect access on our university network. In production mode, cookies are only sent over HTTPS for security, but in development mode, they are sent over HTTP for convenience.