Spaces:
Runtime error
Runtime error
Suparnpreet
commited on
Commit
•
8815104
1
Parent(s):
95dd4c2
Update app.py
Browse files
app.py
CHANGED
@@ -1,31 +1,32 @@
|
|
1 |
-
import ytdownloader
|
2 |
-
import trans
|
3 |
-
import transcribe
|
4 |
-
import texttospeech
|
5 |
-
import audioex
|
6 |
-
from time import sleep
|
7 |
-
import edit
|
8 |
-
import streamlit
|
9 |
-
streamlit.title("Video Dubber")
|
10 |
-
|
11 |
-
def main():
|
12 |
-
link = streamlit.text_input("Please enter Youtube video link = ")
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
|
|
|
1 |
+
import ytdownloader
|
2 |
+
import trans
|
3 |
+
import transcribe
|
4 |
+
import texttospeech
|
5 |
+
import audioex
|
6 |
+
from time import sleep
|
7 |
+
import edit
|
8 |
+
import streamlit
|
9 |
+
streamlit.title("Video Dubber")
|
10 |
+
lang = ['en', 'es', 'fr', 'de', 'it', 'pt', 'pl', 'tr', 'ru', 'nl', 'cs', 'ar', 'zh-cn', 'hu', 'ko', 'ja', 'hi']
|
11 |
+
def main():
|
12 |
+
link = streamlit.text_input("Please enter Youtube video link = ")
|
13 |
+
selected_language = streamlit.selectbox("Select a language:", lang)
|
14 |
+
if streamlit.button("Submit"):
|
15 |
+
ytdownloader.download_youtube_video(link, "video")
|
16 |
+
sleep(5)
|
17 |
+
audioex.ex()
|
18 |
+
sleep(5)
|
19 |
+
video_text = transcribe.transcibe("speech.wav")
|
20 |
+
sleep(5)
|
21 |
+
trans_text = trans.mixtral(video_text)
|
22 |
+
streamlit.text(trans_text)
|
23 |
+
sleep(5)
|
24 |
+
texttospeech.speak(trans_text, selected_language)
|
25 |
+
sleep(5)
|
26 |
+
edit.mute_and_add_audio("video.mp4", "output.wav", "output_video.mp4")
|
27 |
+
sleep(5)
|
28 |
+
streamlit.video("output_video.mp4")
|
29 |
+
|
30 |
+
|
31 |
+
|
32 |
+
main()
|