Update tts_module.py
Browse files- 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
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
|