🎙️ RustSilence: High-Performance Silence Detection (pydub in Rust)
RustSilence is a supercharged Rust implementation of pydub's silence detection module, designed for blazing-fast audio preprocessing. Leveraging the speed and safety of Rust, RustSilence can detect silent segments in WAV, MP3, FLAC, OGG, and more — all in a fraction of the time it takes in Python.
🚀 Why?
pydub is great for quick scripting, but it struggles in performance-critical tasks like real-time TTS. This project combines:
- 🦀 Rust’s speed
- 🔊 Symphonia’s audio decoding
- 🔇 pydub’s silence detection
- 🐍 pyO3 Python bindings
to build a rock-solid preprocessing module for F5-TTS and beyond.
✅ Features
- 🎙️ Mono support only
- 🎧 Decode audio using Symphonia (bits per sample for fmt_ext PCM sub-type must be <= 32 bits)
- 🔇 Detect silence (via
pydub.silence) - 🐍 Python-compatible via pyO3
📦 Installation
$pip install rust-silence
🧪 Example (Python)
import rust_silence
# Accepts WAV, MP3, FLAC, etc.
# Returns a NumPy array (mono, float32)
audio_np, sample_rate = rust_silence.from_file("example.mp3")
silence = rust_silence.detect_silence(audio_np, sample_rate)
Audio loading & resampling powered by Symphonia, silence trimming via pydub.silence.
⚙️ Performance Snapshot
| Task | Python | Rust (pyO3) |
|---|---|---|
| from_file | ~160 ms | ~4 ms |
| detect_silence | ~700 ms | ~17 ms |
| detect_nonsilent | ~700 ms | ~17 ms |
| split_on_silence | ~700 ms | ~17 ms |
| detect_leading_silence | ~280 μs | ~9 μs |
** audio duration 10s and sample rate 32,000 (~320,000 samples) **
Symphonia provides native decoding, multi-format support, and fast performance—ideal for preprocessing pipelines like F5-TTS.
🛣 Roadmap
- Rust engine
- pyO3 integration
- Silence detection (from
pydub)
🧠 Powered by
- Symphonia — fast, accurate audio decoding
- pydub — simple silence detection
- pyO3 — clean Rust ↔ Python bindings
📜 License
MIT
Metadata
Release files for rust-silence 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 10.1 MB
Release files / rust_silence-0.1.2-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | rust_silence-0.1.2-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 975.8 kB |
| Tags | Linux glibc 2.17+ x86-64 PyPy 3.11 PyPy 3.11 7.3 |
|
SHA-256 checksum How to use checksums |
a494faf381e9fd9a0513e99c7ed6ae609361fc98e033865dee8e2533181a0592
|
|
BLAKE2b-256 checksum How to use checksums |
5d938ab48db5b4ee9d7edcaee86b775ad6a8f7bcb1164fdfe75815e731a9e975
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.12
|
Release files / rust_silence-0.1.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | rust_silence-0.1.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 975.8 kB |
| Tags | Linux glibc 2.17+ x86-64 PyPy 3.10 PyPy 3.10 7.3 |
|
SHA-256 checksum How to use checksums |
4f9f2e1f7918659c738b308407167ab29c7de9ad5648717f07e18b3542e1bb8f
|
|
BLAKE2b-256 checksum How to use checksums |
4104190e35388377561709bcca40e5115761b8e2f34a3e30fc7a3516cb873db9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.12
|
Release files / rust_silence-0.1.2-cp313-cp313-musllinux_1_2_x86_64.whl
| Download URL | rust_silence-0.1.2-cp313-cp313-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.13 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
55246207047ba642a6c436c91c031a176394e6705fada6d0b7792f1c30fcbb7c
|
|
BLAKE2b-256 checksum How to use checksums |
2cc5b5817905d6c61ee5c3691059ce89e7ffe1c4827249e1dd1d66f6b5667df5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.12
|
Release files / rust_silence-0.1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | rust_silence-0.1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 973.2 kB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
b60488b5af974d6ebc437da8dd5e83d12a0ec21bec83f69297ac4af0220516d0
|
|
BLAKE2b-256 checksum How to use checksums |
667c879efb55276bdd25e90610c71e7effc1018ab988097bdc1e984c88aafe21
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.12
|
Release files / rust_silence-0.1.2-cp312-cp312-musllinux_1_2_x86_64.whl
| Download URL | rust_silence-0.1.2-cp312-cp312-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.12 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
1ec6baa1d9d46ef20b53831edbd174456a6fbc8316841c490ceb4c52528d620d
|
|
BLAKE2b-256 checksum How to use checksums |
6eb55b85afe97cb9697f08c863d2e0f253e1a47bcc04d425c155a77ce0a065fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.12
|
Release files / rust_silence-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | rust_silence-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 974.0 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
26e3f0169c127ecebc5595f651cd08ff600682e7eebe06fe9513496c99a0c5e9
|
|
BLAKE2b-256 checksum How to use checksums |
55b3dc1d1c34fc768e6fc99d28e8a6b9ad37caeed41c397e1879d3ee53938b18
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.12
|
Release files / rust_silence-0.1.2-cp311-cp311-musllinux_1_2_x86_64.whl
| Download URL | rust_silence-0.1.2-cp311-cp311-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.11 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
a7426a4747577bd9e3af0852baecd468766d115d3d868e9a5345133e1a117cca
|
|
BLAKE2b-256 checksum How to use checksums |
8c77dc35c2af30d84bf8bc0a8eca2d6fd0e446dd8c0a1a94aa007816ac40172d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.12
|
Release files / rust_silence-0.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | rust_silence-0.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 974.7 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
708f8f25162ab49055e6208e658f441a16a54712edfb9d47a2632f235f708139
|
|
BLAKE2b-256 checksum How to use checksums |
31725e9650eae1c4349f7083d9fea53d0fe07a936e217a600f6867e7600d5a76
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.12
|
Release files / rust_silence-0.1.2-cp310-cp310-musllinux_1_2_x86_64.whl
| Download URL | rust_silence-0.1.2-cp310-cp310-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.10 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
a3e6da371c7f7e3be2e5b4450acffd8d5e80f63ae67b0fd9ce79b19b41997a3d
|
|
BLAKE2b-256 checksum How to use checksums |
2b18812ae82508d246263b180db3836dfa141ed3c11f0190fecbdce155f5cc16
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.12
|
Release files / rust_silence-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | rust_silence-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 975.0 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
7d2b7f43bd18789be9ad3f81c20d27b0b12e7f2e39b3a8281d114079f429217d
|
|
BLAKE2b-256 checksum How to use checksums |
82c17203eec0de8225683893fa70d90fd723a23f2e102afc909f71de25e24e84
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.12
|