Watson Text-to-Speech in Python.
Perform text-to-speech on the given text.
Here's a function you can build upon to bring wtts
to your bot.
(Imports and handlers omitted for brevity)
def tts(bot, update):
text = update.message.text
tmp_f = open('tmp.ogg', 'wb+')
tmp_f.write(watsontts.synthesize(text).content)
bot.sendAudio(update.message.chat_id, audio=open('tmp.ogg', 'rb'))
tmp_f.close()
os.remove('tmp.ogg')
Try it online or run python3 watsontts.py
MIT. See LICENSE.