rime commited on
Commit
f397e4d
·
1 Parent(s): 40ef766

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -2,6 +2,11 @@ import requests
2
  import gradio as gr
3
  import base64
4
 
 
 
 
 
 
5
  def synthesize(key, sentence, speaker):
6
  headers = {
7
  'Authorization': 'Bearer {}'.format(key),
@@ -22,5 +27,5 @@ def synthesize(key, sentence, speaker):
22
 
23
  iface = gr.Interface(fn=synthesize, inputs=[gr.Textbox(type="password", info="This is where you put your Rime TTS API key."),
24
  gr.Textbox(info="Enter the text you want synthesized here. Check out our documentation for specifics and suggestions on text input!"),
25
- gr.Textbox(info="Enter speaker code here.")], outputs=gr.Audio())
26
  iface.launch()
 
2
  import gradio as gr
3
  import base64
4
 
5
+ speakers = []
6
+ with open('speakers.txt', 'r') as fp:
7
+ for line in fp:
8
+ speakers.append(line.strip())
9
+
10
  def synthesize(key, sentence, speaker):
11
  headers = {
12
  'Authorization': 'Bearer {}'.format(key),
 
27
 
28
  iface = gr.Interface(fn=synthesize, inputs=[gr.Textbox(type="password", info="This is where you put your Rime TTS API key."),
29
  gr.Textbox(info="Enter the text you want synthesized here. Check out our documentation for specifics and suggestions on text input!"),
30
+ gr.Dropdown(speakers, info="Enter speaker code here.")], outputs=gr.Audio())
31
  iface.launch()