It looks like you're new here. If you want to get involved, click one of these buttons!
function speak(text, lang) local textToSend=text:gsub(" ", "+") local ttsUrl=string.format("<a href="http://translate.google.com/translate_tts?tl=%s&q=%s"" rel="nofollow">http://translate.google.com/translate_tts?tl=%s&q=%s"</a>, lang or "en", textToSend) local ttsData = NSData:dataWithContentsOfURL(NSURL:URLWithString(ttsUrl)) local avPlayer = AVAudioPlayer:initWithData_error(ttsData, nil) avPlayer:play() end speak("Heres a bit of fun. Frankly I was amazed at how quickly this rendered, and how good the quality was.") -- or -- speak("Tres bon, mes amis. Ce logiciel est tellement genial!", "fr") |
Likes: atilim