kevinwang676 commited on
Commit
1deb9a5
1 Parent(s): 5a5ad75

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -57,6 +57,10 @@ with app:
57
  api_key = gr.Textbox(type='password', label='OpenAI API Key', placeholder='Enter your API key to access the TTS demo')
58
  model = gr.Dropdown(choices=['tts-1','tts-1-hd'], label='Model', value='tts-1')
59
  voice = gr.Dropdown(choices=['alloy', 'echo', 'fable', 'onyx', 'nova', 'shimmer'], label='Voice Options', value='alloy')
 
 
 
 
60
 
61
  with gr.Column():
62
  inp1 = gr.Audio(type="filepath", label="请上传AI变声的原音频(决定变声后的语音内容)")
@@ -64,7 +68,7 @@ with app:
64
  btn1 = gr.Button("一键开启AI变声吧", variant="primary")
65
  with gr.Column():
66
  out1 = gr.Audio(type="filepath", label="AI变声后的专属音频")
67
- btn_text.click(tts, [text, model, voice, api_key], inp1)
68
  btn1.click(voice_change, [inp1, inp2], out1)
69
 
70
  gr.Markdown("### <center>注意❗:请不要生成会对个人以及组织造成侵害的内容,此程序仅供科研、学习及个人娱乐使用。</center>")
 
57
  api_key = gr.Textbox(type='password', label='OpenAI API Key', placeholder='Enter your API key to access the TTS demo')
58
  model = gr.Dropdown(choices=['tts-1','tts-1-hd'], label='Model', value='tts-1')
59
  voice = gr.Dropdown(choices=['alloy', 'echo', 'fable', 'onyx', 'nova', 'shimmer'], label='Voice Options', value='alloy')
60
+ with gr.Row():
61
+ with gr.Column():
62
+ inp_text = gr.Textbox(label="请填写您想生成的文本(中英文皆可)", placeholder="想说却还没说的 还很多 攒着是因为想写成歌")
63
+ btn_text = gr.Button("一键开启真实拟声吧", variant="primary")
64
 
65
  with gr.Column():
66
  inp1 = gr.Audio(type="filepath", label="请上传AI变声的原音频(决定变声后的语音内容)")
 
68
  btn1 = gr.Button("一键开启AI变声吧", variant="primary")
69
  with gr.Column():
70
  out1 = gr.Audio(type="filepath", label="AI变声后的专属音频")
71
+ btn_text.click(tts, [inp_text, model, voice, api_key], inp1)
72
  btn1.click(voice_change, [inp1, inp2], out1)
73
 
74
  gr.Markdown("### <center>注意❗:请不要生成会对个人以及组织造成侵害的内容,此程序仅供科研、学习及个人娱乐使用。</center>")