def make_tts_file(content, lang): fp = mktemp() tts = gTTS(text=content, lang=lang) tts.save(fp) return fp