

def split_on_silence(audio_segment, min_silence_len=1000, silence_thresh=(- 16), keep_silence=100):
    '\n    audio_segment - original pydub.AudioSegment() object\n\n    min_silence_len - (in ms) minimum length of a silence to be used for\n        a split. default: 1000ms\n\n    silence_thresh - (in dBFS) anything quieter than this will be\n        considered silence. default: -16dBFS\n\n    keep_silence - (in ms) amount of silence to leave at the beginning\n        and end of the chunks. Keeps the sound from sounding like it is\n        abruptly cut off. (default: 100ms)\n    '
    not_silence_ranges = detect_nonsilent(audio_segment, min_silence_len, silence_thresh)
    chunks = []
    for (start_i, end_i) in not_silence_ranges:
        start_i = max(0, (start_i - keep_silence))
        end_i += keep_silence
        chunks.append(audio_segment[start_i:end_i])
    return chunks

dataset/ETHPy150Open jiaaro/pydub/pydub/silence.py split_on_silence/original