Blog

The smart speaker is a closed box. Here is an open one.

A smart speaker is a microphone in your home that answers to someone else. Alexsay is an attempt at one that answers to you.

The closed box

The speakers most homes have are sealed products. The hardware is glued shut, the wake word and the audio processing are proprietary, the assistant is whatever the vendor ships, and the conversation goes to the vendor's cloud. You cannot bring your own model, read the code that listens to your kitchen, or keep the speaker useful once the company loses interest.

Open voice projects exist, and they are good. Home Assistant's Voice Preview Edition and Assist, Rhasspy and OpenVoiceOS all put the pipeline in your hands. Most of them are built as a chain, though: speech to text, then a model, then text to speech. That is a turn-taking walkie-talkie, not a conversation. Mycroft, the best-known open smart speaker, folded, and its stack went with it.

What was missing was the whole stack, open from the board to the server, around a model that actually converses: full duplex, interruptible, and running on your own key.

Open hardware, off the shelf

  • Raspberry Pi 5 runs the speaker and, if you like, Home Assistant next to it.
  • Seeed ReSpeaker Flex XVF3800, the circular four-microphone array (at The Pi Hut), does beamforming and hardware echo cancellation, and drives the speaker from its own amplifier.
  • Visaton R 10 S is the 4 inch full-range driver, tuned in software with a high-pass and a peaking cut.
  • A printed PETG cylinder, about 150 by 210 mm, holds it all. The parts list, wiring and acoustics are in the docs.

Every part can be bought, replaced or swapped. No hardware yet? Any laptop, or a USB microphone and speaker, runs the same software today.

Open software, all of it

The repository holds everything under the MIT licence: the speaker binary, the server, the web app, this website, the install scripts and the release pipeline. Your provider keys are sealed on the server and handed to your speaker in memory only. Point the server at another OpenAI-compatible endpoint and the speakers follow, so "your own AI" can mean your own machine.

Why Rust

A speaker is a real-time audio program that should run for months without attention. Rust fits that job:

  • No garbage collector, so no pauses in the middle of a 10 millisecond audio block.
  • Memory safety in code that parses network events and moves audio between threads.
  • One static binary, under 13 MB, with the audio stack compiled in. There is nothing to install and nothing to drift.
  • Cross-compilation to every target from one codebase, with the logic in a core crate that is tested on the host.

Echo cancellation in software

A speaker that can be interrupted has to hear you over itself. Dedicated chips like the XVF3800 do that in hardware. Alexsay also does it in software, with WebRTC's AEC3 through the pure-Rust sonora crate. Every block the speaker plays goes to the canceller as its reference. The canceller runs on the microphone path at 16 kHz in 10 ms blocks, before the wake word or the model hear anything. On an ordinary laptop, the assistant's own voice dropped from about 80% of the microphone level to about 1%. That is what lets you talk over it.

Runs on what you have

Because the echo cancelling and the wake word live in software, the speaker does not need special hardware. Every release builds for the popular architectures and runs each binary on its own architecture before it ships:

  • Linux x86_64 and aarch64, static, any distribution, including the Raspberry Pi
  • macOS on Apple Silicon and Intel
  • Windows on x86_64 and Arm

The server follows the same rule: one file for Linux, macOS and Windows, with the same code as the cloud version.

If that sounds like the speaker you wanted, build one.

More from the blog