loadSound, Streaming & Looping?!
- Started
- Last post
- 18 Responses
- ********
Hi,
How do I load a external mp3 into an swf file *and* get it to loop infintely??Heres what I tried but doesnt work.
mysound = new Sound();
mysound.loadSound("sound.mp3", true);
mysound.start(0, 999);The problem is that the "mysound.start" seems to only work when you attach a sound within your library, but not when you "load" the sound from outside the swf.
PLEASE HELP! Thanks a lot!
marc
- Bio0
import your mp3 into a new movie, then set it to stream, then add frames til you see the end of the loop.
then add an actio that sends it back to the beginning.
there are really a couple of ways to do it, but this is the easiest really.
- Bio0
oh, and then you load THAT .swf and it will do its own thing while the rest of your movie plays.
- ********0
Thanks a lot Bio,
Another question, about your solution, does it slow down the speed of your main swf in any way?
Do you think this is the best way to do it? (it's the easiest, but is it the best ? :)
THANKS in advance.
Marc
- Bio0
ive never had a problem with it slowing down my movies, but then i always keep my frame rate the same. never tried to mix and match framerates like that. probably not a good idea though.
as for the BEST way... well, i am sure that there is probably a better way to do it using only action script, but i wouldnt know.
it is the best way that http://I know how. someone else may have a better solution though. so
BUMP!anyone else know a better way?
- ********0
Thanks Bio you da man, I'm gonna try this out now, and will get back to you...
brb
- Bio0
rockin.
- londonBoy0
"mysound = new Sound();
mysound.loadSound("sound.
mp3", true);
mysound.start(0, 999);
"adapt this to:
mysound = new Sound();
mysound.loadSound("sound.
mp3", true);
mysound.onSoundComplete = function() {
mysound.start(0, 999);
}
- ********0
Hi Bio and Londonboy,
Like I said I'd get back to you.
Londonboy's script works the best because it allows me to control the volume more easily and change the soundtrack very easily at a later stage. So Bio, check out his script cos I reckon it's the best (but thanks a mil for repsonding :)
When the site goes live I'll be mailing you!Thanks for the help!
Marc
- ok_static0
Working on the new TEX mate?
- ********0
Yep, nearly there, just doing the really fun bit... audio!
Hows it going? And when's the album coming out?! :-)
- Bio0
anytime man.
i will defiitly be ckecking out that script.
so you dont need to export as swf? how does it work as far as load time? i will check it out some more when i get home. i dont have flash on this machine.
oh, and do send me a link when you are done!
good luck! =)
eric
- ********0
Londonboy, hope you are still around! It works with a short duration loop, but my loop is about 2 minutes long, soon as I use the 2 minute loop it doesnt loop again. The mp3 file is legal (ie it isnt using VBR encoding or something that flash doesnt understand)
Do you know what I could do to fix this?
The file size of the mp3 is about 800k.Thanks in advance!
m
- ********0
Yeah Bio I have put you on for the launch emailer (dont worry i wont be spamming anyone, just for the launch!)
But now i got a problem with it again, so hang on... might just have to use the good old "loadmovie" version...m
- Bio0
hmm...
what did you use to make the mp3 and do you still have it in .wav format?i will be home in a bit and can convert the wav file to a useable mp3 file if you need. if you use MSN messenger or trillian, then you can transfer the file thru that.
if you do need to, my msn info is:
also if you need anything else, it is best to shoot me email there instead of the email address i have on this screen name.i will be home and online in 30 minutes.
- londonBoy0
quote="Londonboy, hope you are still around! It works with a short duration loop, but my loop is about 2 minutes long, soon as I use the 2 minute loop it doesnt loop again. The mp3 file is legal (ie it isnt using VBR encoding or something that flash doesnt understand)
Do you know what I could do to fix this?
The file size of the mp3 is about 800k.
"http://www.lesliequarcoopome.co.…
I've just done this and it works fine: the mp3 file is over 900k and 1 minute in length. Seems to loop ok for me.
- ********0
hi london boy, gonna check this out know... just wanna say thanks for the help and going out the way for a stranger, i really appreciate it man!
Will be getting back to you zoon,
marc
- ********0
London boy, you are DA MAN!
Bio, you are also still DA MAN.
Thanks a lot and I'll be mailing you when the site is live (Monday)Thanks again,
Marcps (the reason why it didnt appear to work was cos i didnt realise i had to test it live on my site, you learn something new everyday)
- ********0
forget all that shit, stop using .mp3 with Flash, like now, now and never go back if you are looking to loop something. It's funny I just developed this baby site at http://www.machnewmedia.com/loop… and you can see the loops, not done yet, but all you really need is .WAV files. Flash MX compresses them much better and their quality is much better too.