Skip to main content

Fast Rust-powered audio playback library for Python

Project description

🎵 sound_rs

sound_rs is a high-performance Python audio library powered by Rust
offering instant playback, low latency, and seamless NumPy integration.

Built for developers who want speed, stability, and simplicity in one package.


🚀 Features

✅ Play .wav files instantly
✅ Generate and play sounds directly from NumPy arrays
✅ Near-zero latency and minimal CPU usage thanks to Rust
✅ Safe, stable, and cross-platform
✅ Async-ready design for future streaming


🧠 Installation

pip install sound_rs

💻 Usage Examples

1️⃣ Basic Playback

import sound_rs

# Supports common formats
sound_rs.play_audio("sound.wav")
sound_rs.play_audio("sound.mp3")
sound_rs.play_audio("sound.m4a")
sound_rs.play_audio("sound.flac")

2️⃣ From NumPy Array

import sound_rs
import numpy as np

# Generate 440 Hz sine wave (A4 note)
sample_rate = 44100
duration = 2.0
t = np.linspace(0, duration, int(sample_rate * duration), dtype=np.float32)
sine_wave = np.sin(2 * np.pi * 440 * t)

# Play directly from array (mono)
sound_rs.play_array(sine_wave, sample_rate)

3️⃣ Stream Large Files

# Play large audio file without full memory load
sound_rs.play_audio_streamed("large_file.wav")

4️⃣ Async Playback

# Play in background while doing other work
sound_rs.play_audio_async("background.wav")

5️⃣ Tone Generator

# Instantly generate and play a 440 Hz sine wave
sound_rs.play_sine_wave(440.0, 1.0, 44100)

🛠️ Roadmap

Step Feature Description
✅ 1 WAV playback Core playback for .wav files
✅ 2 Support for MP3, FLAC, M4A Add support for popular formats
🔜 3 Real-time audio recording Record microphone input and save/play
🔜 4 Volume & playback control Pause, resume, seek, adjust volume
🔜 5 Asynchronous streaming API Non-blocking playback for large or streamed audio
🔜 6 Audio synthesis engine Generate tones, envelopes, and waveforms
🔜 7 Audio visualization tools Waveform and frequency spectrum visualization
🔜 8 AI-powered voice filtering Integration with deep learning filters (noise removal, EQ)
🔜 9 FFI plugin system Allow C/C++/Rust extensions for custom audio effects

⚙️ Built With

  • 🦀 Rust – performance and safety
  • 🔗 PyO3 – bridge between Python and Rust
  • 🧰 Maturin – build and publish Rust-based Python packages
  • 🔊 CPAL / Rodio – for cross-platform audio backend

👨‍💻 Author

Nurassyl Mussainov
Kazakhstan 🇰🇿
Python / Rust Developer

🔗 GitHub: Neksand
📦 PyPI: sound_rs


📜 License

Licensed under the MIT License — free for personal and commercial use.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sound_rs-0.1.5-cp313-cp313-win_amd64.whl (880.9 kB view details)

Uploaded CPython 3.13Windows x86-64

File details

Details for the file sound_rs-0.1.5-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: sound_rs-0.1.5-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 880.9 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for sound_rs-0.1.5-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 a3006188531cb0269bceec2b4e4b66313dbf348b24264400a5405941a7c3304e
MD5 beafd98663ab0d61447274215c60a45c
BLAKE2b-256 e84a60314bfc16254278934b89463a1ee7ae61801531b89e56992d554fd48ff9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page