Spaces:
Running
Running
Speaker Voice dropdown
Browse files
app.py
CHANGED
@@ -289,9 +289,19 @@ class TextExtractor:
|
|
289 |
raise ValueError(f"Unsupported file type: {file_extension}")
|
290 |
|
291 |
async def process_input(input_text: str, input_file, language: str, speaker1: str, speaker2: str) -> str:
|
292 |
-
|
293 |
-
|
294 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
295 |
|
296 |
if input_file:
|
297 |
input_text = await TextExtractor.extract_text(input_file.name)
|
@@ -322,27 +332,27 @@ iface = gr.Interface(
|
|
322 |
],
|
323 |
value="English"),
|
324 |
gr.Dropdown(label="Speaker 1 Voice", choices=[
|
325 |
-
"
|
326 |
-
"
|
327 |
-
"
|
328 |
-
"
|
329 |
-
"
|
330 |
-
"
|
331 |
-
"
|
332 |
-
"
|
333 |
],
|
334 |
-
value="
|
335 |
gr.Dropdown(label="Speaker 2 Voice", choices=[
|
336 |
-
"
|
337 |
-
"
|
338 |
-
"
|
339 |
-
"
|
340 |
-
"
|
341 |
-
"
|
342 |
-
"
|
343 |
-
"
|
344 |
],
|
345 |
-
value="
|
346 |
],
|
347 |
outputs=[
|
348 |
gr.Audio(label="Generated Podcast Audio")
|
|
|
289 |
raise ValueError(f"Unsupported file type: {file_extension}")
|
290 |
|
291 |
async def process_input(input_text: str, input_file, language: str, speaker1: str, speaker2: str) -> str:
|
292 |
+
voice_names = {
|
293 |
+
"Andrew - English (United States)": "en-US-AndrewMultilingualNeural",
|
294 |
+
"Ava - English (United States)": "en-US-AvaMultilingualNeural",
|
295 |
+
"Brian - English (United States)": "en-US-BrianMultilingualNeural",
|
296 |
+
"Emma - English (United States)": "en-US-EmmaMultilingualNeural",
|
297 |
+
"Florian - German (Germany)": "de-DE-FlorianMultilingualNeural",
|
298 |
+
"Seraphina - German (Germany)": "de-DE-SeraphinaMultilingualNeural",
|
299 |
+
"Remy - French (France)": "fr-FR-RemyMultilingualNeural",
|
300 |
+
"Vivienne - French (France)": "fr-FR-VivienneMultilingualNeural"
|
301 |
+
}
|
302 |
+
|
303 |
+
speaker1 = voice_names[speaker1]
|
304 |
+
speaker2 = voice_names[speaker2]
|
305 |
|
306 |
if input_file:
|
307 |
input_text = await TextExtractor.extract_text(input_file.name)
|
|
|
332 |
],
|
333 |
value="English"),
|
334 |
gr.Dropdown(label="Speaker 1 Voice", choices=[
|
335 |
+
"Andrew - English (United States)",
|
336 |
+
"Ava - English (United States)",
|
337 |
+
"Brian - English (United States)",
|
338 |
+
"Emma - English (United States)",
|
339 |
+
"Florian - German (Germany)",
|
340 |
+
"Seraphina - German (Germany)",
|
341 |
+
"Remy - French (France)",
|
342 |
+
"Vivienne - French (France)"
|
343 |
],
|
344 |
+
value="Andrew - English (United States)"),
|
345 |
gr.Dropdown(label="Speaker 2 Voice", choices=[
|
346 |
+
"Andrew - English (United States)",
|
347 |
+
"Ava - English (United States)",
|
348 |
+
"Brian - English (United States)",
|
349 |
+
"Emma - English (United States)",
|
350 |
+
"Florian - German (Germany)",
|
351 |
+
"Seraphina - German (Germany)",
|
352 |
+
"Remy - French (France)",
|
353 |
+
"Vivienne - French (France)"
|
354 |
],
|
355 |
+
value="Ava - English (United States)")
|
356 |
],
|
357 |
outputs=[
|
358 |
gr.Audio(label="Generated Podcast Audio")
|