gnosticdev commited on
Commit
e9bdd57
·
verified ·
1 Parent(s): d8c3a98

Update tts_module.py

Browse files
Files changed (1) hide show
  1. tts_module.py +7 -2
tts_module.py CHANGED
@@ -2,8 +2,13 @@ import asyncio
2
  import tempfile
3
  import edge_tts
4
 
5
- async def text_to_speech(text):
6
- voice = "en-US-AriaNeural" # Puedes cambiar esto por otras voces disponibles
 
 
 
 
 
7
  rate = "0%" # Ajuste de velocidad
8
  pitch = "0Hz" # Ajuste de tono
9
 
 
2
  import tempfile
3
  import edge_tts
4
 
5
+ async def list_voices():
6
+ """Lista todas las voces disponibles."""
7
+ voices = await edge_tts.list_voices()
8
+ return {f"{v['ShortName']} ({v['Gender']})": v['ShortName'] for v in voices}
9
+
10
+ async def text_to_speech(text, voice):
11
+ """Convierte texto a voz usando edge_tts."""
12
  rate = "0%" # Ajuste de velocidad
13
  pitch = "0Hz" # Ajuste de tono
14