dcsimg
A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Streaming sound in Flash

  1. #1
    True Life
    Join Date
    Aug 2001
    Location
    Amsterdam, Holland
    Posts
    85

    Streaming sound in Flash

    I have a question.
    For my new website I will use music (1 mp3 file). When the intro part of the song (about 5-10 sec.) plays I want to create a small intro in flash that's exactly as long as the intro in the song. Then, when the song starts, I want the full website to be visible in Flash. I know how to sync audio and visuals in Flash, but my question is about the music.
    For the whole sync playback of the intro and the transition when the actual song starts to work I will have to load in the music before the flashfile actually starts playing. Flash will need to load the intro part of the mp3 file and a small part of the song itself ahead and needs to stream the rest of the song after that (I don't want to load up the whole song since this would mean the site won't start after the full 2MB's are loaded )

    How do I make flash preload the first (let's say) 30 sec. of a MP3 and streams it after that?

    I hope everybody's understands my problem and can help me
    Watch out for my battlecolours:
    |Infradead and Ultra Violent|

  2. #2
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    Streaming means you dont have to preload.

    It is easier to sync everything if you have only one scene for the content that also includes the intro as you can have the music "hearable" in the timeline.
    The you can have a preload scene that just preloads the the graphics needed.

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  3. #3
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Interesting challenge! But I don't think this will be as easy as Pelle as put it, especially if you care about slow connected users.
    Do you care?

  4. #4
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,490
    If you import a mp3 to the library, then add it to a timeline layer, stretch it out the full length of the song, and set the sync to Stream, that song will play almost immediately, even on a Girbil powered modem. Do a test movie after doing that, and you will see the bytes spike for each frame is almost non-existant. This way works better than even loadSound, especially on slower connections and older computers.

  5. #5
    Musician/Sound Engineer
    Join Date
    Dec 2003
    Location
    AZ
    Posts
    252
    Slightly off topic here but...I have been trying for a long time to find a method that will allow proper sync of music and animation, WITH high sound quality. And just can't find anyway to make it happen. Yes, I've read all the best tutorials but non of the suggestions on sound will produce high quality AND proper sync.
    Aside from all other techniques, it still blows my mind that if you place a sound file in the timeline and make an animation to it, that it only sync's while streaming, which is totally unacceptable quality (in my ears). I don't think I will ever understand why, when it has to play right along with the animation layer...?
    Oh well, I'm still open for suggestions.


    Mike

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

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