独立于 ID3 标签访问 MP3 音频数据?
这是一个由两部分组成的问题。首先,是否可以独立于 ID3 标签来访问 MP3 中的音频数据,其次,是否有任何方法可以使用可用的库来做到这一点?
我最近整合了 3 台计算机的音乐收藏,最终得到的歌曲更改了 ID3 标签,但音频数据本身未修改。运行重复文件搜索失败,因为文件随 ID3 标签更改而更改,但我认为如果我只是使用音频数据运行重复数据删除进行比较,应该可以识别重复文件。
我知道可以寻找文件中 ID3 标头之后的特定位置,并直接读取数据,但想知道是否有一个库可以公开音频数据,这样我就可以提取数据,运行校验和它,并将计算结果存储在某处,然后查找相同的校验和。 (另外,当考虑到可变长度标头时,我可能必须使用某种库。)
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.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
巧合的是,前几天我也想做类似的事情。
这是我编写的 Ruby 脚本:
http: //code.google.com/p/kodebucket/source/browse/trunk/bin/mp3dump.rb
它将 mpeg 帧转储到标准输出,因此可以像这样获取校验和:
# mp3dump.rb文件.mp3 | md5和
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