file tts.py
libraries
from gtts import gTTS
# The text that you want to convert to audio
mytext = "Bienvenido toroautos"
# Language in which you want to convert
language = 'en'
# Passing the text and language to the engine
tts = gTTS(text=mytext, lang=language, slow=False)
# Saving the converted audio in a wav file named sample
tts.save('tts.mp3')
Call
[tts]
exten => 220,1,Answer
same => n,Background(welcome)
same => n,Set(result=$(SHELL(python3 py/tts.py )))
same => n,Background(py/tts.mp3)
same => n,Background(es/thanks-for-calling-today.gsm)
same => n,Hangup()
No hay comentarios:
Publicar un comentario