MP3 compare tool

Stephen R Laniel steve at laniels.org
Sun Jul 10 15:31:56 UTC 2005


On Sun, Jul 10, 2005 at 05:19:55PM +0200, Thomas Kaiser wrote:
> Is there a tool in the Linux world to compare MP3s?
> 
> I would like to find the duplicate files and decide on the ID3 tags and 
> quality which one I delete.

Well, as a start just use the 'cmp' utility, which compares
*any* file to any other file. Type 'man 1 cmp' at any
command line. You just do

cmp file1 file2

If there are no differences, cmp prints nothing to the
command line. If there are differences, it tells you the
first byte where they differ.

Once you've established which ones are different, you can
then use a tool like 'mp3info' to look at the rates of
encoding, metadata, etc.

Actually, come to think of it, cmp probably wouldn't be the
best approach, because you'd have to do some nastiness like
so:

for i in *.mp3; do
	for j in *.mp3; do
		cmp $i $j
		[some other stuff]
	done
done

This has running time n^2, where n is the number of files
you're comparing. So I think instead you'll want to use the
md5sum tool, which computes an MD5 checksum for every file
you tell it to check. Then you save the MD5 checksums to a
file, and compare checksums to see which ones are identical.

-- 
Stephen R. Laniel
steve at laniels.org
+(617) 308-5571
http://laniels.org/
PGP key: http://laniels.org/slaniel.key
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20050710/69b946d2/attachment.sig>


More information about the ubuntu-users mailing list