KPatrick commited on
Commit
916cc21
1 Parent(s): 5dcc84f
Files changed (2) hide show
  1. app.py +20 -0
  2. packages.txt +0 -5
app.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+
3
+ import gradio as gr
4
+ from paddlespeech.cli import TTSExecutor
5
+
6
+ tts_executor = TTSExecutor()
7
+
8
+
9
+ def speech_generate(text: str) -> os.PathLike:
10
+ assert isinstance(text, str) and len(text) > 0, 'Input Chinese text...'
11
+ wav_file = tts_executor(text=text)
12
+ return wav_file
13
+
14
+
15
+ iface = gr.Interface(
16
+ fn=speech_generate,
17
+ inputs=gr.inputs.Textbox(placeholder='请输入文字...'),
18
+ outputs=gr.outputs.Audio(),
19
+ )
20
+ iface.launch()
packages.txt CHANGED
@@ -1,5 +0,0 @@
1
- libsndfile1
2
- sox
3
- ffmpeg
4
- libsm6
5
- libxext6