I Found a way to do Text to Speech in Android.
Posted: Tue Sep 30, 2014 11:34 pm
In the Feature Requests and Building Externals Forums, I asked to have text to speech for Android . No one replied with a suggestion so I searched the forums.
I found a script by Terryho that sends some text out to Google and returns a wave file which speaks the text:
http://forums.livecode.com/viewtopic.ph ... ate#p92097
This worked on my iMac but wouldn't on Android.
I spent days trying to figure it out until I found I needed to check the internet box in the Application Permissions in the
Standalone Settings for the Android app.
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
I found a script by Terryho that sends some text out to Google and returns a wave file which speaks the text:
http://forums.livecode.com/viewtopic.ph ... ate#p92097
This worked on my iMac but wouldn't on Android.
I spent days trying to figure it out until I found I needed to check the internet box in the Application Permissions in the
Standalone Settings for the Android app.
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