I know the TTS API library is available offline on Android. But how can I use google’s online API? I found this code for iOS:
local ttsUrl=string.format("http://translate.google.com/translate_tts?tl=%s&q=%s", "en", textToSend)
local ttsData = NSData:dataWithContentsOfURL(NSURL:URLWithString(ttsUrl))
local avPlayer = AVAudioPlayer:initWithData_error(ttsData, nil)
avPlayer:play()
Basically, what’s the best way to send URL, receive the audio, and play it on Android?
Thank you very much!
Ok apparently it was as easy as using the Android MediaPlayer and passing the URL to setDataSource(String path). Cheers!