Update app.py
Browse files
app.py
CHANGED
|
@@ -19,6 +19,7 @@ async def generate_tts(text, voice, proxy):
|
|
| 19 |
|
| 20 |
proxy_url = proxy if proxy and proxy.strip() != "" else None
|
| 21 |
|
|
|
|
| 22 |
communicate = edge_tts.Communicate(text, voice, proxy=proxy_url)
|
| 23 |
await communicate.save(temp_file.name)
|
| 24 |
return temp_file.name, "အောင်မြင်ပါသည်။"
|
|
@@ -34,7 +35,11 @@ with gr.Blocks() as app:
|
|
| 34 |
with gr.Column():
|
| 35 |
text_input = gr.Textbox(label="စာသားထည့်ပါ", lines=5)
|
| 36 |
voice_dropdown = gr.Dropdown(choices=VOICES, value="my-MM-NilarNeural", label="အသံရွေးချယ်ပါ")
|
| 37 |
-
proxy_input = gr.Textbox(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
submit_btn = gr.Button("အသံဖန်တီးမည်", variant="primary")
|
| 39 |
with gr.Column():
|
| 40 |
audio_output = gr.Audio(label="ထွက်ပေါ်လာသောအသံ", type="filepath")
|
|
|
|
| 19 |
|
| 20 |
proxy_url = proxy if proxy and proxy.strip() != "" else None
|
| 21 |
|
| 22 |
+
# Proxy မှာ Username/Password ပါလာရင် aiohttp/edge-tts က ဒီအတိုင်း လက်ခံနိုင်ပါတယ်
|
| 23 |
communicate = edge_tts.Communicate(text, voice, proxy=proxy_url)
|
| 24 |
await communicate.save(temp_file.name)
|
| 25 |
return temp_file.name, "အောင်မြင်ပါသည်။"
|
|
|
|
| 35 |
with gr.Column():
|
| 36 |
text_input = gr.Textbox(label="စာသားထည့်ပါ", lines=5)
|
| 37 |
voice_dropdown = gr.Dropdown(choices=VOICES, value="my-MM-NilarNeural", label="အသံရွေးချယ်ပါ")
|
| 38 |
+
proxy_input = gr.Textbox(
|
| 39 |
+
label="Proxy URL (Optional)",
|
| 40 |
+
value="http://mhuekxym:29u66euxw5ww@p.webshare.io:80",
|
| 41 |
+
placeholder="http://user:pass@ip:port"
|
| 42 |
+
)
|
| 43 |
submit_btn = gr.Button("အသံဖန်တီးမည်", variant="primary")
|
| 44 |
with gr.Column():
|
| 45 |
audio_output = gr.Audio(label="ထွက်ပေါ်လာသောအသံ", type="filepath")
|