PDA

View Full Version : [AS3.0] Streaming Sounds Error



dewey
March 4th, 2007, 06:44 PM
Hey Everyone...

I have a little problem with AS3 at the moment... I have some code that is connecting to a radio stream and it playing the music. That much works... I also have a little dropdown box which lets the user switch the stream... Whenever I try to switch the stream, I'm getting this error...

Error: Error #2037: Functions called in incorrect sequence, or earlier call was unsuccessful.
at flash.media::Sound/flash.media:Sound::_load()

Which doesn't make much sense... this is the code throwing the error...



private function changeStation():void
{
sound.close();
sound.load(new URLRequest(cbStations.selectedItem.url));
getStreamInfo.send({streamUrl: cbStations.selectedItem.stationid});
}


Anyways, I have tried to modify that block of code, but I can't seem to get anything to work...

Does anyone have any suggestions?

Thanks,

--d

TheCanadian
March 4th, 2007, 06:51 PM
I'm not entirely sure, but I don't think you can load a new sound into a Sound instance once it has already loaded a sound. I'm pretty sure you must create a new Sound instance.

dewey
March 4th, 2007, 07:01 PM
I'm not entirely sure, but I don't think you can load a new sound into a Sound instance once it has already loaded a sound. I'm pretty sure you must create a new Sound instance.


Hmm... that does appear to be the problem... I guess I'll have to figure something out...

Thanks a lot, eh? Always good to get help from a fellow Canuck!

TheCanadian
March 4th, 2007, 07:46 PM
Glad to help, hopefully you'll find a solution :)

Sher Ali
August 6th, 2007, 09:51 AM
I got same problem last day when I was trying to make a mp3 player in Actionscript 3.0 using Only OOP just for my practice. But I solved the problem after some dubugging.

You can solve this as:


private function changeStation():void
{
sound.close();
sound = new Sound();
sound.load(new URLRequest(cbStations.selectedItem.url));
getStreamInfo.send({streamUrl: cbStations.selectedItem.stationid});
}

scoult01
August 6th, 2007, 08:18 PM
I'm not sure if they is related at all but i'm getting an error while streaming, however it only happens whenever I close a window or refresh a page.

Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error.
at com.player::SoundController/PlayPodcast()
at com.player::Playlist/::doubleClickItem()

I've tried creating a listener that closes the sound on that event, however it doesn't stop the error message. Has anyone else come across this?

LeonardoZimbres
August 28th, 2007, 03:53 PM
Its happening with me too. Im looking for one solution. Imagine this f*cking error message showing on your site.

Raul Riera
December 15th, 2007, 09:19 PM
I am also having this problem, when I refresh or close the page on safari flash will trow the Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error. error and crashes safar for me :S

As anyone got the solution for this?

rolynbsly
January 22nd, 2008, 11:55 AM
I'm not sure if they is related at all but i'm getting an error while streaming, however it only happens whenever I close a window or refresh a page.

Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error.
at com.player::SoundController/PlayPodcast()
at com.player::Playlist/::doubleClickItem()

I've tried creating a listener that closes the sound on that event, however it doesn't stop the error message. Has anyone else come across this?

You need to add an error event handler (the handler doesn't have to do anything, but it must exist):

snd_foo.addEventListener(IOErrorEvent.IO_ERROR, fn_error_handler);

poemadesign
January 8th, 2009, 07:03 PM
try{ sound.close(); }
catch(e:Error){ /**/ };

why close:
Safari crashes when you where trying to get the mp3 and it never started receiving the mp3. so the stream was open and Safari crashes for some reason.

As soon as the file starts buffering this error is deprecated

Pithikos
November 27th, 2009, 08:00 AM
I have been having this error message 2 days now but I finally found the solution and it's really simple in fact.
The code is right! The problem has to do with the mp3 file.
You just have to put the .mp3 file not only in the source folder BUT ALSO in the folder where your compiled file(which is the .swf) will be.

So for example if the code is this:

var soundFile:URLRequest = new URLRequest("caravan.mp3");
var song:Sound = new Sound();
song.load(soundFile);
song.play();

Then you should place caravan.mp3 in the same folder where the ending .swf is going to be.

If you work with FlashDevelop then that would be in the bin folder.
Hope this helped :ko: