# módulo de fala (Fala.py)) ## # Criado em 08/2020 por FaGuiRo ### #Tecnologia: Google Text-to-Speech # from gtts import gTTS importar os tempo de importação de playound importar playound importar aleatório def fala ( texto ) : r1 = aleatório . randint ( 1 , 10000000 ) r2 = aleatório . randint ( 1 , 10000000 ) randfile = str ( r2 ) + "texto aleatório" + str ( r1 ) + ".mp3" tts = gTTS ( texto , lang = 'pt-br' ) tts. salvar ( randfile ) tempo . dormir ( 2 ) playound ( randfile , True ) tempo . dormir ( 2 ) os . remover ( randfile ) #Teste de uso: texto = input ( 'Texto:' ) fala ( texto ) # Contato: faguiro2005@gmail.com