Hi,
I try to use the following in Livecode, but can not success.
put "hello word" into tpostsound
replace space with "%20" in tpostsound
put "http://translate.google.com/translate_tts?tl=en&q=" into tpostURL
post tpostsound to URL tpostURL
put it into field "abc"
in the field "abc", is nothing.
Can I use this in Livecode? or I use the wrong method to work with google TTS?
Please help.
Regards
Terry Ho
Can I use Google TTS in Livecode
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: Can I use Google TTS in Livecode
Hi terryho,
"it" will contain an error if an error occurred otherwise it will be empty.
But I think you might want speech?
Then I'd use a browser.
Simon
Edit; I did get this to work with a player object.
"it" will contain an error if an error occurred otherwise it will be empty.
But I think you might want speech?
Then I'd use a browser.
Simon
Edit; I did get this to work with a player object.
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Can I use Google TTS in Livecode
Is that really a post url? It looks like a "get" to me.should get you some binary data in the field. But that surely isn't going to help? (Especially not in a field - if you needed to store binary, make it a custom property).
Code: Select all
put "hello word" 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 field "abc"
Re: Can I use Google TTS in Livecode
Hi SparkOut,
You hint the point.
Now it is work, with the following code, which will save a wav file
put "hello word" 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:/users/terry/abc.wav")
you can play back the abc.wav file
Regards
Terry Ho
You hint the point.
Now it is work, with the following code, which will save a wav file
put "hello word" 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:/users/terry/abc.wav")
you can play back the abc.wav file
Regards
Terry Ho