Update app.py
Browse files
app.py
CHANGED
|
@@ -187,7 +187,17 @@ def process_video(video_path, seconds_per_frame=2):
|
|
| 187 |
print(f"Extracted audio to {audio_path}")
|
| 188 |
|
| 189 |
return base64Frames, audio_path
|
| 190 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 191 |
def process_audio_and_video(video_input):
|
| 192 |
if video_input is not None:
|
| 193 |
# Save the uploaded video file
|
|
|
|
| 187 |
print(f"Extracted audio to {audio_path}")
|
| 188 |
|
| 189 |
return base64Frames, audio_path
|
| 190 |
+
|
| 191 |
+
def save_and_play_audio(audio_recorder):
|
| 192 |
+
audio_bytes = audio_recorder(key='audio_recorder')
|
| 193 |
+
if audio_bytes:
|
| 194 |
+
filename = generate_filename("Recording", "wav")
|
| 195 |
+
with open(filename, 'wb') as f:
|
| 196 |
+
f.write(audio_bytes)
|
| 197 |
+
st.audio(audio_bytes, format="audio/wav")
|
| 198 |
+
return filename
|
| 199 |
+
return None
|
| 200 |
+
|
| 201 |
def process_audio_and_video(video_input):
|
| 202 |
if video_input is not None:
|
| 203 |
# Save the uploaded video file
|