Build an ESP32 Snapcast Audio Client: Synchronized Multi-Room Speakers Without a Raspberry Pi
Snapcast is a genuinely elegant synchronized multi-room audio system — a single server streams to any number of clients, all playing back within a few milliseconds of each other, which is the whole trick behind whole-home audio that doesn't sound staggered walking between rooms. Our Raspberry Pi whole-home audio coverage already touches Volumio-based multi-room setups, but a full Raspberry Pi per room is overkill if all you need is a synchronized playback endpoint. This project builds a dedicated Snapcast client on an ESP32, using its I2S audio output directly, for a fraction of the cost and footprint of a Pi-based client in every room.
Why ESP32 Instead of a Pi for the Client Side
Snapcast's client (`snapclient`) is normally a Linux binary, which is why most DIY synchronized-audio builds default to a Raspberry Pi in every room. But Snapcast's open protocol has been reimplemented for the ESP32 by the community specifically because a full Linux SBC is a lot of hardware just to decode a stream and play it out an I2S DAC. The ESP32 build handles the same clock-synchronized playback the official client does, at a fraction of the power draw and bill-of-materials cost, which matters a lot once you're deploying four, six, or ten room endpoints rather than just one.
Wiring the I2S DAC
Wire the MAX98357A exactly as you would for any other ESP32 I2S audio project: BCLK and LRC (word select) go to two GPIOs of your choosing, DIN carries the audio data, and the module's own class-D amplifier drives the speaker directly — no separate amp stage needed. Leave the SD/mode pin either floating or pulled per the module's datasheet depending on whether you want stereo-left, stereo-right, or the module's internal mono-mix behavior; for a single small speaker, the mono-mix configuration is usually what you want.
MAX98357A PinESP32 GPIO (example)Purpose BCLKGPIO 26Bit clock LRCGPIO 25Left/right word select DINGPIO 22Serial audio data GAINTie per datasheetSets amplifier gain stage VIN / GND5V / GNDPowerFlashing the ESP32 Snapclient Firmware
Build the community ESP32 Snapcast client firmware with ESP-IDF or PlatformIO rather than the Arduino IDE — the project depends on FreeRTOS task-level control over I2S DMA buffers and network timing that's easier to manage directly through ESP-IDF's build system. Configure the firmware with your WiFi credentials and your Snapcast server's IP address and port (default 1704 for the stream, 1705 for control) through its `menuconfig` or config header, flash it, and the board will announce itself to the Snapcast server as a new client on boot.
Setting Up the Snapcast Server
If you don't already have a Snapcast server running, the simplest path is installing `snapserver` on a Raspberry Pi or any always-on Linux box on your network, pointed at a source like a local music library, Spotify Connect via librespot, or a shared audio pipe from a media player. Each ESP32 client that connects shows up in the server's client list, where you can group clients into synchronized zones, adjust per-client volume, and route different audio sources to different rooms independently.
Dialing In Sync and Buffer Latency
Snapcast's whole premise is sample-accurate synchronization, and the ESP32 client achieves this by buffering incoming audio and timing playback against the server's clock reference rather than just playing data as it arrives. If you hear audible drift or occasional stutter between rooms, increase the client-side buffer in the firmware config slightly before assuming it's a network problem — a few hundred extra milliseconds of buffer is inaudible as added latency for whole-home background audio but gives the sync algorithm more room to work with on a congested WiFi network.
Enclosure and Placement
A small 3D printed enclosure with ventilation slots for the MAX98357A's class-D amp and room for the speaker driver keeps the build tidy for permanent room installation; mount it near an outlet since this is a mains-powered always-on endpoint, not a battery project. If you're deploying several of these around a house, label each one in the Snapcast server's client list with its room name immediately on first connect — it's much easier to do this while you're standing in the room than to guess later from a list of MAC-address-derived client IDs.
Once you've got one client working cleanly, duplicating it is just a matter of flashing another ESP32 and wiring another MAX98357A — the real cost and complexity of whole-home synchronized audio collapses dramatically once you're not putting a full SBC in every room. For a music-and-podcast background audio system, this is a far cheaper and lower-maintenance path than a Pi in every room, with sync quality that holds up just as well.