3

I have a bunch of MP3 files and I have their paths grouped in a text file. Is it possible to join the relevant MP3 files based on the paths in the text file?

5

One possible approach would be to use cat:

$ cat example1 example 2 > output

or

$ cat example* > output

This will join any two files together - not sure what it will do to the ID3 metadata though.

  • This produces non standard MP3 files, i.e. the ID3 tags are getting ruined. How do I correct the tags after using this method? – oshirowanen Oct 24 '10 at 14:11
  • You would need to remove all metadata before catting. – Oli Oct 24 '10 at 14:11
  • How do you remove all the meta data? – oshirowanen Oct 30 '10 at 6:19
1

There are at least a couple of tool: mpgtx and quelcom.

You can see their descriptions through any package manager, for example:

apt-cache show mpgtx quelcom
  • I can't seem to figure out how to use these. I have tried man, but there is not example usage section. – oshirowanen Oct 24 '10 at 10:22
  • qmp3join: manpages.ubuntu.com/manpages/lucid/man1/qmp3join.1.html Basic usage is: qmp3join -o output.mp3 file1 file2... It should be possible to automate the list of files based on the text file. – Jonathon Oct 24 '10 at 11:33
  • @Jonathon: (IFS=$'\n'; qmp3join -o output.mp3 $(cat list.txt)) will pass each line of list.txt as a parameter. ($'' is bash syntax, but you can do the same in other shells.) The IFS change is necessary for any filenames that might contain spaces (which is common for music), otherwise it's not needed. – Roger Pate Oct 24 '10 at 22:20
  • @Roger Pate: $(), without double quotes, already removes newlines, and cat is not needed: qmp3join -o output.mp3 $(< list.txt) – enzotib Oct 25 '10 at 5:43
  • @enzotib: As I said, the change in IFS is necessary with a list.txt that contains one filename per line and where the filenames contain spaces. Using cat or < is just personal preference here. – Roger Pate Oct 25 '10 at 6:33
1

I personally liked mp3wrap because it is more powerful and the size of the final file is three times less then the file merged with cat command.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.