简体   繁体   中英

Merging Multiple .mp3 files

On mac/linux there is a command to merge mp3 files together which is

cat file1.mp3 file2.mp3 > newfile.mp3

I was wondering if there is a simpler way or command to select multiple mp3's in a folder and output it as a single file?

The find command would work. In this example I produce a sorted list of *.mp3 files in the current directory, cat the file and append it to the output file called out

find . -maxdepth 1 -type f -name '*.mp3' -print0 |
  sort -z |
  xargs -0 cat -- >>out

I should warn you though. If your mp3 files have id3 headers in them then simply appending the files is not a good way to go because the headers are going to wind up littered in the file. There are some tools that manage this much better. http://mp3wrap.sourceforge.net/ for example.

You can use mp3cat by Darren Mulholland available at https://darrenmulholland.com/dev/mp3cat.html

Source is available at https://github.com/dmulholland/mp3cat

simply linking files together won't work. Don't forget modern Mp3 files have metadata in the head. Even if you don't care about the player name, album name etc, you should at least make the "end of file" mark correct.

Better use some tools like http://mulholland.xyz/dev/mp3cat/ .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM