Commit b667e038 authored by IT18126884's avatar IT18126884

Update Silence.py

parent ed529e08
......@@ -4,7 +4,7 @@ from pydub import AudioSegment
from pydub.silence import split_on_silence
sound = AudioSegment.from_wav("C:/Users/Janitha Akalanka/PycharmProjects/English.wav")
chunks = split_on_silence(sound, min_silence_len=50, silence_thresh=sound.dBFS - 16, keep_silence=150)
chunks = split_on_silence(sound, min_silence_len=200, silence_thresh=sound.dBFS - 16, keep_silence=150)
chunk_folder_name = "C:/Users/Janitha Akalanka/PycharmProjects/splits_by_pauses"
......@@ -16,4 +16,4 @@ for i, audio_chunk in enumerate(chunks, start=1):
chunk_file = os.path.join(chunk_folder_name, f"chunk{i}.wav")
audio_chunk.export(chunk_file, format="wav", bitrate='192k')
print(str(len(chunks) - 1) + " : Pause/s found")
\ No newline at end of file
print(str(len(chunks) - 1) + " : Silence/s found")
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment