diff --git a/app.py b/app.py index d87c7fb..946dd2d 100644 --- a/app.py +++ b/app.py @@ -1,5 +1,5 @@ import speech_recognition as sr -import os +import os from pydub import AudioSegment from pydub.silence import split_on_silence @@ -21,13 +21,13 @@ def large_audio(path, minutes=5): """Splitting the large audio file into fixed interval chunks and apply speech recognition on each of these chunks""" print("Loading file") - sound = AudioSegment.from_file(path) + sound = AudioSegment.from_file(path) print(len(sound)) print("Splitting file") chunk_length_ms = int(1000 * 60 * minutes) # convert to milliseconds chunks = [sound[i:i + chunk_length_ms] for i in range(0, len(sound), chunk_length_ms)] folder_name = "audio-fixed-chunks" - + if not os.path.isdir(folder_name): os.mkdir(folder_name) whole_text = ""