...oppure usando le sole funzioni di Gambas anche in quest'altro modo (oltre quello di
Public Sub Main()
Dim percorsoFile, s, tag As String
Dim ordo As New Integer[]
Dim j, rm, k As Integer
percorsoFile = "/percorso/del/file.mp3"
s = File.Load(percorsoFile)
Print "File audio mp3: '"; File.Name(percorsoFile); "'"
Print "\nDimensione: "; Len(s); " byte"
ordo.add(InStr(s, "TALB"))
ordo.add(InStr(s, "TCOM"))
ordo.add(InStr(s, "TCOP"))
ordo.add(InStr(s, "TDAT"))
ordo.add(InStr(s, "TDEN"))
ordo.add(InStr(s, "TDLY"))
ordo.add(InStr(s, "TDRC"))
ordo.add(InStr(s, "TENC"))
ordo.add(InStr(s, "TFLP"))
ordo.add(InStr(s, "TIT1"))
ordo.add(InStr(s, "TIT2"))
ordo.add(InStr(s, "TIT3"))
ordo.add(InStr(s, "TKEY"))
ordo.add(InStr(s, "TLAN"))
ordo.add(InStr(s, "TLEN"))
ordo.add(InStr(s, "TMCL"))
ordo.add(InStr(s, "TMED"))
ordo.add(InStr(s, "TOAL"))
ordo.add(InStr(s, "TOFN"))
ordo.add(InStr(s, "TOLY"))
ordo.add(InStr(s, "TOPE"))
ordo.add(InStr(s, "TORY"))
ordo.add(InStr(s, "TOWN"))
ordo.add(InStr(s, "TPE1"))
ordo.add(InStr(s, "TPE2"))
ordo.add(InStr(s, "TPE3"))
ordo.add(InStr(s, "TPE4"))
ordo.add(InStr(s, "TPUB"))
ordo.add(InStr(s, "TCON"))
ordo.add(InStr(s, "TDRC"))
ordo.add(InStr(s, "TRCK"))
ordo.add(InStr(s, "TRDA"))
ordo.add(InStr(s, "TRSN"))
ordo.add(InStr(s, "TRSO"))
ordo.add(InStr(s, "TSRC"))
ordo.add(InStr(s, "TSSE"))
ordo.add(InStr(s, "TYER"))
ordo.add(InStr(s, "TXXX"))
ordo.add(RInStr(s, "TXXX"))
ordo.add(InStr(s, "COMM"))
ordo.add(InStr(s, "PRIV"))
ordo.add(RInStr(s, "PRIV"))
ordo.add(RInStr(s, "WXXX"))
While j < ordo.Count
If ordo[j] = 0 Then
ordo.Remove(j)
Inc rm
Dec j
Endif
Inc j
Wend
ordo.Sort()
Print "\n == T A G =="
If ordo.Count > 0 Then ' Se è presente almeno un TAG
For j = 0 To ordo.Max
k = ordo[j]
While k < ordo[ordo.max] + 24
If j < ordo.Max Then
' Verifica che il carattere ASCII sia una lettera o un numero oppure un segno di punteggiatura:
If (k < ordo[j + 1]) And ((IsLetter(Mid(s, k, 1))) Or (IsDigit(Mid(s, k, 1))) Or (IsPunct(Mid(s, k, 1)))) Then
tag &= Mid(s, k, 1)
Else
tag &= " "
Endif
Else
' Verifica che il carattere ASCII sia una lettera o un numero oppure un segno di punteggiatura:
If ((IsLetter(Mid(s, k, 1))) Or (IsDigit(Mid(s, k, 1))) Or (IsPunct(Mid(s, k, 1)))) Then
tag &= Mid(s, k, 1)
Else
tag &= " "
Endif
Endif
Inc k
Wend
If (Left(tag, 4) <> "PRIV") And (InStr(tag, "PRIV") > 0) Then tag = Left(tag, InStr(tag, "PRIV") - 1)
Print tag
tag = Null
Next
Else
Print "Assenti !"
Endif
End