Audio Splitter VAD 🎙️✂️
A lightning-fast, production-ready Python library for audio silence removal and multithreaded chunking.
Built on top of Google's robust WebRTC Voice Activity Detection (VAD) engine, this tool allows you to strip silence from audio files and slice pure speech into manageable chunks. It is fully optimized for scale, featuring both I/O-bound multithreading for single massive files and CPU-bound multiprocessing for directories with thousands of files.
Features
- Silence Stripping: Automatically detect and remove non-speech frames using WebRTC VAD.
- Smart Slicing: Yield continuous chunks of pure speech at any desired duration.
- Universal Input: Natively accepts
.mp3and.wavfiles and automatically converts them into the 16-bit mono PCM format required by WebRTC. - Multithreaded Export: Bypass the GIL by saving hundreds of chunks to disk concurrently.
- Batch Processing: Utilize all CPU cores via multiprocessing to process thousands of audio files at maximum speed.
Installation
Install the package via pip (or uv):
pip install audio-splitter-vad
⚠️ System Requirement
This library uses
pydubunder the hood to decode.mp3files. You must have FFmpeg installed on your system and available in yourPATH.
Install FFmpeg
macOS
brew install ffmpeg
Linux
sudo apt install ffmpeg
Windows
Download FFmpeg from gyan.dev or install it with:
winget install ffmpeg
Quick Start
1. Memory-Efficient Generator (Streaming)
Ideal for streaming chunks directly to transcription APIs like Whisper or Google Cloud without saving them to disk.
from audio_splitter_vad.splitter import Splitter
audio_splitter = Splitter()
# Yield 5-second chunks of pure speech (silence removed)
for chunk in audio_splitter.split(
"podcast.mp3",
slice_duration=5,
strip_silence=True,
):
print(f"Received {len(chunk)} bytes of pure speech!")
# Send chunk to your API...
2. High-Speed Multithreaded Slicing (Single File)
Quickly split a single massive audio file into hundreds of .wav chunks on your hard drive.
from audio_splitter_vad.splitter import Splitter
audio_splitter = Splitter()
# Save chunks concurrently using background threads
saved_files = audio_splitter.split_multithreaded(
audio_path="massive_interview.wav",
save_path="./clean_chunks",
slice_duration=5,
max_workers=8,
strip_silence=True,
)
print(f"Successfully exported {len(saved_files)} chunks.")
3. Core-Max Batch Processing (Directories)
If you have a folder containing thousands of audio files, use multiprocessing instead of multithreading. This assigns an isolated VAD engine to every CPU core for maximum throughput.
from audio_splitter_vad.batch_split import batch_process_directory
batch_process_directory(
input_folder="./raw_podcasts",
output_folder="./processed_datasets",
strip_silence=True,
)
Advanced Configuration
You can pass a custom WebRTC VAD engine when initializing Splitter to control how aggressively silence is removed.
| Mode | Description |
|---|---|
0 |
Least aggressive (retains more background noise). |
1 |
Light filtering. |
2 |
Moderate filtering. |
3 |
Most aggressive (removes nearly everything that is not speech). |
Example:
import webrtcvad
from audio_splitter_vad.splitter import Splitter
# Less aggressive filtering
custom_vad = webrtcvad.Vad(1)
splitter = Splitter(vad_engine=custom_vad)
Metadata
Release files for audio-splitter-vad 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| audio_splitter_vad-0.1.2.tar.gz | 7.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| audio_splitter_vad-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.9 kB
Release files / audio_splitter_vad-0.1.2.tar.gz
| Download URL | audio_splitter_vad-0.1.2.tar.gz |
|---|---|
| Size | 7.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
624e3a9e3bb4eb632f726f36578a1cb895dd3e90958a08f0ef2009a6918dfb9a
|
|
BLAKE2b-256 checksum How to use checksums |
dd4b92c9635cf32dde10152660890a770b3981745d95a4233506ff61f60ed69f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / audio_splitter_vad-0.1.2-py3-none-any.whl
| Download URL | audio_splitter_vad-0.1.2-py3-none-any.whl |
|---|---|
| Size | 9.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
88473787c32ed42f0db3e1d588081f923618aaa7240aecabf469da2db384a445
|
|
BLAKE2b-256 checksum How to use checksums |
f6c35e4a181b3b93e72b50a1c44174a0d3db93c74a78cd879109f5d6318661e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for audio-splitter-vad 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.