PDA

View Full Version : Streaming .mp3s (MX 2004)



Max_Current
07-27-2006, 10:27 PM
Hi guys,

I've got a flash that has around 10, 30sec .mp3 files. The problem is it's taking too long to load. I can't use a pre-load because of the format it's being presented in.

The .mp3 are currently stored in the library. Would streaming them from a server make the flash load quicker?

If so, how would I stream .mp3s in flash (sorry, I'm an almost total Flash Newbie)? It idea is simply press a button and the music plays...

Thanks for your help,

Max

BLiZZaRD
07-27-2006, 11:25 PM
What you want to do is stream the mp3's from an external source.

use soundobject.loadSound("urlto.mp3",true) to "stream", which plays as it loads, not packet streaming like winamp.

You can use the onSoundComplete event to execute code when flash finishes playing a sound.

or if you are using continuous play, load on exit, etc you can use something like:



my_sound = new Sound(this);
my_sound.loadSound("http://www.MYSITE.com/SUBFOLDER/SONG.mp3",true);


Trying to load that many files with the movie is going to take forever... although I haven't seen a format where you couldn't use a preloader.

You can always use a preloader, even if it loads an external swf, the preloader doesn't have to be inside the loading swf :)

queerfm
07-30-2006, 07:24 PM
can we play shoutcast audio in flash this is live radio.

it is a .pls file but you don't have to put in listen.pls as long as you have the ip and port number is possible

BLiZZaRD
07-31-2006, 10:01 AM
Yes, you will have to rename the shoutcast pls to m3u though.

so your url would go from: www.myshoutcast.doh:8000/listen.pls

to: www.myshoutcast.doh:8000/listen.m3u

Also note that Flash will not stream this for you, you will need to embed another media program like winamp.