jonathanagustin commited on
Commit
e472def
1 Parent(s): a9471a7

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +16 -16
app.py CHANGED
@@ -102,22 +102,22 @@ def main():
102
  choices=VOICE_OPTIONS, label="Voice Options", value="echo"
103
  )
104
 
105
- # Add voice previews using HTML for minimal audio interface
106
- gr.Markdown("### Voice Previews")
107
- for voice in VOICE_OPTIONS:
108
- # Use the relative path for the audio file
109
- audio_url = f"file/{PREVIEW_DIR}/{voice}.wav"
110
- # Create an HTML audio player with minimal controls
111
- html_snippet = f'''
112
- <div>
113
- <p><strong>{voice.capitalize()}</strong></p>
114
- <audio controls preload="auto">
115
- <source src="{audio_url}" type="audio/wav">
116
- Your browser does not support the audio element.
117
- </audio>
118
- </div>
119
- '''
120
- gr.HTML(html_snippet)
121
 
122
  with gr.Column(scale=2):
123
  input_textbox = gr.Textbox(
 
102
  choices=VOICE_OPTIONS, label="Voice Options", value="echo"
103
  )
104
 
105
+ # Wrap the voice previews inside an Accordion that is closed by default
106
+ with gr.Accordion(label="Voice Previews", open=False):
107
+ for voice in VOICE_OPTIONS:
108
+ # Use the relative path for the audio file
109
+ audio_url = f"file/{PREVIEW_DIR}/{voice}.wav"
110
+ # Create an HTML audio player with minimal controls
111
+ html_snippet = f'''
112
+ <div>
113
+ <p><strong>{voice.capitalize()}</strong></p>
114
+ <audio controls preload="auto">
115
+ <source src="{audio_url}" type="audio/wav">
116
+ Your browser does not support the audio element.
117
+ </audio>
118
+ </div>
119
+ '''
120
+ gr.HTML(html_snippet)
121
 
122
  with gr.Column(scale=2):
123
  input_textbox = gr.Textbox(