This "lofipi" 3D-Printed Speaker Streams Lo-Fi Beats via a Raspberry Pi — or Generates Them Itself

Nicholas Sherlock's desktop music player comes ready to stream your favorite tracks from YouTube, courtesy of a Raspberry Pi.

Maker Nicholas Sherlock has put together a Raspberry Pi-powered machine dedicated to streaming lo-fi beats from Google's YouTube — and decided to house it inside a custom-built 3D-printed speaker enclosure, complete with cooling fan and hardware tone and playback controls.

"Chill out to some Lo-Fi beats with this Raspberry-Pi powered speaker," Sherlock writes of the project. "I based the visual design of the speaker on La Wood Television (New Zealand) Ltd's 'Lara' radio. Please note that I don't know the first thing about speaker enclosure design, so don't expect the sound quality to be world class. Consider it to be a lo-fi aesthetic. In particular you shouldn't expect thumping bass out of this thing."

The enclosure itself is 3D-printed using a "cherry wood" PLA filament, which is then sanded and treated with walnut-color stain. Inside the housing is a Raspberry Pi 3 Model B+ single-board computer, which uses the mpv command-line audio player to stream music from a YouTube playlist — in Sherlock's case lo-fi beats, though this can be changed on-demand. The audio comes out of a central 3.5" full-range speaker, linked to a Geekwork X400 v3.0 digital to analog converter (DAC) and amplifier.

To keep everything cool, a compact fan is connected to the Raspberry Pi's general-purpose input/output (GPIO) header with pulse-width modulation (PWM) for temperature-based speed control. Also connected to the GPIO header is a tone knob at the front, next to the volume control, which fades between two equalizer presets; a single button provides a rudimentary interface for pausing, playing, and skipping songs.

Interestingly, there's a variant of the project which doesn't stream audio — instead generating it procedurally on the device itself. "My original design for this speaker was for it to be fully offline, and play infinite lo-fi hiphop thanks to the algorithmically-generated beats of Dylan Turner's," Sherlock explains.

"This website is too slow to run on the Pi 3B+, it takes about 3 minutes to render 1 minute of audio. But it only takes advantage of a single core. So I ported his algorithm to run in Node.js instead, where I can use Node's worker threads to render four songs in parallel on the Pi's four cores. This allows the Pi to render faster than real-time, and so after an initial loading period it can stream music continuously."

Unfortunately, Turner's tool isn't open source and thus can't be redistributed — but Sherlock has instead uploaded the YouTube-streaming version to GitHub, along with a parts list and STL files for printing the enclosure. Those eager to try it out, however, are warned that the Raspberry Pi 4 is not yet supported, thanks to changes in the port types and locations.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire:
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles