Spaces:
Running
Running
jonathanagustin
commited on
Commit
•
1777fa6
1
Parent(s):
5221577
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
@@ -80,35 +80,29 @@ def main():
|
|
80 |
choices=VOICE_OPTIONS, label="Voice Options", value="echo"
|
81 |
)
|
82 |
|
83 |
-
# Add voice previews
|
84 |
gr.Markdown("### Voice Previews")
|
85 |
for voice in VOICE_OPTIONS:
|
86 |
audio_url = VOICE_PREVIEWS[voice]
|
87 |
-
#
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
show_controls=False,
|
99 |
-
label=f"{voice.capitalize()}",
|
100 |
-
autoplay=False,
|
101 |
-
)
|
102 |
-
except requests.exceptions.RequestException as e:
|
103 |
-
gr.Markdown(
|
104 |
-
f"Could not load preview for {voice.capitalize()}: {e}"
|
105 |
-
)
|
106 |
|
107 |
with gr.Column(scale=2):
|
108 |
input_textbox = gr.Textbox(
|
109 |
label="Input Text", lines=10, placeholder="Type your text here..."
|
110 |
)
|
111 |
-
submit_button = gr.Button(
|
|
|
|
|
112 |
with gr.Column(scale=1):
|
113 |
output_audio = gr.Audio(label="Output Audio")
|
114 |
|
|
|
80 |
choices=VOICE_OPTIONS, label="Voice Options", value="echo"
|
81 |
)
|
82 |
|
83 |
+
# Add voice previews using HTML for minimal audio interface
|
84 |
gr.Markdown("### Voice Previews")
|
85 |
for voice in VOICE_OPTIONS:
|
86 |
audio_url = VOICE_PREVIEWS[voice]
|
87 |
+
# Create an HTML audio player with minimal controls
|
88 |
+
html_snippet = f'''
|
89 |
+
<div style="margin-bottom: 10px;">
|
90 |
+
<p><strong>{voice.capitalize()}</strong></p>
|
91 |
+
<audio controls style="width: 100%;">
|
92 |
+
<source src="{audio_url}" type="audio/wav">
|
93 |
+
Your browser does not support the audio element.
|
94 |
+
</audio>
|
95 |
+
</div>
|
96 |
+
'''
|
97 |
+
gr.HTML(html_snippet)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
|
99 |
with gr.Column(scale=2):
|
100 |
input_textbox = gr.Textbox(
|
101 |
label="Input Text", lines=10, placeholder="Type your text here..."
|
102 |
)
|
103 |
+
submit_button = gr.Button(
|
104 |
+
"Convert Text to Speech", variant="primary"
|
105 |
+
)
|
106 |
with gr.Column(scale=1):
|
107 |
output_audio = gr.Audio(label="Output Audio")
|
108 |
|