Spaces:
Sleeping
Sleeping
Update conver.py
Browse files
conver.py
CHANGED
|
@@ -194,28 +194,3 @@ class URLToAudioConverter:
|
|
| 194 |
)
|
| 195 |
return output_path, text_output
|
| 196 |
|
| 197 |
-
### Ejemplo de `app.py`
|
| 198 |
-
```python
|
| 199 |
-
from conver import ConversationConfig, URLToAudioConverter
|
| 200 |
-
import asyncio
|
| 201 |
-
|
| 202 |
-
async def main():
|
| 203 |
-
custom_prompt = (
|
| 204 |
-
"{text}\nCrea un diálogo de podcast en español entre Anfitrión1 y Anfitrión2. "
|
| 205 |
-
"Usa un tono informal y genera al menos 6 intercambios por hablante. "
|
| 206 |
-
"Devuelve SOLO un objeto JSON: {\"conversation\": [{\"speaker\": \"Anfitrión1\", \"text\": \"...\"}, {\"speaker\": \"Anfitrión2\", \"text\": \"...\"}]}"
|
| 207 |
-
)
|
| 208 |
-
config = ConversationConfig(custom_prompt_template=custom_prompt, max_words=5000)
|
| 209 |
-
converter = URLToAudioConverter(config, "tu_api_key")
|
| 210 |
-
text = "Discusión sobre inteligencia artificial y su impacto."
|
| 211 |
-
output_path, text_output = await converter.text_to_audio(
|
| 212 |
-
text,
|
| 213 |
-
voice_1="es-ES-AlvaroNeural",
|
| 214 |
-
voice_2="es-ES-ElviraNeural",
|
| 215 |
-
custom_music_path="mi_musica.mp3"
|
| 216 |
-
)
|
| 217 |
-
print(f"Podcast generado en: {output_path}")
|
| 218 |
-
print(f"Texto del diálogo:\n{text_output}")
|
| 219 |
-
|
| 220 |
-
if __name__ == "__main__":
|
| 221 |
-
asyncio.run(main())
|
|
|
|
| 194 |
)
|
| 195 |
return output_path, text_output
|
| 196 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|