Spaces:
Sleeping
Sleeping
RobCaamano
commited on
Commit
•
e193799
1
Parent(s):
8ea135a
Update main.py
Browse files
main.py
CHANGED
@@ -15,6 +15,10 @@ def get_audio_filename(video_path):
|
|
15 |
base_name = os.path.splitext(os.path.basename(video_path))[0]
|
16 |
return f'./audio/{base_name}.wav'
|
17 |
|
|
|
|
|
|
|
|
|
18 |
def main(youtube_url):
|
19 |
# Ensure necessary directories exist
|
20 |
if not os.path.exists('./downloads'):
|
@@ -51,7 +55,8 @@ def main(youtube_url):
|
|
51 |
tts_main(speaker_directory, aligned_text_file, output_audio_file)
|
52 |
|
53 |
# Step 6: Create the final translated video
|
54 |
-
|
|
|
55 |
|
56 |
print(f"Final translated video created at {final_video_path}")
|
57 |
|
|
|
15 |
base_name = os.path.splitext(os.path.basename(video_path))[0]
|
16 |
return f'./audio/{base_name}.wav'
|
17 |
|
18 |
+
def get_video_name(video_path):
|
19 |
+
base_name = os.path.splitext(os.path.basename(video_path))[0]
|
20 |
+
return base_name
|
21 |
+
|
22 |
def main(youtube_url):
|
23 |
# Ensure necessary directories exist
|
24 |
if not os.path.exists('./downloads'):
|
|
|
55 |
tts_main(speaker_directory, aligned_text_file, output_audio_file)
|
56 |
|
57 |
# Step 6: Create the final translated video
|
58 |
+
video_name = get_video_name(downloaded_video_path)
|
59 |
+
final_video_path = create_translated_video(downloaded_video_path, output_audio_file, translated_text_path, video_name)
|
60 |
|
61 |
print(f"Final translated video created at {final_video_path}")
|
62 |
|