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.2-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (975.8 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

rust_silence-0.1.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (975.8 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

rust_silence-0.1.2-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.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (973.2 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

rust_silence-0.1.2-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.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (974.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

rust_silence-0.1.2-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.2-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.2-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.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (975.0 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

File details

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

File metadata

File hashes

Hashes for rust_silence-0.1.2-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a494faf381e9fd9a0513e99c7ed6ae609361fc98e033865dee8e2533181a0592
MD5 e7acfb9f7dee6a308c50a5476b638755
BLAKE2b-256 5d938ab48db5b4ee9d7edcaee86b775ad6a8f7bcb1164fdfe75815e731a9e975

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rust_silence-0.1.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4f9f2e1f7918659c738b308407167ab29c7de9ad5648717f07e18b3542e1bb8f
MD5 4ca466aaf81b4644e07f8aa3e5bcb55e
BLAKE2b-256 4104190e35388377561709bcca40e5115761b8e2f34a3e30fc7a3516cb873db9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rust_silence-0.1.2-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 55246207047ba642a6c436c91c031a176394e6705fada6d0b7792f1c30fcbb7c
MD5 ccc5aede81fa117e0b05c3d1bb5e9b8a
BLAKE2b-256 2cc5b5817905d6c61ee5c3691059ce89e7ffe1c4827249e1dd1d66f6b5667df5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rust_silence-0.1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b60488b5af974d6ebc437da8dd5e83d12a0ec21bec83f69297ac4af0220516d0
MD5 5ddd997482135527eac48bf55c92eac1
BLAKE2b-256 667c879efb55276bdd25e90610c71e7effc1018ab988097bdc1e984c88aafe21

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rust_silence-0.1.2-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 1ec6baa1d9d46ef20b53831edbd174456a6fbc8316841c490ceb4c52528d620d
MD5 ff9694a01b7e9eb6f6c755832371625d
BLAKE2b-256 6eb55b85afe97cb9697f08c863d2e0f253e1a47bcc04d425c155a77ce0a065fd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rust_silence-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 26e3f0169c127ecebc5595f651cd08ff600682e7eebe06fe9513496c99a0c5e9
MD5 b2bf274b5c2ddd841409632c29d5c24a
BLAKE2b-256 55b3dc1d1c34fc768e6fc99d28e8a6b9ad37caeed41c397e1879d3ee53938b18

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rust_silence-0.1.2-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 a7426a4747577bd9e3af0852baecd468766d115d3d868e9a5345133e1a117cca
MD5 91ff9c67aa03ccfa50cbe424471cd518
BLAKE2b-256 8c77dc35c2af30d84bf8bc0a8eca2d6fd0e446dd8c0a1a94aa007816ac40172d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rust_silence-0.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 708f8f25162ab49055e6208e658f441a16a54712edfb9d47a2632f235f708139
MD5 83500d01f51d00411e596839c81f6e58
BLAKE2b-256 31725e9650eae1c4349f7083d9fea53d0fe07a936e217a600f6867e7600d5a76

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rust_silence-0.1.2-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 a3e6da371c7f7e3be2e5b4450acffd8d5e80f63ae67b0fd9ce79b19b41997a3d
MD5 f04717e6bee693bb5c6eeb431b8f211f
BLAKE2b-256 2b18812ae82508d246263b180db3836dfa141ed3c11f0190fecbdce155f5cc16

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rust_silence-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7d2b7f43bd18789be9ad3f81c20d27b0b12e7f2e39b3a8281d114079f429217d
MD5 03d9ea63342079f6c15f16e34daf2f3f
BLAKE2b-256 82c17203eec0de8225683893fa70d90fd723a23f2e102afc909f71de25e24e84

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