USUÁRIO:      SENHA:        SALVAR LOGIN ?    Adicione o VBWEB na sua lista de favoritos   Fale conosco 

 

  Dicas

  Visual Basic    (Imagem/Som/Multimídia)

Título da Dica:  Editando Tags do arquivo MP3
Postada em 11/4/2002 por Xande            
Attribute VB_Name = "modMp3Tags"
Public matrix

Type Mp3Tag
    Songname As String * 30
    Artist As String * 30
    Album As String * 30
    YearX As String * 4
    Comment As String * 30
    CodGenre As String * 1
    Genre As String
End Type
Public Function ReadTag(FileName As String) As Mp3Tag
Dim HasTag As Boolean
Dim Songname As String * 30
Dim Artist As String * 30
Dim Album As String * 30
Dim YearX As String * 4
Dim Comment As String * 30
Dim Genre1 As String * 1
Dim Genre As String
Dim Tag As String * 3

Open FileName For Binary As #1
    Get #1, FileLen(FileName) - 127, Tag
        If Not Tag = "TAG" Then
        Close #1
        HasTag = False
    Exit Function
End If

HasTag = True

Get #1, , ReadTag.Songname
Get #1, , ReadTag.Artist
Get #1, , ReadTag.Album
Get #1, , ReadTag.YearX
Get #1, , ReadTag.Comment
Get #1, , ReadTag.CodGenre
Close #1

CarregaEstilos

If Asc(ReadTag.CodGenre) < 148 Then
    ReadTag.Genre = matrix(Asc(ReadTag.CodGenre))
Else
    ReadTag.Genre = "Unknown"
End If

End Function

Public Function WriteTag(FileName As String, TagInfo As Mp3Tag) As Boolean
On Error GoTo hell

Open FileName For Binary Access Write As #1
Seek #1, FileLen(FileName) - 127

Put #1, , "TAG"
Put #1, , TagInfo.Songname
Put #1, , TagInfo.Artist
Put #1, , TagInfo.Album
Put #1, , TagInfo.YearX
Put #1, , TagInfo.Comment
Put #1, , TagInfo.CodGenre
Close #1

WriteTag = True
Exit Function
hell:
    WriteTag = False
End Function

Public Function DeleteTag(FileName As String)
blank = String$(127, 0)
Open FileName For Binary Access Write As #1
Seek #1, LOF(1) - 127
Put #1, , blank
Close #1
End Function

Public Function CarregaEstilos()
matrix = Array("Blues", "Classic Rock", "Country", "Dance", "Disco", "Funk", "Grunge", _
"Hip -Hop", "Jazz", "Metal", "New Age", "Oldies", "Other", "Pop", "R&b", "Rap", "Reggae", _
"Rock", "Techno", "Industrial", "Alternative", "Ska", "Death Metal", "Pranks", _
"Soundtrack", "Euro -Techno", "Ambient", "Trip -Hop", "Vocal", "Jazz Funk", "Fusion", _
"Trance", "Classical", "Instrumental", "Acid", "House", "Game", "Sound Clip", "Gospel", _
"Noise", "AlternRock", "Bass", "Soul", "Punk", "Space", "Meditative", "Instrumental Pop", _
"Instrumental Rock", "Ethnic", "Gothic", "Darkwave", "Techno -Industrial", "Electronic", _
"Pop -Folk", "Eurodance", "Dream", "Southern Rock", "Comedy", "Cult", "Gangsta", "Top 40", _
"Christian Rap", "Pop/Funk", "Jungle", "Native American", "Cabaret", "New Wave", _
"Psychadelic", "Rave", "Showtunes", "Trailer", "Lo -Fi", "Tribal", "Acid Punk", "Acid Jazz", _
"Polka", "Retro", "Musical", "Rock & Roll", "Hard Rock", "Folk", "Folk/Rock", "National Folk", _
"Swing", "Bebob", "Latin", "Revival", "Celtic", "Bluegrass", "Avantgarde", "Gothic Rock", _
"Progressive Rock", "Psychedelic Rock", "Symphonic Rock", "Slow Rock", "Big Band", "Chorus", _
"Easy Listening", "Acoustic", "Humour", "Speech", "Chanson", "Opera", "Chamber Music", "Sonata", _
"Symphony", "Booty Bass", "Primus", "Porn Groove", "Satire", "Slow Jam", "Club", "Tango", "Samba", "Folklore")
End Function
 


CyberWEB Network Ltda.    © Copyright 2000-2024   -   Todos os direitos reservados.
Powered by HostingZone - A melhor hospedagem para seu site
Topo da página