Update app.py
Browse files
app.py
CHANGED
|
@@ -43,12 +43,14 @@ body {
|
|
| 43 |
text-align: center;
|
| 44 |
}
|
| 45 |
.play-btn {
|
| 46 |
-
background-color:
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
|
|
|
|
|
|
| 52 |
}
|
| 53 |
.playing {
|
| 54 |
animation: pulse 1s infinite alternate;
|
|
@@ -70,8 +72,11 @@ with gr.Blocks(css=custom_css) as demo:
|
|
| 70 |
if i + j < len(voices):
|
| 71 |
voice = voices[i + j]
|
| 72 |
with gr.Column():
|
| 73 |
-
|
| 74 |
-
|
|
|
|
|
|
|
|
|
|
| 75 |
info = gr.Markdown(f"**{voice['name']}**<br>{voice['gender']} | {voice['country']}")
|
| 76 |
|
| 77 |
def start_animation():
|
|
|
|
| 43 |
text-align: center;
|
| 44 |
}
|
| 45 |
.play-btn {
|
| 46 |
+
background-color: transparent;
|
| 47 |
+
border: none;
|
| 48 |
+
font-size: 24px;
|
| 49 |
+
color: #FF5722;
|
| 50 |
+
cursor: pointer;
|
| 51 |
+
}
|
| 52 |
+
.play-btn:hover {
|
| 53 |
+
color: #ff8a50;
|
| 54 |
}
|
| 55 |
.playing {
|
| 56 |
animation: pulse 1s infinite alternate;
|
|
|
|
| 72 |
if i + j < len(voices):
|
| 73 |
voice = voices[i + j]
|
| 74 |
with gr.Column():
|
| 75 |
+
# Hidden Audio Component
|
| 76 |
+
audio = gr.Audio(play_audio(voice["file"]), autoplay=False, elem_id=voice["name"], visible=False)
|
| 77 |
+
# Play Button with FontAwesome Icon
|
| 78 |
+
btn = gr.Button("▶", elem_classes="play-btn")
|
| 79 |
+
# Voice Info
|
| 80 |
info = gr.Markdown(f"**{voice['name']}**<br>{voice['gender']} | {voice['country']}")
|
| 81 |
|
| 82 |
def start_animation():
|