Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -36,8 +36,6 @@ def youtube_video_downloader(url):
|
|
36 |
|
37 |
|
38 |
def audio_extraction(video_file):
|
39 |
-
# video_file_bytes = os.fsencode(video_file)
|
40 |
-
# audio = extract_audio(input_path=video_file_bytes, output_path=f"{video_file}.mp3")
|
41 |
audio = AudioSegment.from_file(video_file, format="mp4")
|
42 |
audio_path = 'audio.wav'
|
43 |
audio.export(audio_path, format="wav")
|
@@ -84,7 +82,8 @@ with youtube_url_tab:
|
|
84 |
if url:
|
85 |
if st.button("Transcribe", key="yturl"):
|
86 |
with st.spinner("Transcribing..."):
|
87 |
-
|
|
|
88 |
ytvideo_transcript = transcriber_pass(audio)
|
89 |
st.success(f"Transcription successful")
|
90 |
st.write(f'Video title: {title}')
|
@@ -109,12 +108,13 @@ with file_select_tab:
|
|
109 |
|
110 |
if st.button("Transcribe", key="vidfile"):
|
111 |
with st.spinner("Transcribing..."):
|
112 |
-
with st.spinner('Extracting audio...')
|
113 |
audio = audio_extraction(uploaded_video_file)
|
114 |
|
115 |
video_transcript = transcriber_pass(audio)
|
116 |
st.success(f"Transcription successful")
|
117 |
-
st.write
|
|
|
118 |
|
119 |
if st.button("Generate Summary", key="ti2"):
|
120 |
summary = generate_ai_summary(video_transcript)
|
|
|
36 |
|
37 |
|
38 |
def audio_extraction(video_file):
|
|
|
|
|
39 |
audio = AudioSegment.from_file(video_file, format="mp4")
|
40 |
audio_path = 'audio.wav'
|
41 |
audio.export(audio_path, format="wav")
|
|
|
82 |
if url:
|
83 |
if st.button("Transcribe", key="yturl"):
|
84 |
with st.spinner("Transcribing..."):
|
85 |
+
with st.spinner('Extracting audio...'):
|
86 |
+
audio = audio_extraction(yt_video)
|
87 |
ytvideo_transcript = transcriber_pass(audio)
|
88 |
st.success(f"Transcription successful")
|
89 |
st.write(f'Video title: {title}')
|
|
|
108 |
|
109 |
if st.button("Transcribe", key="vidfile"):
|
110 |
with st.spinner("Transcribing..."):
|
111 |
+
with st.spinner('Extracting audio...'):
|
112 |
audio = audio_extraction(uploaded_video_file)
|
113 |
|
114 |
video_transcript = transcriber_pass(audio)
|
115 |
st.success(f"Transcription successful")
|
116 |
+
st.write
|
117 |
+
(video_transcript)
|
118 |
|
119 |
if st.button("Generate Summary", key="ti2"):
|
120 |
summary = generate_ai_summary(video_transcript)
|