Skip to main content
Participant
October 11, 2011
Question

Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error.

  • October 11, 2011
  • 3 replies
  • 3554 views

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();

This topic has been closed for replies.

3 replies

June 6, 2012

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?

chris.campbell
Legend
June 7, 2012

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.

October 14, 2011

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!