Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
    
askubuntu.com/a/20514/18665 –  bmaupin Sep 3 '13 at 15:26

3 Answers 3

up vote 3 down vote accepted

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.

share|improve this answer
    
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

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
share|improve this answer
    
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

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.

share|improve this answer

Your Answer

 
discard

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

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