Access MP3 audio data independently of ID3 tags?

老子叫甜甜 提交于 2019-12-13 08:07:28

问题


this is a 2 part question. First off, is it possible to access the audio data in an MP3 independently of the ID3 tags, and secondly, is there any way to do so using available libraries?

I recently consolidated my music collection from 3 computers and ended up with songs which had changed ID3 tags, but the audio data itself was unmodified. Running a search for duplicate files failed because the file changed with the ID3 tag change, but I think it should be possible to identify duplicate files if I just run a deduplication using the audio data for comparison.

I know that it's possible to seek to a particular position past the ID3 header in the file, and directly read the data, but was wondering if there's a library that would expose the audio data so I could just extract the data, run a checksum on it, and store the computed result somewhere, then look for identical checksums. (Also, I'd probably have to use some kind of library when you take into account variable length headers.)


回答1:


Coincidentally I wanted to do something similar the other day.

Here is a Ruby script that I whipped up:

http://code.google.com/p/kodebucket/source/browse/trunk/bin/mp3dump.rb

It dumps mpeg frames to stdout, so one could grab a checksum like so:

# mp3dump.rb file.mp3 | md5sum



来源:https://stackoverflow.com/questions/2933895/access-mp3-audio-data-independently-of-id3-tags

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!