Hello guys.
So, I'm trying to read the id3 tag from a mp3 file but I just don't know why I just can't read the track number info. Could you give me a help?
This link might help you to help me.Code:Dim Gens(125) As String Dim free As Integer Private Type TagInfo Tag As String * 3 NomeFaixa As String * 30 Artista As String * 30 Album As String * 30 Ano As String * 4 Comentario As String * 30 NFaixa As String * 2 Genero As String * 1 End Type Private Function Songinfo(filepath As String) Dim CurrentTag As TagInfo 'Get the song info Open filepath For Binary As #1 With CurrentTag Get #1, FileLen(filepath) - 127, .Tag Get #1, , .NomeFaixa Get #1, , .Artista Get #1, , .Album Get #1, , .Ano Get #1, , .Comentario Get #1, , .Genero Get #1, , .NFaixa txtTag.Text = .Tag txtSong.Text = RTrim(.NomeFaixa) txtArtist.Text = RTrim(.Artista) txtAlbum.Text = RTrim(.Album) txtAno.Text = RTrim(.Ano) txtComentario.Text = RTrim(.Comentario) txtGenero.Text = Gens(Asc(RTrim(.Genero))) txtNFaixa.Text = RTrim(.NFaixa) End With Close #1 End Function Private Sub Command1_Click() Songinfo ("D:\New Folder (2)\file.mp3") End Sub Private Sub Form_Load() Gens(0) = "Blues" Gens(1) = "Classic Rock" '... End Sub
Thank you and
Merry Christmas to everybody!




Reply With Quote