The one package for TTS I discovered was Rtts. It doesn’t seem very complete but it surely does the job of converting text to speech. The only API that works right now is **ITRI (http://tts.itri.org.tw)**. And it only helps English and Chinese.
Let’s attempt it out!
Here, I’ll be utilizing a quote from DOUGLAS ADAMS’ THE HITCHHIKER’S Guide TO THE GALAXY:
The main TTS function is tts_ITRI() and I’m going to loop over the completely different robot voice generator (website.businessbiz.org) choices.
I uploaded the outcomes to Soundcloud for you to listen to: – audio-tts-bruce – audio-tts-theresa – audio-tts-angela – audio-tts-mchen-bruce – audio-tts-mchen-joddess – audio-tts-eng-bob – audio-tts-eng-alice – audio-tts-eng-tracy
As you can hear, it sounds fairly wonky. There are a lot of better alternate options on the market, however most of them aren’t free and/or can’t be used (as simply) from R. Noam Ross tried IBM Watson’s TTS API on this post, which can be a very good answer. Or you may access the Google Cloud API from within R.
Essentially the most handy answer for me was to use eSpeak from the command line. The output sounds relatively good, it’s free and gives many languages and voices with a number of parameters to tweak.