|
import gradio as gr |
|
import os |
|
|
|
def inference(text): |
|
os.system("paddlespeech tts --input '"+text+"' --output output.wav") |
|
return "output.wav" |
|
|
|
def guess(texts): |
|
return inference(texts + i love) |
|
|
|
|
|
description = "用 PaddleSpeech-TTS 來生成電話訪問的語音內容" |
|
|
|
article = "<p style='text-align: center'><a href='https://github.com/PaddlePaddle/PaddleSpeech' target='_blank'>Github Repo</a></p>" |
|
|
|
examples=[['我比較想試試看換成自己的聲音來輸出'], ['你是不是也想試試看如果可以變成自己的聲音輸出呢'], ['這個可能會有點久']] |
|
|
|
gr.Interface( |
|
guess, |
|
gr.inputs.Textbox(label="input text",lines=10), |
|
gr.outputs.Audio(type="filepath", label="Output"), |
|
title="<p style='text-align: center'><a href='https://www.twman.org/AI' target='_blank'>電話訪問:PaddleSpeech-TTS</a>", |
|
description=description, |
|
article=article, |
|
enable_queue=True, |
|
examples=examples |
|
).launch(debug=True) |
|
|