Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -36,8 +36,8 @@ def transcribe_audio(chunk):
|
|
36 |
|
37 |
def add_subtitle(video):
|
38 |
try:
|
39 |
-
#
|
40 |
-
video_path = video
|
41 |
if not video_path:
|
42 |
return "No video provided!"
|
43 |
|
@@ -59,6 +59,7 @@ def add_subtitle(video):
|
|
59 |
|
60 |
full_transcription = " ".join(transcriptions)
|
61 |
subtitle_storage["original"] = full_transcription # Store the original subtitle
|
|
|
62 |
|
63 |
return f"Subtitle added: {full_transcription[:100]}..." # Display first 100 characters
|
64 |
|
|
|
36 |
|
37 |
def add_subtitle(video):
|
38 |
try:
|
39 |
+
# The video is passed as a file path string, so we use it directly
|
40 |
+
video_path = video if isinstance(video, str) else None
|
41 |
if not video_path:
|
42 |
return "No video provided!"
|
43 |
|
|
|
59 |
|
60 |
full_transcription = " ".join(transcriptions)
|
61 |
subtitle_storage["original"] = full_transcription # Store the original subtitle
|
62 |
+
subtitle_storage["video_path"] = video_path # Store the video path
|
63 |
|
64 |
return f"Subtitle added: {full_transcription[:100]}..." # Display first 100 characters
|
65 |
|