PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → Reading ID3 tag of mp3 file
Reading ID3 tag of mp3 file
Iniciado por guest, 19,dic. 2015 13:45 - 3 respuestas
Publicado el 19,diciembre 2015 - 13:45
Hello,

I asked this question already a few years ago, but still got no answer that helps my needs.
I want to read the ID3 tag of an mp3 file (Title, Artist, Year, Genre, duration, etc) Because I want to store this in my database programmatically.

Is there a way to do this? It has to be a general way, that means it has to work with every mp3.

TIA

Wilfried
Publicado el 19,diciembre 2015 - 22:51
Hello Wilfried,

there is an example doing that in LST 69.
http://www.pcsoft.fr/lst/Last/lst69.htm

You can order old number of the lst from pcsoft web site

Best regards
Publicado el 23,diciembre 2015 - 17:30
Publicado el 10,septiembre 2016 - 01:37
I got the tags with the following code.

IF sMp3 ~= "" THEN RETURN
IF fFileExist(sMp3) = False THEN RETURN
sHead is ANSI string
iFileID is int = fOpen(sMp3,foRead)
fSeek(iFileID,0,fpBeginning)
sHead = fReadLine(iFileID)
fClose(iFileID)
IF NOT sHead [= "ID3" THEN RETURN
iIni is int = Position(sHead,"TIT2",0) + 4
iFin is int = Position(sHead,"COMM",iIni)
stcTAGS_SONG.Title = NoSpace(Middle(sHead,iIni,iFin-iIni))