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.0-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.0-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.0-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.0-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.0-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.0-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.0-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.0-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.0-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.0-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.0-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rust_silence-0.1.0-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 88830e2c3dfa669d3d4516948b8823f35e589e33f9c23b274397d69a98cfa792
MD5 bca8889503c72352409cabbf1adc915b
BLAKE2b-256 6c065f9e305bfeeb0b4c795d0e9d96865621e35488919c20e0fd28d598814436

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rust_silence-0.1.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 96db0f72f30199b491dd11a7258c547d5a82d12efb4e15be88240674278966ea
MD5 4ae6e9889cc184c134adb612ca0fddc0
BLAKE2b-256 6ea788f1ce2fb637a67ceb3c65fe411de5bfb0ca30b1eea7ae6843d28f381375

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rust_silence-0.1.0-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 a14e9d00b8803c638942fade380da3c83c64aec645634ffbbe230a51a23063d4
MD5 740f28d7f59efe0d729ea005725dea6b
BLAKE2b-256 c28a292266a8dfecb6a332a66dd115cc1555f9de38d9273f1411e231df39a1d1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rust_silence-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2631bc5e6e3730b3914a2bec8d5df9a957e1c3ef6b20fb53d386b33606959afc
MD5 1c37ba630fd3c9d7933ece20c8d54c0a
BLAKE2b-256 d7968c08dc3b2be3638a95eb28b487ffb7ede417bc21fb3cd71512d05c078a61

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rust_silence-0.1.0-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 14aca6eb2b5fee1dc24fd814ef9c507965e61c2b3cc68f4d69bf2aa1b0f3fa00
MD5 6964d11d6e1db59ba416553e6e13fd35
BLAKE2b-256 03c202dceaa02990ffaa21fcfe8e91dbb4b2015669b2c9fc3cada8ac7fc808cf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rust_silence-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a1ff1de1350ccfc29ba0b507ea7852ca2a6ae2ffbb1061ebec26316af25db0ad
MD5 9640b1c109c1549d58c1b569e4fc8880
BLAKE2b-256 4919f0613597d2144f083fd2940dc46458769aac454e95e597003b9a2f8c5f74

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rust_silence-0.1.0-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 1a4a31bb05e761903a74c654ff3c8b62b29e0793285b1027dad3d778f5d7e1ac
MD5 8a5202d8db11a81eee5c0136588f678d
BLAKE2b-256 d3ace42e95b2f99e2e8c541fcf55e266c62de6a58334166981dc68740af62015

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rust_silence-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3fb6fddafe87daa0e5e648a5e4b93086ec7c9a009e3937730599a3bc745c8c06
MD5 ad90f42c63230232125e933f400a16da
BLAKE2b-256 6bf6d1f80e5e82d2dc205b4d362f2883d3355a274580460a6d028441ef318d5d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rust_silence-0.1.0-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 0e8457a84001047126507d3531f1a6d50fe62ba395191a151fb929308683f06a
MD5 9c891d5ec08a1cf5b5657885b0984a55
BLAKE2b-256 3935bda2821f3b7b1db81bca538501b9e120301445ed4dcd6d48612ea7dcda53

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rust_silence-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b0b431b09e0cbe234b8ba64ffb49d718cde2752d36dccf5140ba5bd5a0a53367
MD5 ae621e7c478d4bc3c0ddd9820996cabd
BLAKE2b-256 9dad5bdf85023247506660cc0a7111213d4189df60a8ec40738d5ad9d16c49a0

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