ID3v1 태그는 파일의 마지막 128 바이트에 저장됩니다. 처음 세 바이트는 파일에 태그가 저장되어 있음을 알리는 "TAG"입니다. 먼저 파일에 태그가 있는지 확인한 다음 읽습니다.
먼저,해야 내가 VB 몰라하지만 난 프레임을 읽기 전에 생각 :
- 열고 파일
Dim objMP3V1 As New MP3ID3v1("file_path")
- 테스트, 파일이
objMP3V1.TagExists
플래그 경우 테스트하여에 바람 쐬 태그가있는 경우 그렇다면
- 필드/프레임을 읽으십시오.
편집
링크의 코드는 태그가없는 경우
FileGet(intFile, strTag, lngLOF - 127, True)
If (strTag.ToUpper <> "TAG") Then
' No ID3v1 tag found
mblnTagExists = False
mobjFrame(0) = ""
mobjFrame(1) = ""
mobjFrame(2) = ""
mobjFrame(3) = ""
mobjFrame(4) = ""
mobjFrame(5) = ""
mobjFrame(6) = ""
Else
' ID3v1 tag found
mblnTagExists = True
' Read all frames from the file
FileGet(intFile, strTitle)
FileGet(intFile, strArtist)
FileGet(intFile, strAlbum)
FileGet(intFile, strYear)
FileGet(intFile, strComment)
FileGet(intFile, bytDummy)
FileGet(intFile, bytTrack)
FileGet(intFile, bytGenre)
' Assign the frame content to the properties
mobjFrame(0) = strTitle
mobjFrame(1) = strArtist
mobjFrame(2) = strAlbum
mobjFrame(3) = strYear
mobjFrame(4) = bytTrack
mobjFrame(5) = strComment
mobjFrame(6) = bytGenre
End If
End If
그래서, 다음은 ""
문자열로 지정해야한다고 말했습니다. album
필드에 아무런 문자열 다음, 즉, 널 문자 '\0'
포함될 필드의 제 1 위치는 그러므로 그것이를 반환하는 NUM 문자열을 포함한다 없다 그래서 만약
쐬 필드는 고정 길이이다 null 문자열 ""
. ID3v1 태그가있는 샘플 음악 파일에서이 내용을 확인하라고합니다. ID3v1로 포맷 된 텍스트 파일을 만들어 테스트 할 수도 있습니다.
+1 또한 동일한 질문이 있습니다 – Predator
링크 된 코드는 매우 서투른 부분입니다. Use album.Trim() = ""Then –