anthienlong commited on
Commit
e9495dd
·
verified ·
1 Parent(s): 6ee4b23

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -12,9 +12,9 @@ async def get_voices():
12
  # Text-to-speech function
13
  async def text_to_speech(text, voice, rate, pitch):
14
  if not text.strip():
15
- return None, gr.Warning("Please enter text to convert.")
16
  if not voice:
17
- return None, gr.Warning("Please select a voice.")
18
 
19
  voice_short_name = voice.split(" - ")[0]
20
  rate_str = f"{rate:+d}%"
@@ -44,18 +44,18 @@ async def create_demo():
44
  demo = gr.Interface(
45
  fn=tts_interface,
46
  inputs=[
47
- gr.Textbox(label="Input Text", lines=5),
48
- gr.Dropdown(choices=[""] + list(voices.keys()), label="Select Voice", value=""),
49
  gr.Slider(minimum=-50, maximum=50, value=0, label="Speech Rate Adjustment (%)", step=1),
50
  gr.Slider(minimum=-20, maximum=20, value=0, label="Pitch Adjustment (Hz)", step=1)
51
  ],
52
  outputs=[
53
- gr.Audio(label="Generated Audio", type="filepath"),
54
  gr.Markdown(label="Warning", visible=False)
55
  ],
56
- title="Edge TTS Text-to-Speech",
57
  description=description,
58
- article="Experience the power of Edge TTS for text-to-speech conversion, and explore our advanced Text-to-Video Converter for even more creative possibilities!",
59
  analytics_enabled=False,
60
  allow_flagging=False
61
  )
 
12
  # Text-to-speech function
13
  async def text_to_speech(text, voice, rate, pitch):
14
  if not text.strip():
15
+ return None, gr.Warning("Nhập dzăn bản cần chuyển thành voice.")
16
  if not voice:
17
+ return None, gr.Warning("Chọn dzọng nói.")
18
 
19
  voice_short_name = voice.split(" - ")[0]
20
  rate_str = f"{rate:+d}%"
 
44
  demo = gr.Interface(
45
  fn=tts_interface,
46
  inputs=[
47
+ gr.Textbox(label="Nhập dzăn bản", lines=5),
48
+ gr.Dropdown(choices=[""] + list(voices.keys()), label="Chọn dzọng nói", value=""),
49
  gr.Slider(minimum=-50, maximum=50, value=0, label="Speech Rate Adjustment (%)", step=1),
50
  gr.Slider(minimum=-20, maximum=20, value=0, label="Pitch Adjustment (Hz)", step=1)
51
  ],
52
  outputs=[
53
+ gr.Audio(label="File voice nè", type="filepath"),
54
  gr.Markdown(label="Warning", visible=False)
55
  ],
56
+ title="KevinK: Công cụ Chuyển dzăn bản thành file audio nha.",
57
  description=description,
58
+ article="Đại khái công cụ này dùng chức năng text to speech trong trình duyệt MS Edge",
59
  analytics_enabled=False,
60
  allow_flagging=False
61
  )