def split_on_silence(audio_segment, min_silence_len=1000, silence_thresh=-16, keep_silence=100):

    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
audio_segment - original pydub.AudioSegment() object
dataset/ETHPy150Open jiaaro/pydub/pydub/silence.py/split_on_silence