File size: 1,208 Bytes
7055298
c750dd1
 
 
 
 
 
 
7055298
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c750dd1
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import gradio as gr
from Audio_into_chunks import audio_into_chunks_transcribe_translate
from Clear_voice import Clear_voice
from Download_Audio import Downlaod_Audio
from Download_Video import download_video
from Merged_Chunks import Merged_chunks
from Text_to_speech import Text_to_Speech
from Video_dube import Video_dub

# @title Main Function
def main_fun(video_url,language):
  lang="eu"
  if(language=="English"):
    lang="eu"
  elif language=="Urdu":
    lang="ur"
  elif language=="Arabic":
    lang="ar"
  elif language=="Hindi":
    lang="hi"
  downlaod_video_path=download_video(video_url)
  downlaod_audio_file_path=Downlaod_Audio(downlaod_video_path)
  chunks_translate_data=audio_into_chunks_transcribe_translate(downlaod_audio_file_path,lang)
  voice=Clear_voice()
  output_voice_list=Text_to_Speech(chunks_translate_data,lang,voice)
  merge_voice=Merged_chunks(output_voice_list)
  result=Video_dub(downlaod_video_path,merge_voice)
  return result

interface=gr.Interface(fn=main_fun,inputs=[gr.components.Textbox(label="Enter YouTube Video URL"),gr.components.Radio(['English','Urdu','Arabic','Hindi'],type="value")],
                       outputs="video")
interface.launch(debug=True)