Here's a function for reading ID3v1 tags:
Function ReadID3v1Tag$(path$, tag%)
Local file% = ReadFile(path$), char%, result$ = "", bytes% = 0
If file%
SeekFile(file%, FileSize(path$) - 125)
Select tag%
Case 0
SeekFile(file%, FilePos(file%) - 3)
bytes% = 3
Case 1 ; Title
SeekFile(file%, FilePos(file%) + 0)
bytes% = 30
Case 2 ; Artist
SeekFile(file%, FilePos(file%) + 30)
bytes% = 30
Case 3 ; Album
SeekFile(file%, FilePos(file%) + 60)
bytes% = 30
Case 4 ; Year
SeekFile(file%, FilePos(file%) + 90)
bytes% = 4
Case 5 ; Comment
SeekFile(file%, FilePos(file%) + 94)
bytes% = 30
Case 6 ; Genre
SeekFile(file%, FilePos(file%) + 124)
bytes% = 1
End Select
For i = 0 To bytes% - 1
char% = ReadByte(file%)
If char% = 0 Then Exit
result$ = result$ + Chr(char%)
Next
CloseFile(file%)
Return result$
EndIf
End Function
If ID3v1 tags exist then ReadID3v1Tag$(path$, 0) = "TAG"
|