01 · Start
Installation
One command. Wheels carry the decoders, so no ffmpeg or development headers are needed.
pip install sound_rs
Requirements
- Python 3.10 or newer, CPython.
- Linux x86_64, Windows amd64 or macOS arm64 — the platforms below ship prebuilt wheels.
- NumPy only if you use
play_array,loadorload_many.
| Platform | Wheel | Python |
|---|---|---|
| Linux x86_64 | manylinux_2_17 | 3.10–3.14 |
| Windows amd64 | win_amd64 | 3.10–3.14 |
| macOS arm64 | macosx_11_0_arm64 | 3.10–3.14 |
Anything else — musl, ARM Linux, Intel Macs, PyPy — falls back to the source distribution,
which needs a Rust toolchain (cargo) on the machine.
From source
git clone https://github.com/Neksand/sound_rs
cd sound_rs
pip install maturin
maturin develop --release
Linux audio
Playback uses ALSA through cpal. Most desktops already have the runtime
library; a minimal container or server needs it explicitly:
sudo apt install libasound2 # Debian / Ubuntu (libasound2t64 on 24.04+)
sudo dnf install alsa-lib # FedoraDecoding does not need ALSAIf the library is missing,
import sound_rs fails at load time, not on the first play. Install the package above, or use a build with playback disabled.Check it works
import sound_rs
print(sound_rs.__version__)
print(sound_rs.list_devices()) # [(0, 'MacBook Pro Speakers', True), ...]
print(sound_rs.get_audio_info("song.mp3"))
From a terminal, soundrs --help prints the same check as a command, with the
documentation link. See Command line.
No sound, or an empty device list? See Troubleshooting.