Page 1 of 1

Text to speech without LiveCodeSDK-R14.

Posted: Thu Oct 23, 2014 5:35 pm
by lodijoe
LiveCode announced that copy files do not work with the iOS 8 simulator in the release of LiveCode 6.6.4 with iOS 8 Support.
I found a script by Terryho that sends some text out to Google and returns a wave file which speaks the text on an Android device:
viewtopic.php?f=10&t=18299&p=92097&hilit=translate#p92097
I got this to work with LiveCode 6.6.4 and xCode 6.0.1
I had the code make an mp3 file.
Here is the code I use:
on mouseUp
set the defaultFolder to specialFolderPath("Documents")
put "Hello World" into tpostsound
replace space with "%20" in tpostsound
put "http://translate.google.com/translate_tts?tl=en&q=" & tpostsound into tpostURL
get URL(tpostURL)
put it into URL ("binfile:abc.mp3")
if the environment is "mobile" then
play specialFolderPath("Documents") & "/"&abc.mp3
end if
end mouseUp