import gradio as gr def process_dubbing(video_file, voice_choice, speed_multiplier): if video_file is None: return "ကျေးဇူးပြု၍ ဗီဒီယိုဖိုင် အရင်ထည့်ပါ။" selected_voice = "သီဟ (ယောကျ်ားလေးအသံ)" if "သီဟ" in voice_choice else "နီလာ (မိန်းကလေးအသံ)" return f"ဗီဒီယို လက်ခံရရှိပါပြီ။ အသံအမျိုးအစား: {selected_voice} | အမြန်နှုန်း: {speed_multiplier}x ဖြင့် အမြန်ဆုံး စင့်ခ်လုပ်နေပါပြီ..." with gr.Blocks() as demo: gr.Markdown("# ဗီဒီယို အမြန်နှုန်းနှင့် အသံကိုက်ညီစေမည့် (Dubbing & Fast Sync) ကိရိယာ") with gr.Row(): video_input = gr.Video(label="ဗီဒီယိုဖိုင် တင်ရန်") with gr.Row(): voice_choice = gr.Dropdown( choices=["သီဟ (ယောကျ်ားလေးအသံ)", "နီလာ (မိန်းကလေးအသံ)"], value="သီဟ (ယောကျ်ားလေးအသံ)", label="အသံအမျိုးအစား ရွေးချယ်ပါ" ) speed_multiplier = gr.Slider( minimum=1.0, maximum=3.0, value=1.5, step=0.25, label="ဗီဒီယိုအမြန်နှုန်း (Speed Boost)" ) submit_btn = gr.Button("အမြန်ဆုံး Dubbing စတင်ရန်", variant="primary") output_text = gr.Textbox(label="လုပ်ဆောင်ချက် အခြေအနေ") submit_btn.click( fn=process_dubbing, inputs=[video_input, voice_choice, speed_multiplier], outputs=output_text ) if __name__ == "__main__": demo.launch()