Audio File Splitter
audio_splitter/main.py is a command-line tool for splitting audio files into equally-sized chunks or based on silence. This Python script uses the pydub library for handling various audio formats.
Why does this exist?
As someone who enjoys to listen to spoken word every night, I often listen to podcasts on my old MP3 player before going to sleep. However, I found myself growing bored of listening to the same first 5 minutes of each episode every night. To mix things up and always have something new to listen to, I created this script to break down podcast episodes into smaller chunks. Now I can jump around different parts of the episodes and enjoy a fresh listening experience each time.
Usage
To use the script, follow these steps:
python audio_splitter/main.py input_file output_dir [--chunk_length CHUNK_LENGTH] [--output_format OUTPUT_FORMAT] [--silence_based]
Replace input_file with the path to your audio file and output_dir with the path to the output directory where you want to save the chunks.
Options
--chunk_length CHUNK_LENGTH: Length of each chunk in milliseconds (default: 300000 ms, or 5 minutes). Ignored if --silence_based is set.
--output_format OUTPUT_FORMAT: Output format for the audio chunks (default: wav). Supported formats include wav, mp3, and ogg.
--silence_based: Split the audio based on silence instead of fixed-size chunks. If set, --chunk_length is ignored and the script ensures that the generated chunks are at least the specified length.
Examples
Split an audio file into 5-minute (default) chunks:
python audio_splitter/main.py input_file.mp3 output_dir
Split an audio file into 10-minute chunks and save them in the MP3 format:
python audio_splitter/main.py input_file.mp3 output_dir --chunk_length 600000 --output_format mp3
Split an audio file based on silence, ensuring that the chunks are at least 5 minutes long:
python audio_splitter/main.py input_file.mp3 output_dir --silence_based
Split an audio file based on silence, ensuring that the chunks are at least 10 minutes long:
python audio_splitter/main.py input_file.mp3 output_dir --chunk_length 600000 --silence_based
Metadata
Release files for audio-splitter 0.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 |
|---|---|---|---|---|
| audio-splitter-0.1.0.tar.gz | 3.7 kB | Without provenance | Details for audio-splitter-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| audio_splitter-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for audio_splitter-0.1.0-py3-none-any.whl |
Total release size: 7.9 kB
Release files / audio-splitter-0.1.0.tar.gz
| Download URL | audio-splitter-0.1.0.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9f932683147b91b23490d1b22acac1e4bf913c0dd7c2c268fb52ce9b505abf16
|
|
BLAKE2b-256 checksum How to use checksums |
30f6fdf7178c7f06e46f021bd1772c242fabe0ee0c9e6e265fc37d9e5d6402bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.2
|
Release files / audio_splitter-0.1.0-py3-none-any.whl
| Download URL | audio_splitter-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9c29f59d59ac1916ac079f42aa4e265f326f206fa387dd864101d3d669ad7a34
|
|
BLAKE2b-256 checksum How to use checksums |
4ee0cc77d8235fa1ca5bbbf43d5ca68da32d3691a23a347949f32c9d4f637b15
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.2
|
Security for audio-splitter 0.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.