Update app.py
Browse files
app.py
CHANGED
@@ -22,7 +22,7 @@ def text_to_speech(model_name, length_scale, text, prep_text):
|
|
22 |
if prep_text:
|
23 |
text = accentizer.process_all(text)
|
24 |
audio = models[model_name](text, length_scale=length_scale)
|
25 |
-
models[model_name].save_wav(audio, 'temp.wav')
|
26 |
|
27 |
return 'temp.wav', f"Обработанный текст: '{text}'"
|
28 |
|
@@ -36,4 +36,4 @@ output_audio = gr.Audio(label="Аудио", type="numpy")
|
|
36 |
output_text = gr.Textbox(label="Обработанный текст")
|
37 |
|
38 |
iface = gr.Interface(fn=text_to_speech, inputs=[model_choice, length_scale, input_text, prep_text], outputs=[output_audio, output_text], title=title)
|
39 |
-
iface.launch()
|
|
|
22 |
if prep_text:
|
23 |
text = accentizer.process_all(text)
|
24 |
audio = models[model_name](text, length_scale=length_scale)
|
25 |
+
models[model_name].save_wav(audio, 'temp.wav', sample_rate=models[model_name].config["samplerate"])
|
26 |
|
27 |
return 'temp.wav', f"Обработанный текст: '{text}'"
|
28 |
|
|
|
36 |
output_text = gr.Textbox(label="Обработанный текст")
|
37 |
|
38 |
iface = gr.Interface(fn=text_to_speech, inputs=[model_choice, length_scale, input_text, prep_text], outputs=[output_audio, output_text], title=title)
|
39 |
+
iface.launch()
|