jonathanagustin commited on
Commit
73490cc
1 Parent(s): d72598f

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +12 -16
app.py CHANGED
@@ -98,28 +98,28 @@ def main():
98
  gr.set_static_paths(paths=[PREVIEW_DIR])
99
 
100
  # Create the 'preview_audio' component
101
- preview_audio = gr.Audio(
102
- interactive=False,
103
- label="Echo",
104
- value=VOICE_PREVIEW_FILES['echo'],
105
- visible=True,
106
- show_download_button=False,
107
- show_share_button=False,
108
- autoplay=False,
109
- )
110
 
111
  with gr.Blocks(title="OpenAI - Text to Speech") as demo:
112
  with gr.Row():
113
  with gr.Column(scale=1):
114
- gr.Markdown("### Voice Preview")
115
-
116
  # Function to play the selected voice sample
117
  def play_voice_sample(voice):
118
  return gr.update(
119
  value=VOICE_PREVIEW_FILES[voice],
120
- label=voice.capitalize(),
121
  )
122
 
 
 
 
 
 
 
 
 
 
 
123
  with gr.Group():
124
  # Create buttons for each voice
125
  for voice in VOICE_OPTIONS:
@@ -133,9 +133,6 @@ def main():
133
  outputs=preview_audio,
134
  )
135
 
136
- # Place the audio player below the buttons
137
- preview_audio.render()
138
-
139
  with gr.Column(scale=1):
140
  api_key_input = gr.Textbox(
141
  label="OpenAI API Key",
@@ -165,7 +162,6 @@ def main():
165
  step=0.05,
166
  label="Voice Speed",
167
  value=1.0,
168
- info="Adjust the speed of the generated speech.",
169
  )
170
 
171
  with gr.Column(scale=2):
 
98
  gr.set_static_paths(paths=[PREVIEW_DIR])
99
 
100
  # Create the 'preview_audio' component
101
+
 
 
 
 
 
 
 
 
102
 
103
  with gr.Blocks(title="OpenAI - Text to Speech") as demo:
104
  with gr.Row():
105
  with gr.Column(scale=1):
 
 
106
  # Function to play the selected voice sample
107
  def play_voice_sample(voice):
108
  return gr.update(
109
  value=VOICE_PREVIEW_FILES[voice],
110
+ label=f"Preview Voice: {voice.capitalize()}",
111
  )
112
 
113
+ preview_audio = gr.Audio(
114
+ interactive=False,
115
+ label="Echo",
116
+ value=VOICE_PREVIEW_FILES['echo'],
117
+ visible=True,
118
+ show_download_button=False,
119
+ show_share_button=False,
120
+ autoplay=False,
121
+ )
122
+
123
  with gr.Group():
124
  # Create buttons for each voice
125
  for voice in VOICE_OPTIONS:
 
133
  outputs=preview_audio,
134
  )
135
 
 
 
 
136
  with gr.Column(scale=1):
137
  api_key_input = gr.Textbox(
138
  label="OpenAI API Key",
 
162
  step=0.05,
163
  label="Voice Speed",
164
  value=1.0,
 
165
  )
166
 
167
  with gr.Column(scale=2):