Update functions.py
Browse files- functions.py +2 -2
functions.py
CHANGED
@@ -236,7 +236,7 @@ def inference(link, upload, _asr_model):
|
|
236 |
audio_file = yt.streams.filter(only_audio=True)[0].download(filename="audio.mp4")
|
237 |
|
238 |
#Get size of audio file
|
239 |
-
audio_size = round(os.path.getsize(
|
240 |
|
241 |
#Check if file is > 24mb, if not then use Whisper API
|
242 |
if audio_size <= 25:
|
@@ -249,7 +249,7 @@ def inference(link, upload, _asr_model):
|
|
249 |
|
250 |
st.write('File size larger than 24mb, applying chunking and transcription')
|
251 |
|
252 |
-
song = AudioSegment.from_file(
|
253 |
|
254 |
# PyDub handles time in milliseconds
|
255 |
twenty_minutes = 20 * 60 * 1000
|
|
|
236 |
audio_file = yt.streams.filter(only_audio=True)[0].download(filename="audio.mp4")
|
237 |
|
238 |
#Get size of audio file
|
239 |
+
audio_size = round(os.path.getsize(audio_file)/(1024*1024),1)
|
240 |
|
241 |
#Check if file is > 24mb, if not then use Whisper API
|
242 |
if audio_size <= 25:
|
|
|
249 |
|
250 |
st.write('File size larger than 24mb, applying chunking and transcription')
|
251 |
|
252 |
+
song = AudioSegment.from_file(audio_file, format='mp4')
|
253 |
|
254 |
# PyDub handles time in milliseconds
|
255 |
twenty_minutes = 20 * 60 * 1000
|