in reply to Joing two mp3 files into one

Incidentally the MP3 file format is designed so that it should be possible to concatenate files by simply writing one after the other; players must skip frames they can't process so they'd just ignore the intervening header. However, this only works if the encoding is exactly the same regarding sample rate, bps and $DEITY knows what else, so in practice it usually doesn't. Unless it's really necessary to do it in Perl, I'd second ww in recommending some external audio editor such as SOX.

Replies are listed 'Best First'.
Re^2: Joing two mp3 files into one
by simplitia1 (Initiate) on Jun 07, 2012 at 17:34 UTC
    Thanks monks! this is correct - the only way to combined the files was to completely re-encode each mp3 with audacity. I even tried using a MP3::Tag to strip away existing tags but it was not enough. The only way is to re-encode, then the joining works. After encoding it was just simply opening each of the files, binmode both filehandle, binmode output filehandle and writing it the new file. thanks again. AL

      There is a command-line utility called mp3cat which you should be able to compile on most *nix systems. If you have to do this very often, it may be much faster than firing up a GUI program to re-encode the files.

      Aaron B.
      Available for small or large Perl jobs; see my home node.