firzaelbuho commited on
Commit
74fba50
1 Parent(s): f3e787d

Update app2.py

Browse files
Files changed (1) hide show
  1. app2.py +3 -3
app2.py CHANGED
@@ -98,9 +98,9 @@ def create_vc_fn(model_name, tgt_sr, net_g, vc, if_f0, version, file_index):
98
  return "You need to enter text and select a voice", None
99
  inc_rate = "+0%"
100
  if tts_rate < 0 :
101
- inc_rate = (f"{100 - tts_rate}%")
102
  else:
103
- inc_rate = (f"+{tts_rate - s100}%")
104
 
105
  asyncio.run(edge_tts.Communicate(text=tts_text, voice= "-".join(tts_voice.split('-')[:-1]), rate= inc_rate).save("tts.mp3"))
106
  audio, sr = librosa.load("tts.mp3", sr=16000, mono=True)
@@ -641,7 +641,7 @@ if __name__ == '__main__':
641
  # TTS
642
  tts_text = gr.Textbox(label="TTS text", value="hello world", info="Text to speech input", visible=False)
643
  tts_voice = gr.Dropdown(label="Edge-tts speaker", choices=voices, visible=False, allow_custom_value=False, value="en-US-AnaNeural-Female")
644
- tts_rate = gr.Number(label="TTS Rate", value = 0 ,info='Change tts output speed (100 = normal)', visible=False)
645
  with gr.Column():
646
  vc_split_model = gr.Dropdown(label="Splitter Model", choices=["hdemucs_mmi", "htdemucs", "htdemucs_ft", "mdx", "mdx_q", "mdx_extra_q"], allow_custom_value=False, visible=False, value="htdemucs", info="Select the splitter model (Default: htdemucs)")
647
  vc_split_log = gr.Textbox(label="Output Information", visible=False, interactive=False)
 
98
  return "You need to enter text and select a voice", None
99
  inc_rate = "+0%"
100
  if tts_rate < 0 :
101
+ inc_rate = (f"{round(tts_rate)}%")
102
  else:
103
+ inc_rate = (f"+{round(tts_rate)}%")
104
 
105
  asyncio.run(edge_tts.Communicate(text=tts_text, voice= "-".join(tts_voice.split('-')[:-1]), rate= inc_rate).save("tts.mp3"))
106
  audio, sr = librosa.load("tts.mp3", sr=16000, mono=True)
 
641
  # TTS
642
  tts_text = gr.Textbox(label="TTS text", value="hello world", info="Text to speech input", visible=False)
643
  tts_voice = gr.Dropdown(label="Edge-tts speaker", choices=voices, visible=False, allow_custom_value=False, value="en-US-AnaNeural-Female")
644
+ tts_rate = gr.Number(label="TTS Rate", value = 0 ,info='Change to increase tts speed (0 = normal)', visible=False)
645
  with gr.Column():
646
  vc_split_model = gr.Dropdown(label="Splitter Model", choices=["hdemucs_mmi", "htdemucs", "htdemucs_ft", "mdx", "mdx_q", "mdx_extra_q"], allow_custom_value=False, visible=False, value="htdemucs", info="Select the splitter model (Default: htdemucs)")
647
  vc_split_log = gr.Textbox(label="Output Information", visible=False, interactive=False)