Copy link to clipboard
Copied
Hello,
I'm trying to include some text to speech function into my flash, the code above works perfectly fine when i open my class in AS3, however it fails when I uses adobe air to run my class:
var channel:SoundChannel = new SoundChannel();
var snd:Sound = new Sound();
var req:URLRequest = new URLRequest("http://translate.google.com/translate_tts?tl=en&q=hello");
snd.load(req);
channel =snd.play();
Copy link to clipboard
Copied
Hello,
Thanks for your reporting. Could you please open a new bug report on this over at bugbase.adobe.com and add the link of this post in the bug? Once the bug has been added would you mind posting back with the URL so that others affected can add their votes and comments?
Thanks!
Copy link to clipboard
Copied
Same problem here. This is obviously a security issue - as it works using Flash in local. Yang, could you explain us why there is a difference between the AIR version and the web version? This is not a bug, but a difference in how AIR allows data to be loaded from a remote source. translate.google.com doesn't have any crossdomain, can that be the issue here?
Copy link to clipboard
Copied
Try adding the following line to the code example above:
req.requestHeaders.push(new URLRequestHeader("Referer", "http://translate.google.com"));
I'll try to find out why we have a difference here, but I believe this will resolve the problem with at least Google's service. Before adding this line, I was getting a 404 when I tried to load the URL in AIR. Afterwards, the sound loaded and the server responded with a 200.