Skip to main content

No project description provided

Project description

🎙️ 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

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 Distributions

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

rust_silence-0.1.1-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (975.6 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

rust_silence-0.1.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (975.7 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

rust_silence-0.1.1-cp313-cp313-musllinux_1_2_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

rust_silence-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (973.3 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

rust_silence-0.1.1-cp312-cp312-musllinux_1_2_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

rust_silence-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (974.1 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

rust_silence-0.1.1-cp311-cp311-musllinux_1_2_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

rust_silence-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (974.7 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

rust_silence-0.1.1-cp310-cp310-musllinux_1_2_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

rust_silence-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (974.8 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

File details

Details for the file rust_silence-0.1.1-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rust_silence-0.1.1-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f9c94a217e8f03b0b3519c762bb534ac7589074f629e8e995e30c68994c83e4f
MD5 a1a58ccc6cb8843e36389afb1ee9e8da
BLAKE2b-256 e66e3fe2b83a6b67d5650398de1205e73c6725f736de7a681ffcf9bac3e2aab4

See more details on using hashes here.

File details

Details for the file rust_silence-0.1.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rust_silence-0.1.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 75151b81f59bbd741766bc98c52ee37bc142abf2d4daba05c0c20bd4a682a505
MD5 ddfcd25dea9fc20ea55e20349c582f30
BLAKE2b-256 671ca1674e2c592c01b5d83dd2c6d7fd4abdec7b3090cf31ee1b013107f30550

See more details on using hashes here.

File details

Details for the file rust_silence-0.1.1-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for rust_silence-0.1.1-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 aa8e110b87d06fe8269a566644b450559a7fced5908606558b68ed00d428aafc
MD5 dff21850a5ce7d85237dac9a57fae5db
BLAKE2b-256 efb851ac1cc20fafe44afcd61fd8e959c9bee110d94cb735ce840d10e90634d4

See more details on using hashes here.

File details

Details for the file rust_silence-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rust_silence-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4d7e55aff7257ace2731002f3e2746a8c1ce44dd5367231d3f60f955618a8569
MD5 db62ce3919daa58cb966c4865bf79dba
BLAKE2b-256 f00c58d00298a97230c5ca686db17fe08692b18c124bda358db3a70ee1483cc3

See more details on using hashes here.

File details

Details for the file rust_silence-0.1.1-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for rust_silence-0.1.1-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 6af51df93eee85f29b50ee14260288c6704f09456bde013cc8ed75ec2fa7c7ee
MD5 6973135c24585c677264c06bb1023d2e
BLAKE2b-256 ecd83717d63797f66be877caa438b18260e276893a1ca938fde89bb0966f4acf

See more details on using hashes here.

File details

Details for the file rust_silence-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rust_silence-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f5e0ac885ed47ec8573c65f6c8737d64acb5da41f59f4a873159d4244333677c
MD5 7de3c82915f6f576dede7f7fea529d4c
BLAKE2b-256 d4c673dd20ea959fd0484fcea183b5e00e83029266cec34ce2e4b430e8f5097c

See more details on using hashes here.

File details

Details for the file rust_silence-0.1.1-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for rust_silence-0.1.1-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 4f1d7ce31d154c533eceac948cb36178b832697519fad754162d10d7a42ca500
MD5 4bf64b6f57ed43561b3d2d1fde1cc458
BLAKE2b-256 0359f3838280472d6199de7fe33bac53e64ab74983a4830a08d7b3bcc3dcc8d9

See more details on using hashes here.

File details

Details for the file rust_silence-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rust_silence-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e87061cab9fbb53eb3fd5d59fb7faee69dd25949d94e36c967ee172e33277e25
MD5 cfe1344ddd58ad29b5f25970aaf75b0a
BLAKE2b-256 ff7ee248cba68a5f12b9e80548e02c518f84c462bb61c296d3a057732088c098

See more details on using hashes here.

File details

Details for the file rust_silence-0.1.1-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for rust_silence-0.1.1-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 80849ae8f35cc1180e10bc50b5ea669788c4ca2567870e4ec9bbdfc4e5ab578d
MD5 5ec2539afe45ffc9e108cc803ff60895
BLAKE2b-256 251c2bd946431a7106193d8896f0b50e6bc964c06aa78da62306cc773f30e14d

See more details on using hashes here.

File details

Details for the file rust_silence-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rust_silence-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 453194fffe6853d0688b1870b58d38653f1ae5687a7c2c3d7111b756d7c0e5ef
MD5 c811b60e516e915fcefe989b5c021534
BLAKE2b-256 a2a89ea5f6e787dade3f465d392a951977e979221da01d6699cff24c3e88a302

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