def say(self,text,lang,priority,volume="00"):
############################################
# the TTS function. make a mp3 from the text
# and put a file in the prioritylist
############################################
self.soundlog("say; put text in waitingrow: " + text)
with tempfile.NamedTemporaryFile(suffix='.mp3', delete=False) as f:
fname = f.name
tts = gTTS(text=text, lang=lang)
tts.save(fname)
self. write_in_prioritylist(priority,fname,"1",volume)
评论列表
文章目录