Suparnpreet commited on
Commit
ecc6d87
·
verified ·
1 Parent(s): 8b73986

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +32 -33
app.py CHANGED
@@ -1,39 +1,38 @@
1
- # import ytdownloader
2
- # import trans
3
- # import transcribe
4
- # import texttospeech
5
  import audioex
6
- audioex.ex()
7
- # from time import sleep
8
- # import edit
9
- # import subprocess
10
- # try:
11
- # subprocess.run("pip uninstall whisper", shell=True)
12
- # subprocess.run("pip install -U openai-whisper", shell=True)
13
- # except:
14
- # pass
15
  import streamlit
16
  streamlit.title("Video Dubber")
17
- # lang = ['en', 'es', 'fr', 'de', 'it', 'pt', 'pl', 'tr', 'ru', 'nl', 'cs', 'ar', 'zh-cn', 'hu', 'ko', 'ja', 'hi']
18
- # def main():
19
- # link = streamlit.text_input("Please enter Youtube video link = ")
20
- # selected_language = streamlit.selectbox("Select a language:", lang)
21
- # if streamlit.button("Submit"):
22
- # ytdownloader.download_youtube_video(link, "video")
23
- # sleep(5)
24
- # audioex.ex()
25
- # sleep(5)
26
- # video_text = transcribe.transcibe("speech.wav")
27
- # sleep(5)
28
- # trans_text = trans.mixtral(video_text)
29
- # streamlit.text(trans_text)
30
- # sleep(5)
31
- # texttospeech.speak(trans_text, selected_language)
32
- # sleep(5)
33
- # edit.mute_and_add_audio("video.mp4", "output.wav", "output_video.mp4")
34
- # sleep(5)
35
- # streamlit.video("output_video.mp4")
36
 
37
 
38
 
39
- # 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 subprocess
9
+ try:
10
+ subprocess.run("pip uninstall whisper", shell=True)
11
+ subprocess.run("pip install -U openai-whisper", shell=True)
12
+ except:
13
+ pass
 
14
  import streamlit
15
  streamlit.title("Video Dubber")
16
+ lang = ['en', 'es', 'fr', 'de', 'it', 'pt', 'pl', 'tr', 'ru', 'nl', 'cs', 'ar', 'zh-cn', 'hu', 'ko', 'ja', 'hi']
17
+ def main():
18
+ link = streamlit.text_input("Please enter Youtube video link = ")
19
+ selected_language = streamlit.selectbox("Select a language:", lang)
20
+ if streamlit.button("Submit"):
21
+ ytdownloader.download_youtube_video(link, "video")
22
+ sleep(5)
23
+ audioex.ex()
24
+ sleep(5)
25
+ video_text = transcribe.transcibe("speech.wav")
26
+ sleep(5)
27
+ trans_text = trans.mixtral(video_text)
28
+ streamlit.text(trans_text)
29
+ sleep(5)
30
+ texttospeech.speak(trans_text, selected_language)
31
+ sleep(5)
32
+ edit.mute_and_add_audio("video.mp4", "output.wav", "output_video.mp4")
33
+ sleep(5)
34
+ streamlit.video("output_video.mp4")
35
 
36
 
37
 
38
+ main()