Turn a Raspberry Pi into a Spotify speaker that appears in the Spotify app as a named Connect device.
Build a terminal-based or headless Spotify player that streams audio to any supported audio backend.
Integrate Spotify Connect playback into a custom home automation or media server project.
Requires a Spotify Premium account, Linux users must install audio library packages before building.
librespot is an open source Rust library that lets applications play music from Spotify and act as a Spotify Connect receiver. Spotify Connect is the feature that allows you to choose which device plays music from within the Spotify app, the way you might send audio from your phone to a smart speaker. With librespot, developers can build custom devices or software that appear as Spotify speakers without relying on Spotify's official, now discontinued, closed-source library. The library only works with Spotify Premium accounts, and the maintainers have stated they will not add support for free-tier features such as ads or skipping limits. To use it, you install it via Cargo, Rust's package manager, with a single command. Once running, it creates a named receiver that shows up in the Spotify app alongside any other Spotify Connect devices you own. You can set the audio bitrate, initial volume, volume normalization, and how the device appears in the app. Credentials and cached audio data are stored locally for repeat use. On macOS and Windows, building requires no extra steps. On Linux, a small number of audio library packages need to be installed first. The library supports many audio output backends, including ALSA, PulseAudio, GStreamer, PortAudio, JACK, and SDL, so it fits into a wide range of Linux audio setups. Pre-built packages are also available through official package managers on Linux, FreeBSD, and NetBSD. Several community projects build on librespot: Spotifyd turns it into a lightweight background service, ncspot wraps it in a terminal-based Spotify player, and raspotify makes it straightforward to set up a Raspberry Pi as a Spotify speaker.
← librespot-org on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.