vadslice
Slices audio clips of speech into chunks of certain length in seconds at silence points so it doesn't cut in the middle of someone speaking. It uses VAD (voice activity detection from silero-vad) to determine these points of silence within the clip.
Uses ONNX runtime instead of PyTorch, avoiding the heavy PyTorch dependency while maintaining the same VAD accuracy.
It's extremely fast.
Installation
Requires Python 3.12+.
uv add vadslice
or pip:
pip install vadslice
Usage
CLI
vadslice <size> <input_file> <output_dir> [--format wav|mp3|ogg|m4a] [--silence-flush SECONDS]
Example:
vadslice 30 audio.mp3 ./chunks --format mp3
# Flush a chunk early if there's a 5+ second silence gap
vadslice 30 audio.mp3 ./chunks --silence-flush 5
Chunks are saved to output_dir/input_file_stem/chunk_XXXX_offset_XX.XXs.ext. --format is the output format.
Input: Supports any audio format that PyAV can decode (MP3, WAV, OGG, M4A, FLAC, etc.)
Python API
from vadslice import slicer
parts = slicer("audio.mp3", slice_length_s=30.0)
# Optionally flush chunks on long silence gaps
parts = slicer("audio.mp3", slice_length_s=30.0, silence_flush_s=5.0)
for i, part in enumerate(parts):
print(f"Part {i}: Offset: {part.offset_s}s, Size: {len(part.part)} bytes")
The function slicer returns a list of AudioPart objects, each containing:
part: WAV bytes (16 kHz mono) for that sliceoffset_s: Start time offset in seconds from the original audio
.
Metadata
Release files for vadslice 1.1.0
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 | Actions |
|---|---|---|---|---|
| vadslice-1.1.0.tar.gz | 2.0 MB | Without provenance | Details for vadslice-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| vadslice-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for vadslice-1.1.0-py3-none-any.whl |
Total release size: 3.9 MB
Release files / vadslice-1.1.0.tar.gz
| Download URL | vadslice-1.1.0.tar.gz |
|---|---|
| Size | 2.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
92e5f5ca7cceec27b141a358c0210da5df903bff3abe8c8f381e72d1339ab9f1
|
|
BLAKE2b-256 checksum How to use checksums |
cf34715983a8bd17358390de7f0af092a15bf951e0cfee293ffba3c4dee735c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / vadslice-1.1.0-py3-none-any.whl
| Download URL | vadslice-1.1.0-py3-none-any.whl |
|---|---|
| Size | 2.0 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
82439643cb4724ac24f5ef7e6ba13629b5b576469177550658180ebb0b510bb7
|
|
BLAKE2b-256 checksum How to use checksums |
3096f8e7fe9bdabf0a37d4c06fdca8ad547ae08b395ff64ccb23257a245b203e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for vadslice 1.1.0
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.