antfraia commited on
Commit
d7c3749
·
1 Parent(s): 9f50f7e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -25,16 +25,20 @@ def generate_voice(text, voice_name):
25
  except Exception as e:
26
  raise gr.Error(str(e))
27
 
 
 
 
 
 
 
 
28
  input_text = gr.Textbox(
29
  label="Input Text (250 characters max)",
30
  lines=2,
31
- value="Hahaha OHH MY GOD! This is SOOO funny, I-I am Eleven a text-to-speech system!",
32
  elem_id="input_text"
33
  )
34
 
35
- desired_voices = ["Anita", "Rachael", "Michael", "Antonio"]
36
- filtered_voices = [voice.name for voice in all_voices if voice.name in desired_voices]
37
-
38
  input_voice = gr.Dropdown(
39
  choices=filtered_voices,
40
  default="Antonio",
 
25
  except Exception as e:
26
  raise gr.Error(str(e))
27
 
28
+ # Fetch all available voices
29
+ all_voices = voices()
30
+
31
+ # Filter out the desired voices and set Antonio as default
32
+ desired_voices = ["Anita", "Rachael", "Michael", "Antonio"]
33
+ filtered_voices = [voice.name for voice in all_voices if voice.name in desired_voices]
34
+
35
  input_text = gr.Textbox(
36
  label="Input Text (250 characters max)",
37
  lines=2,
38
+ value="Ciao, è un piacere conoscerti. Se vuoi sentire la mia voce clicca Run",
39
  elem_id="input_text"
40
  )
41
 
 
 
 
42
  input_voice = gr.Dropdown(
43
  choices=filtered_voices,
44
  default="Antonio",