Skip to content

aiczk/sound-helper

Repository files navigation

Split Audio Files by Silence

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.

Dependencies

CUI and GUI

  1. At first, install ffmpeg from the official website.
  2. Register the ffmpeg bin directory in the environment variable.
  3. Install what you need using pip:
pip install -r requirements.txt

Usage

Parameters

Non-required arguments are set to 0.

File Setting

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

Sound Setting

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

Output Setting

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

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"

Thanks

I was inspired to create this site.