Hi There,

I am building a online sequencer application (like garageband, logic, cubase etc), and I need a PHP script that will create the joined mp3s of all the tracks. I have done some very simple experiments, and I cant get it to work properly. I can get files to join one after the other (sort of!), but I need more flexibility.

In this system, it is HIGHLY likely that more than one sound is playing at the same time. Is it possible to use a PHP script to join mp3s ontop of each other, or can it only handle one at a time?

Thanks,

Steve

    It's completely possible. It's also a lot harder than you think, Essentially, you have to construct your own playback module that will decode the MP3 streams, mix them together, construct a resulting MP3 stream, and save it to a file.

    Honestly, I think PHP is probably not a good language to do that in.

    Your best bet is to find someone who has written an MP3 player (and knows how to decode MP3 streams), tell them what you want, and hire them to construct the online mixer you're looking for. Expect to pay somewhere in the range of $3000 - $10,000.

      etully,

      thanks for the reply. the sequencer is already built in flash, which will pass the PHP a "playlist" consisting of the names of the mp3 tracks and the times they need to be played. Sadly flash cant compile this as an MP3 to my knowledge...

      Does this change things? This is a student project so im not spending $3000+ on it!

        Flash can probably compile the resulting MP3 stream (with an enormous amount of work) but are you sure you need to? Can't Flash play more than one MP3 at a time? Or can't you place multiple Flash movies on the same page, each one playing it's own MP3? (And sync them up with Javascript).

        PHP doesn't have many multimedia capabilities so... ummm... Flash is far better suited for this job. I'm not saying I'm certain that Flash can do the job, but I know that trying to make PHP do the job is a huge step in the wrong direction.

          It looking more and more like I will have do abandon this part. The sequencer works perfectly in flash, playing as many sounds as it needs. I just wanted a way that people can download what they have made as an mp3. It was suggested that PHP might be able to do this (relatively) easily, however the evidence suggests otherwise...

            Ahh... I see. I misunderstood what you were attempting to do. I thought you were trying to find a way to play back the sounds simultaneously. You really are looking for a way to generate a new MP3 stream. And that is a difficult project in any language - and PHP would be even harder than others since it doesn't have any MP3 libraries.

              Googling around I found something called rezound. It's supposed to be scriptable and runnable from the command-line, so PHP ought to be able to control it through its shell command interface. I wouldn't know; I've never heard of it before a minute ago.

                Great. Thanks a lot WP. I was finally going to have a productive weekend... and now you have to go and distract me with this thing. Sheesh. Dynamically constructed MP3 files. Custom Podcasts. How freakin' cool is this?!?

                  Write a Reply...