This script splits audio files based on the length of silence detected in them.
Audio files are split into chunks wherever there is silence for a period longer than the specified minimum silence length.
The bat file is optimized for DDSP-SVC. Rewrite it as necessary.
- At first, install ffmpeg from the official website.
- Register the ffmpeg bin directory in the environment variable.
- Install what you need using pip:
pip install -r requirements.txt
Non-required arguments are set to 0.
| Argument | Description | Default |
|---|---|---|
| --input | Input directory path | .\input |
| --output | Output directory path | .\output |
| --filename | Output file name | audio |
| --iformat | Input file format (wav, mp3, etc.) | wav |
| --oformat | Output file format (wav, mp3, etc.) | wav |
When LPF(lowpass) and HPF(highpass) are used together, they function as BPF(bandpass) and BSF(bandstop).
| Argument | Description | Default |
|---|---|---|
| --silence | Minimum silence length (ms) | 500 |
| --threshold | Silence threshold (dBFS) | -40 |
| --samplerate | Sample rate (Hz) | 0 |
| --invert | Invert phase audio(0: false, 1: true) | 0 |
| --loudness | Loudness normalization(dBFS) | 0.0 |
| --channel | Number of audio channels(0: pass, 1: mono, 2: stereo) | 0 |
| --lowpass | Low pass filter(Hz) | 0 |
| --highpass | High pass filter(Hz) | 0 |
| --reverse | Reverse audio(0: false, 1: true) | 0 |
| Argument | Description | Default |
|---|---|---|
| --combine | Combine all output files(0: false, 1: true) | 0 |
| --skip | Ignore files with less than the specified seconds (ms) | 0 |
| --merge | Merge files under a certain number of seconds(ms) | 0 |
| --split | Split files longer than a specified number of seconds(ms) | 0 |
| --prefix | Prefix of output file name | None |
example:
python sound.py --filename "inv_rev" --skip 2 --samplerate 44100 --invert 1 --reverse 1 --loudness -14 --pack 1 --highpass 80 --prefix --merge 5000 --split 10000 "rev_inv_hps"I was inspired to create this site.