hivecorp commited on
Commit
bc3f691
·
verified ·
1 Parent(s): f260907

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +47 -8
app.py CHANGED
@@ -138,22 +138,61 @@ async def process_script(script_text, pitch, rate, voice):
138
  return srt_path, audio_path, audio_path
139
 
140
  # Gradio interface setup with pitch adjustment slider, rate adjustment slider, and voice selection
141
- voice_options = ["en-US-AndrewNeural", "en-US-JennyNeural", "en-US-GuyNeural"] # Example voice options
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
 
143
  app = gr.Interface(
144
  fn=process_script,
145
  inputs=[
146
  gr.Textbox(label="Enter Script Text", lines=10),
147
- gr.Slider(label="Pitch Adjustment (Hz)", minimum=-100, maximum=100, step=1, value=0),
148
- gr.Slider(label="Rate Adjustment (%)", minimum=-100, maximum=100, step=1, value=0), # Rate slider
149
- gr.Dropdown(label="Select Speaker", choices=voice_options, value=voice_options[0]) # Dropdown for voice selection
150
  ],
151
  outputs=[
152
- gr.File(label="Download SRT File"),
153
- gr.File(label="Download Audio File"),
154
- gr.Audio(label="Play Audio")
155
  ],
156
- description="HIVEcorp TTS Generator with adjustable pitch, rate, and speaker selection."
157
  )
158
 
159
  app.launch()
 
138
  return srt_path, audio_path, audio_path
139
 
140
  # Gradio interface setup with pitch adjustment slider, rate adjustment slider, and voice selection
141
+ voice_options = {
142
+ "Andrew": "en-US-AndrewNeural",
143
+ "Jenny": "en-US-JennyNeural",
144
+ "Guy": "en-US-GuyNeural",
145
+ "Ana": "en-US-AnaNeural",
146
+ "Aria": "en-US-AriaNeural",
147
+ "Brian": "en-US-BrianNeural",
148
+ "Christopher": "en-US-ChristopherNeural",
149
+ "Eric": "en-US-EricNeural",
150
+ "Michelle": "en-US-MichelleNeural",
151
+ "Roger": "en-US-RogerNeural",
152
+ "Natasha": "en-AU-NatashaNeural",
153
+ "William": "en-AU-WilliamNeural",
154
+ "Clara": "en-CA-ClaraNeural",
155
+ "Liam": "en-CA-LiamNeural",
156
+ "Libby": "en-GB-LibbyNeural",
157
+ "Maisie": "en-GB-MaisieNeural",
158
+ "Ryan": "en-GB-RyanNeural",
159
+ "Sonia": "en-GB-SoniaNeural",
160
+ "Thomas": "en-GB-ThomasNeural",
161
+ "Sam": "en-HK-SamNeural",
162
+ "Yan": "en-HK-YanNeural",
163
+ "Connor": "en-IE-ConnorNeural",
164
+ "Emily": "en-IE-EmilyNeural",
165
+ "Neerja": "en-IN-NeerjaNeural",
166
+ "Prabhat": "en-IN-PrabhatNeural",
167
+ "Asilia": "en-KE-AsiliaNeural",
168
+ "Chilemba": "en-KE-ChilembaNeural",
169
+ "Abeo": "en-NG-AbeoNeural",
170
+ "Ezinne": "en-NG-EzinneNeural",
171
+ "Mitchell": "en-NZ-MitchellNeural",
172
+ "James": "en-PH-JamesNeural",
173
+ "Rosa": "en-PH-RosaNeural",
174
+ "Luna": "en-SG-LunaNeural",
175
+ "Wayne": "en-SG-WayneNeural",
176
+ "Elimu": "en-TZ-ElimuNeural",
177
+ "Imani": "en-TZ-ImaniNeural",
178
+ "Leah": "en-ZA-LeahNeural",
179
+ "Luke": "en-ZA-LukeNeural"
180
+ } # All voice options
181
 
182
  app = gr.Interface(
183
  fn=process_script,
184
  inputs=[
185
  gr.Textbox(label="Enter Script Text", lines=10),
186
+ gr.Slider(label="Pitch Adjustment (Hz)", minimum=-100, maximum=100, step=1, value=1), # Default set to +1
187
+ gr.Slider(label="Rate Adjustment (%)", minimum=-100, maximum=100, step=1, value=1), # Default set to +1
188
+ gr.Dropdown(label="Select Voice", choices=list(voice_options.keys()), value="Andrew")
189
  ],
190
  outputs=[
191
+ gr.File(label="Download SRT"),
192
+ gr.File(label="Download Audio"),
193
+ gr.Audio(label="Audio Playback")
194
  ],
195
+ live=True
196
  )
197
 
198
  app.launch()