Forum > Audio and Video

MP3 id3 tag v2

(1/4) > >>

P.curtis:
Does anyone have a working example of how to get MP3 tags. I'm interested in duration and title.
Thanks in advance.

winni:
Hi!

The implementation of Tags in version 2 a bunch of idiotic relations.
The only good solution I know is the tag plugin of BASS:

http://www.un4seen.com/

Tag V1 is simple.
I can search for my code if you need it.

Winni

Fred vS:
Hello.


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---var  F: file;   title, album, date, comment, tag : string;  genre : integer;  BufferTag: array[1..128] of char; ...  AssignFile(F, '/dirrectory/of/filename.mp3');    FileMode:=fmOpenRead + fmShareDenyNone;   Reset(F, 1);    Seek(F, FileSize(F) - 128);    BlockRead(F, BufferTag, SizeOf(BufferTag));    CloseFile(F);    title := copy(BufferTag, 4, 30);   artist := copy(BufferTag, 34, 30);   album := copy(BufferTag, 64, 30);   date :=  copy(BufferTag, 94, 4);  comment := copy(BufferTag, 98, 30);   tag :=  copy(BufferTag, 1, 3);   genre := ord(BufferTag[128]); 
For duration it is more tricky, you may use like wini said Bass.
And if you want a free open source solution, maybe take a look at uos.

lucamar:
See this thread:
Recomendations for audio metadata
Lots of recommendations there, though I ended up using a TProcess and parsing the output of soxi :)

@Fred vS: That will only work to retrieve v1 tags ... and doesn't even check whether they are there! Also it makes too many assumptions about the length and presence of each tag.

Fred vS:
@lucanar, afaik, a mp3 that has v2 (tag info at begin of file) has also v1 (tag info at end).

But yes, it can give the title but not the length.

uos does what you need.

Navigation

[0] Message Index

[#] Next page

Go to full version