Suparnpreet commited on
Commit
8815104
1 Parent(s): 95dd4c2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +32 -31
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
- if streamlit.button("Submit"):
14
- ytdownloader.download_youtube_video(link, "video")
15
- sleep(5)
16
- audioex.ex()
17
- sleep(5)
18
- video_text = transcribe.transcibe("speech.wav")
19
- sleep(5)
20
- trans_text = trans.mixtral(video_text)
21
- streamlit.text(trans_text)
22
- sleep(5)
23
- texttospeech.speak(trans_text)
24
- sleep(5)
25
- edit.mute_and_add_audio("video.mp4", "output.wav", "output_video.mp4")
26
- sleep(5)
27
- streamlit.video("output_video.mp4")
28
-
29
-
30
-
31
- main()
 
 
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()