Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Suppose, I have ten MP3s in a directory and I want to combined them in to one MP3. The end result should be one MP3 with the content of the original ten MP3s. Is there a PHP or Java program, app, or snippet for this?

share|improve this question

migrated from Jun 18 '11 at 1:16

This question came from our site for professional and enthusiast programmers.

Merging two mp3s can be as simple as just pasting the two files together. MP3s don't strictly have a "file structure", just a series of MP3 audio frames that are strung together. Once you eliminate wrapper formats (.wav) and meta information (id3v1/v2), just paste what's left together and off you go. – Marc B Jun 17 '11 at 18:51
This is a badly written question but to answer what the question asks for, one would have to find a program written in php or java that does it. Thus far no answer does that. Calling a program externally is cheating. SO people normally don't just look for fully written programs. and SU people don't search for programs written in particular languages.Anyhow,here is a SO answer on how to DIY in java… and here's one about disadvantages in using copy /b the reason may apply to some other methods – barlop Jun 18 '11 at 3:53
misleading subject – barlop Jun 18 '11 at 3:53
on disadvantages of copy /b on mp3s (and this may apply to some other methods too)… but i've done copy /b many times and it's good enough for most people. it plays fine. – barlop Jun 18 '11 at 3:53

You can use the PHP exec() function to call ffmpeg (for movies) or lame (for mp3s)

share|improve this answer

By searching a bit, I found this excellently relevant response to a question similar to yours.

As konsolenfreddy suggested, if you wish to use PHP, use the exec() function in conjunction with the code presented in the post.

share|improve this answer

You can try Audacity for splicing audio files, and you can try Avidemux for you video editing needs. Both programs are free, and available for Windows, Linux or Mac whichever you were looking for.

share|improve this answer
his subject wasn't clear and he's still not clear, but he's talking about java or php. it's his fault. – barlop Jun 18 '11 at 3:44

You must log in to answer this question.