如何阅读MP3文件标签 [英] How to read MP3 file tags

查看:137
本文介绍了如何阅读MP3文件标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要一个从MP3文件中读取元数据的程序。我的程序还应该能够编辑这些元数据。我能做什么?

I want to have a program that reads metadata from an MP3 file. My program should also able to edit these metadata. What can I do?

我要搜索一些开源代码。但他们有代码;但是我的工作不是简化的想法。

I got to search out for some open source code. But they have code; but not simplified idea for my job they are going to do.

当我进一步阅读时,我发现元数据存储在MP3文件中。但是我还不能完全了解我的宝宝计划。

When I read further I found the metadata is stored in the MP3 file itself. But I am yet not able to make a full idea of my baby program.

任何帮助都将受到赞赏;有一个程序或非常的想法(如算法)。 :)

Any help will be appreciated; with a program or very idea (like an algorithm). :)

推荐答案

mp3文件的最后128个字节包含有关mp3文件的元数据。,你可以写一个程序到读取最后128个字节......

The last 128 bytes of a mp3 file contains meta data about the mp3 file., You can write a program to read the last 128 bytes...

更新:

ID3v1实施

信息存储在MP3的最后128个字节中。 Tag
有以下字段,这里给出的偏移量来自
0-127。

The Information is stored in the last 128 bytes of an MP3. The Tag has got the following fields, and the offsets given here, are from 0-127.

 Field      Length    Offsets
 Tag        3           0-2
 Songname   30          3-32
 Artist     30         33-62
 Album      30         63-92
 Year       4          93-96
 Comment    30         97-126
 Genre      1           127

警告 - 这只是获取元数据的一种丑陋方式,它可能实际上并不存在,因为世界已经转向id3v2。 id3v1实际上已经过时了。 Id3v2比这更复杂,所以理想情况下你应该使用现有的库来读取mp3中的id3v2数据。把它放在那里。

WARINING- This is just an ugly way of getting metadata and it might not actually be there because the world has moved to id3v2. id3v1 is actually obsolete. Id3v2 is more complex than this, so ideally you should use existing libraries to read id3v2 data from mp3s . Just putting this out there.

这篇关于如何阅读MP3文件标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆