Spaces:
Running
Running
jonathanagustin
commited on
Commit
•
15934ba
1
Parent(s):
2c2c365
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
@@ -68,28 +68,27 @@ def main():
|
|
68 |
with gr.Row():
|
69 |
with gr.Column(scale=1):
|
70 |
gr.Markdown("### Voice Preview")
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
preview_audio.render()
|
93 |
|
94 |
with gr.Column(scale=1):
|
95 |
api_key_input = gr.Textbox(
|
|
|
68 |
with gr.Row():
|
69 |
with gr.Column(scale=1):
|
70 |
gr.Markdown("### Voice Preview")
|
71 |
+
# Function to play the selected voice sample
|
72 |
+
def play_voice_sample(voice):
|
73 |
+
return gr.update(
|
74 |
+
value=VOICE_PREVIEW_FILES[voice],
|
75 |
+
label=voice.capitalize(),
|
76 |
+
)
|
77 |
+
|
78 |
+
# Create buttons for each voice
|
79 |
+
for voice in VOICE_OPTIONS:
|
80 |
+
voice_button = gr.Button(
|
81 |
+
value=f"{voice.capitalize()}",
|
82 |
+
variant="secondary",
|
83 |
+
size="sm",
|
84 |
+
)
|
85 |
+
voice_button.click(
|
86 |
+
fn=partial(play_voice_sample, voice=voice),
|
87 |
+
outputs=preview_audio,
|
88 |
+
)
|
89 |
+
|
90 |
+
# Place the audio player below the buttons
|
91 |
+
preview_audio.render()
|
|
|
92 |
|
93 |
with gr.Column(scale=1):
|
94 |
api_key_input = gr.Textbox(
|