Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 stackoverflow.com 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 stackoverflow.com/questions/2729824/… 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) stackoverflow.com/questions/62618/… 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
add comment

3 Answers

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
add comment

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
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.