A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 29

Thread: Buffering Streaming Dynamicly Loaded mp3's?

  1. #1

    Buffering Streaming Dynamicly Loaded mp3's?

    Is it possible to buffer a set amount of seconds on a dynamicly loaded mp3 set to stream. Im not really a code junkie but I tried some code but to no avail. I'd like to stream the tracks in the jukebox but they sound like crud on a 56k. Is it even possible?

    Here's a link to the site im working on if anyone feels like checking it out.... www.inkdropdesign.com/btd

    PEACE,
    Drop

  2. #2
    muvipix.com
    Join Date
    May 2001
    Location
    Maine
    Posts
    289
    _soundbuftime=10;

    Flashes default is 5, so work with it until you get your desired result. It's not really seconds, but a formula derived by framerate of your movie.
    Regards,

    Ron

  3. #3
    thank you so much

    PEACE,
    Drop

  4. #4
    One more question regarding the buffering....

    I've made a movieclip that flashes BUFFERING that I want to play when the track is buffering...but i can get it to stop once the track begins to play...

    _soundbuftime=40

    is on my main timeline...and it seems to work.

    I attemped (forgive me if this seems pathetic)...

    if (_soundbuftime=0) {
    gotoAndStop(1);
    } else {
    play();
    }

    inside my bufferMC where frame one is empty and frame 2-5 has my flashing BUFFERING. Am I even remotely close?

    PEACE,
    Drop

  5. #5
    Senior Member flashPlaya's Avatar
    Join Date
    Sep 2001
    Location
    >>WESTSIDE<<
    Posts
    235

    building buffering music player

    I am trying to build the same kind of player but,( and i suck at action scripting) what i am doing is just loading swf with mps's in them, and they are huge. if you have any time i would love to see how you stream the files.

    thanks,

    ps here is the test i am built if you wnat to peep it http://ftp.brightdesign.com/studio1.swf just hit the text at the bottom.
    ////FLASHPLAYER//

    MY SITE>>

  6. #6
    -Iron Myk- mykrob's Avatar
    Join Date
    Dec 2001
    Location
    Jackson, TN
    Posts
    1,356
    hey, take a look at www.kennybellew.com for Flash sound object tutorials..
    he covers EVERYTHING!!!

    -myk
    -moo

  7. #7
    ...I am trying to build the same kind of player but,( and i suck at action scripting) what i am doing is just loading swf with mps's in them, and they are huge. if you have any time i would love to see how you stream the files.
    I have the stream figured out thanks to rhosk, but i wanna build a little buffering clip for it I know i could do it but the trial and error aspect of just trying crap out is starting to get annoying, but i love it. Once i get it figured out I'll send you a link.

    hey, take a look at www.kennybellew.com for Flash sound object tutorials..
    I did everyone of the tutorials on that site the other day. But he doesn't really cover streaming mp3's and thats what i really want to figure out right now. gotta show love to the non broadband folks out there too.


    PEACE,
    Drop

  8. #8
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    This page has streaming mp3's of over 1Meg each. Five of them load in a row, from an array, and the buttons in the soundpanel thing load the same songs separate if you click them. The first song is that voice thing, then the second one starts. The second song is 1.7 Meg, and from all the tests I've made on 56K, it starts playing in just a few seconds. Faster than loading them in a swf. Bad point is, you need to publish as F6.

    http://www.flashbax.com/slide_show.htm

  9. #9
    Senior Member flashPlaya's Avatar
    Join Date
    Sep 2001
    Location
    >>WESTSIDE<<
    Posts
    235

    can i see th e souce file on how you built it

    can i see the souce file on how you built it.

    this whole mp3 thing is killing me.
    ////FLASHPLAYER//

    MY SITE>>

  10. #10
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Ya, here's a cut down version with just the sound panel. The whole fla was too big for the forums. You have to supply 5 mp3's, starting with music0.mp3, music1.mp3, etc. up to music4.mp3. They have to be in the same folder, before this will work in test movie, and you need MX to open it.

    When you went to the link, did they start fast for you? I have dsl, so I have to ask my sister and friends to test it on 56K. LOL

    The mp3 thing is no biggee. You load them just like you load an external swf, except you use loadSound, instead of loadMovie. Or, you can use both. Here's a bit of code that does the same thing:

    Code:
    _root.onLoad = function() {
    	mySound = new Sound();
    	mySound.loadSound("music1.mp3", true);
    	mySound.setVolume(50);
    	mySound.onSoundComplete = function(){
    	loadMovie ("music2.mp3", "_root.placeholder");
    	mySound = new Sound();
    	mySound.loadSound("music2.mp3", true);
    	mySound.setVolume(50);
    	mySound.onSoundComplete = function(){
    	loadMovie ("music3.mp3", "_root.placeholder");
    	mySound = new Sound();
    	mySound.loadSound("music3.mp3", true);
    	mySound.setVolume(50);
    	mySound.onSoundComplete = function(){
    	loadMovie ("music4.mp3", "_root.placeholder");
    	mySound = new Sound();
    	mySound.loadSound("music4.mp3", true);
    	mySound.setVolume(50);
    	mySound.onSoundComplete = function(){
    	loadMovie ("music5.mp3", "_root.placeholder");
    	mySound = new Sound();
    	mySound.loadSound("music5.mp3", true);
    	mySound.setVolume(50);
    	}
    	}
    	}
    	}
    }
    Attached Files Attached Files
    Last edited by iaskwhy; 01-31-2003 at 09:10 PM.

  11. #11
    Senior Member flashPlaya's Avatar
    Join Date
    Sep 2001
    Location
    >>WESTSIDE<<
    Posts
    235

    Thank you

    i am going to ty to pl ay with this and see if i acan get it to work. you are the best
    ////FLASHPLAYER//

    MY SITE>>

  12. #12
    Senior Member flashPlaya's Avatar
    Join Date
    Sep 2001
    Location
    >>WESTSIDE<<
    Posts
    235

    Sorry, one more thing:0

    how can i dump this thing in a movieclip.

    cut and paste all the frames into a new movie, then change all the _roots but, no dice.


    you are saving me.


    Ryan
    ////FLASHPLAYER//

    MY SITE>>

  13. #13
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    All you really need is one frame. All those other frames are from stuff in the main movie that's not needed. The buttons and progress bar won't work loaded as an swf. I've tried it, but haven't worked out the code yet. That's not why I made it.

    If you just want to load and stream music, copy the code in my post above, and paste it into frame 1 of the actions layer. You need an empty clip onstage with the instance name of placeholder. Thats it.

    The fla, you can unlock all layers and drag a box around the whole banana to select it, then copy. Go over to your movie, and paste in place, on a new layer. While it's still selected, distribute to layers. Then copy the code and paste it into yours.
    Attached Files Attached Files

  14. #14
    Senior Member flashPlaya's Avatar
    Join Date
    Sep 2001
    Location
    >>WESTSIDE<<
    Posts
    235

    Thank You so much!!!!

    Hey,


    I have not had time to say thank you i have been play arouund with this player for a while.I have it working great on the ,ain time line, but as soon as i try to put it in a movie clip, it will not work. It would be great to manipulate this player to i could play with and not be so static.

    I really just wanted to thank you for everything. This has been the most helpful experience so far through flash kit.

    ////FLASHPLAYER//

    MY SITE>>

  15. #15
    Junior Member
    Join Date
    Feb 2003
    Posts
    19

    I am feeling your pain

    I have messed around with getting this mp3 to work it is not even funny. I want an mp3 to load as soon as the page come up. I know how to do it if I have a button, but can I add this line of code to the first frame in the movie: loadSound("music.mp3",true); and have it work? I have tried this a million time but no go. Does the MP3 need to be in the movie library?

  16. #16
    muvipix.com
    Join Date
    May 2001
    Location
    Maine
    Posts
    289
    Make sure you're setting up the sound object before you load. ie, mysound = new Sound();

    Then, when loading your mp3:
    mysound.loadsound(song.mp3, true);

    Should do it for ya'.
    Regards,

    Ron

  17. #17
    Junior Member
    Join Date
    Feb 2003
    Posts
    19
    man this is going to sound way stupid, but what do you mean by setting up the object??

  18. #18
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    If you just want to load a sound, use an empty movie clip to load it to. It can even sit way off the stage. Give it an instance name of placeholder and add this code to frame 1:

    _root.onLoad = function() {
    loadMovie ("mysongname.mp3", "_root.placeholder");
    mySound = new Sound();
    mySound.loadSound("mysongname.mp3", true);
    }

    There is a limitation with this way, the sound won't loop. It will play once, and that's it. Under the circumstances I use this, that doesn't matter.

    And no, no sound file has to be in the library. That's the whole point.

  19. #19
    Junior Member
    Join Date
    Feb 2003
    Posts
    19
    Ok I see what you are saying.... do i need to create a seperate function to play it as well. Maybe I am misunderstanding but the function will just load it correct?

  20. #20
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Try it.

    No, when you load a sound, it plays. You have to work at it to get it to NOT play when it loads.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center