Update functions.py
Browse files- functions.py +3 -3
functions.py
CHANGED
@@ -223,7 +223,7 @@ def transcribe_yt_video(link, py_tube=True):
|
|
223 |
|
224 |
st.warning('File size larger than 24mb, applying chunking and transcription',icon="⚠️")
|
225 |
|
226 |
-
song = AudioSegment.from_file(st.session_state['audio'], format='
|
227 |
|
228 |
# PyDub handles time in milliseconds
|
229 |
twenty_minutes = 20 * 60 * 1000
|
@@ -235,8 +235,8 @@ def transcribe_yt_video(link, py_tube=True):
|
|
235 |
video_id = extract.video_id(link)
|
236 |
|
237 |
for i, chunk in enumerate(chunks):
|
238 |
-
chunk.export(f'output/chunk_{i}_{video_id}.
|
239 |
-
transcriptions.append(load_whisper_api(f'output/chunk_{i}_{video_id}.
|
240 |
|
241 |
results = ','.join(transcriptions)
|
242 |
|
|
|
223 |
|
224 |
st.warning('File size larger than 24mb, applying chunking and transcription',icon="⚠️")
|
225 |
|
226 |
+
song = AudioSegment.from_file(st.session_state['audio'], format='mp3')
|
227 |
|
228 |
# PyDub handles time in milliseconds
|
229 |
twenty_minutes = 20 * 60 * 1000
|
|
|
235 |
video_id = extract.video_id(link)
|
236 |
|
237 |
for i, chunk in enumerate(chunks):
|
238 |
+
chunk.export(f'output/chunk_{i}_{video_id}.mp3', format='mp3')
|
239 |
+
transcriptions.append(load_whisper_api(f'output/chunk_{i}_{video_id}.mp3')['text'])
|
240 |
|
241 |
results = ','.join(transcriptions)
|
242 |
|