vb如何用MMControl获取mp3的信息?
发布网友
发布时间:2024-10-24 13:01
我来回答
共1个回答
热心网友
时间:2024-11-12 14:54
'这里是用的直接读取mp3文件的方法
'这里没有处理数据,请自行处理
Private Type TagInfo'mp3的ID3v1,如不懂请查看相关信息
Tag As String * 3
Songname As String * 30
artist As String * 30
album As String * 30
pyear As String * 4
comment As String * 28
reserve As String * 1
track As String * 1
genre As Byte
End Type
Dim FileName As String
Dim CurrentTag As TagInfo'mp3的文件信息存储在这个变量中
Private Sub Command1_Click()'用一个按钮来处理
Dim temp As Byte
On Error Resume Next
Dim flTag As Long
FileName = "d:\1.mp3"'具体的文件自己修改
Open FileName For Binary As #1
With CurrentTag
flTag = FileLen(FileName) - 127
Get #1, flTag, .Tag
If Not .Tag = "TAG" Then
Label1.Caption = "No tag"
Close #1
Exit Sub
End If
Get #1, flTag + 3, .Songname
Get #1, flTag + 33, .artist
Get #1, flTag + 63, .album
Get #1, flTag + 93, .pyear
Get #1, flTag + 97, .comment
Get #1, flTag + 127, .genre
Close #1
End With
End Sub