Groups | Blog | Home
all groups > flash actionscript > april 2007 >

flash actionscript : how do you time when 2nd mp3 starts playing


charlestrent
4/27/2007 9:16:47 PM
I have a client who built a Java app to compose music tracks. They have mp3
files broken down into segments (intro, verse, chorus, turnaround, etc) that
the user can piece together to form complete songs.
My job is to find a way to preview their selections in a Flash player. Their
Java app does a great job at building the composed mp3's, but they still need a
way to preview their selections when the user is composing.

So far I've been unable to get the mp3's to playback seamlessly. I've tried to
preload progressive downloads and I've tried streaming. I can get the mp3's to
preload but I can't get the player to play them without a pause.

Any ideas?
SymTsb
4/27/2007 10:03:05 PM
I don't think Flash is the way to go here. I'd stick with Java and if
necessary look at a 3rd party sound tool for Java's API.

In order for Flash to play the sound like you want, you need Java to have
created a temp file of the current composition. This file would not be a break
down of the individual parts but a rastered final of the current state of the
comp. If you can get it this far, my question would be why would you need
Flash? If Java can raster the separate tracks together, why can't you save the
comp into memory and build a sound player in Java that previews the selection?

Is there more to the project that you aren't explaining?
charlestrent
4/27/2007 10:24:33 PM
you're right, Java is the way to go. The Java application they've created does
a great job at producing the final mp3 file.

The probem is that they are in the process of loading the Java app on Akamai's
server and can't have it ready for a demo next week.
I talked to another Flash developer that said you can start mp3 B for mp3 A is
finished playing. If I can get the timing down I might be able to make this
work.

Do you know how to start mp3 B before mp3 A is finished playing?
daganev1
4/27/2007 10:47:17 PM
use mySound.duration and mySound.position

When mySound.position > msound.duration - 10 then do
loadSound(mySound2)

You will have to use setInterval or Onenterframe for this, as I don't think
the sound has any events outside of completion.
charlestrent
4/27/2007 10:59:23 PM
thanks for the help

AddThis Social Bookmark Button