Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
465 views
in Technique[技术] by (71.8m points)

java - How to read MP3 file tags

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.

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). :)

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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...

UPDATE:

ID3v1 Implementation

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

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...