cs_PaTaTe
Messages postés2126Date d'inscriptionmercredi 21 août 2002StatutContributeurDernière intervention19 février 20212 30 nov. 2005 à 21:18
c'est vrai que le code posté n'est pas complet. Etant sur un autre projet, je n'ai pas beaucoup de temps pour y regarder. Si j'ai un moment, je creuserais :)
cs_titicar
Messages postés181Date d'inscriptionjeudi 30 mai 2002StatutMembreDernière intervention19 août 2012 30 nov. 2005 à 20:36
PaTaTe > Je suis tombé ici un peu par hasard. Merci pour ton module de Tag Ogg : il fonctionne chez moi (moyennant deux modifs dans le code!), avec le peu de fichier ogg que je possède.
Hélas, je n'ai pas trouvé beaucoup d'info sur le web quant aux différents champs conventionnés du Tag Ogg. Mais parmi les fichiers que je possède, j'ai trouvé quelques champs non pris en compte dans le module:
DISKNUMBER=, SOURCEMEDIA=, RIPPEDWITH=
Si quelqu'un a d'autres infos, merci de les partager.
@+ et bon prog!
cs_ricounet
Messages postés51Date d'inscriptionlundi 30 décembre 2002StatutMembreDernière intervention26 mars 2009 15 déc. 2004 à 12:43
Ben oui mais le calcul de la durée d'un MP3 est souvent fausse...
cs_PaTaTe
Messages postés2126Date d'inscriptionmercredi 21 août 2002StatutContributeurDernière intervention19 février 20212 23 juil. 2004 à 15:32
Yomm > Je sais que la source que j'ai fournis est loin de donner ce qu'il faut vraiement pour avoir toutes les infos "technique" d'un OGG mais je l'avais posté pour que tu est une base. En ce qui concerne les aspects technique ; du pourquoi et du comment ; j'avoue être un peu largué lol ... Cette source ne te convient peut être pas mais ceux qui lieront les posts trouveront peutêtre leur bonheur. Pour ce qui est des formats que tu pourrait supporter, j'ai quelques idées et je dois l'avouer je cherche déjà des infos :) ... des que je trouve quelque chose, je te MP
@++
yomm
Messages postés515Date d'inscriptiondimanche 17 février 2002StatutMembreDernière intervention10 mars 20083 23 juil. 2004 à 15:14
salut...
>>icarus
ayant fais un projet également orienté sur le tagging , je me suis senti un peu obligé de passé par là ;-)
ton appli a l'air intéressante, j'ai pa dl le source pour le moment, le ferai surement ce WE...
>>patate
merci de ton post ;-) ... je suis sur plusieur projet simultané et j'avais pas l'intention de me mettre à l'ogg tout de suite mais vu ke tu as l'air d'y tenir, je vais surement essayé de bosser de dessus...j'ai déjà trouvé kelkes infos intéressante...toutefois je pense ke je n'utiliserai pas le source ke tu nous a fourni en aide (nous = icarus et moi) car il ne m'embale pa...c'est sur k'il a l'air de marché mais bon si tu a regardé mon code tu doi surement comprendre ke c'est plutot en byte ke je cherche les zones etc....un truc notament ki m'oblige a ne pas utilisé ce code, c'est ke je n'ai aucune info sur le bitrate , la fréquence les cannaux etc...etc.. ce ki correspond au type TagMpeg de mon source actuel sur les tag mp3...j'ai par ailleurs déjà trouvé ce type d'info , la constitution du header en gros...enfin bref je vais voir comment gérer tout cela et surtout comment l'intégrer a ma class actuelle tout en concervant sa facilité d'utilisation....enfin voilà ...
pour conclure :
>>icarus :
bonne continuation et je te tiendrai au courant de ce ke je pense de ton source...car je ve pas faire ça dans la précipitation ;-)
>>patate :
je te tiendrai au courant de l'avancé du tagging ogg
@+
cs_icarus
Messages postés8Date d'inscriptionmercredi 21 août 2002StatutMembreDernière intervention20 juin 2005 22 juil. 2004 à 15:47
cs_PaTaTe
Messages postés2126Date d'inscriptionmercredi 21 août 2002StatutContributeurDernière intervention19 février 20212 22 juil. 2004 à 13:01
Personnellement je prefere la source de Yomm (meme si sa source ne gere ke le MP3, il le fait sans dependance de programme comme tu le fait apparement avec l'OGG.
L'explorateur de gauche est completement buggé chez moi kan je suis dans le poste de travail, g une erreur 63
Je te donné ici un code que j'avais donné a Yomm pour la gestion en lecture des tags OGG.
C/C
J'ai un code pour lire (et seuelement lire mais c un debut) les tag OGG. J'ai testé sur kelkes fichier que j'avais en ma poccession et j'ai pas eu de problème :)
modVorbis.bas
=========
Option Explicit
Public Type VorbisTag
Title As String
Artist As String
Album As String
Genre As String
Date As String
Comment As String
TrackNumber As Integer
EncodedUsing As String
Error As String
End Type
Public Function GetTag(Filename) As VorbisTag
Dim phase As Integer
Dim filelength As Long
Dim fileremaining As Long
Dim fileopened As Long
Dim filehandle As Integer
Dim errmsg As String
Dim tmp As Integer
Dim tmp4 As Integer
Dim tmp2 As Integer
Dim tmp3 As Integer
Dim foundatag As Boolean
Dim s$
GetTag.Album = ""
GetTag.Artist = ""
GetTag.Comment = ""
GetTag.Date = ""
GetTag.EncodedUsing = ""
GetTag.Error = ""
GetTag.Genre = ""
GetTag.TrackNumber = 0
GetTag.Title = ""
foundatag = False
s$ = Space$(2048)
'Phase is used so the error handler knows
'what we are up to
On Error GoTo Errhandler
phase = 1
'Phase 1: We're trying to open the file.
filelength = FileLen(Filename)
fileremaining = filelength
filehandle = FreeFile()
Open Filename For Binary Access Read As filehandle
'Phase 2: File open.. so it exists..
phase = 2
Do
Get filehandle, , s$
fileopened = fileopened + Len(s$)
fileremaining = fileremaining - Len(s$)
If fileremaining < 2048 Then
s$ = Space$(fileremaining)
End If
tmp = InStr(1, s$, "vorbis")
tmp2 = InStr(1, s$, "vorbis ")
If tmp <> 0 Then
If tmp2 < tmp Then
If tmp2 <> 0 Then
tmp = tmp2
End If
End If
Else
If tmp2 <> 0 Then
tmp = tmp2
End If
End If
If tmp <> 0 Then Exit Do
If fileremaining = 0 Then Exit Do
Loop
If tmp 0 Then phase 3: GoTo Errhandler
'Ok, we've found the vorbis header.
'Let's get a big chunk of data
Get filehandle, tmp, s$
'Ok, we've got 2kb of data after the header
'lets find the header close
tmp = InStr(7, s$, "vorbis")
If tmp 0 Then phase 4: GoTo Errhandler
'now we can get the required info
tmp = InStr(1, s$, "TITLE=")
If tmp <> 0 Then
foundatag = True
tmp2 = InStr(tmp, s$, Chr$(0) + Chr$(0) + Chr$(0))
tmp3 = InStr(tmp, s$, Chr$(1) + Chr$(5) + "vorbis")
If tmp3 < tmp2 Then tmp2 = tmp3 + 1
tmp2 = tmp2 - 1
GetTag.Title = Mid$(s$, tmp + 6, tmp2 - (tmp + 6))
End If
tmp = InStr(1, s$, "ARTIST=")
If tmp <> 0 Then
foundatag = True
tmp2 = InStr(tmp, s$, Chr$(0) + Chr$(0) + Chr$(0))
tmp3 = InStr(tmp, s$, Chr$(1) + Chr$(5) + "vorbis")
If tmp3 < tmp2 Then tmp2 = tmp3 + 1
tmp2 = tmp2 - 1
GetTag.Artist = Mid$(s$, tmp + 7, tmp2 - (tmp + 7))
End If
tmp = InStr(1, s$, "COMMENT=")
If tmp <> 0 Then
foundatag = True
tmp2 = InStr(tmp, s$, Chr$(0) + Chr$(0) + Chr$(0))
tmp3 = InStr(tmp, s$, Chr$(1) + Chr$(5) + "vorbis")
If tmp3 < tmp2 Then tmp2 = tmp3 + 1
tmp2 = tmp2 - 1
GetTag.Comment = Mid$(s$, tmp + 8, tmp2 - (tmp + 8))
End If
tmp = InStr(1, s$, "ALBUM=")
If tmp <> 0 Then
foundatag = True
tmp2 = InStr(tmp, s$, Chr$(0) + Chr$(0) + Chr$(0))
tmp3 = InStr(tmp, s$, Chr$(1) + Chr$(5) + "vorbis")
If tmp3 < tmp2 Then tmp2 = tmp3 + 1
tmp2 = tmp2 - 1
GetTag.Album = Mid$(s$, tmp + 6, tmp2 - (tmp + 6))
End If
tmp = InStr(1, s$, "DATE=")
If tmp <> 0 Then
foundatag = True
tmp2 = InStr(tmp, s$, Chr$(0) + Chr$(0) + Chr$(0))
tmp3 = InStr(tmp, s$, Chr$(1) + Chr$(5) + "vorbis")
If tmp3 < tmp2 Then tmp2 = tmp3 + 1
tmp2 = tmp2 - 1
GetTag.Date = Mid$(s$, tmp + 5, tmp2 - (tmp + 5))
End If
tmp = InStr(1, s$, "TRACKNUMBER=")
If tmp <> 0 Then
foundatag = True
tmp2 = InStr(tmp, s$, Chr$(0) + Chr$(0) + Chr$(0))
tmp3 = InStr(tmp, s$, Chr$(1) + Chr$(5) + "vorbis")
If tmp3 < tmp2 Then tmp2 = tmp3 + 1
tmp2 = tmp2 - 1
GetTag.TrackNumber = Val(Mid$(s$, tmp + 12, tmp2 - (tmp + 12)))
End If
tmp = InStr(1, s$, "GENRE=")
If tmp <> 0 Then
foundatag = True
tmp2 = InStr(tmp, s$, Chr$(0) + Chr$(0) + Chr$(0))
tmp3 = InStr(tmp, s$, Chr$(1) + Chr$(5) + "vorbis")
If tmp3 < tmp2 Then tmp2 = tmp3 + 1
tmp2 = tmp2 - 1
GetTag.Genre = Mid$(s$, tmp + 6, tmp2 - (tmp + 6))
End If
tmp = InStr(1, s$, "ENCODED_USING=")
If tmp <> 0 Then
foundatag = True
tmp2 = InStr(tmp, s$, Chr$(0) + Chr$(0) + Chr$(0))
tmp3 = InStr(tmp, s$, Chr$(1) + Chr$(5) + "vorbis")
If tmp3 < tmp2 Then tmp2 = tmp3 + 1
tmp2 = tmp2 - 1
GetTag.EncodedUsing = Mid$(s$, tmp + 14, tmp2 - (tmp + 14))
End If
If foundatag False Then phase 5: GoTo Errhandler
Exit Function
Errhandler:
Close filehandle
If phase 1 Then errmsg "Error opening file! Not found? Already in use, perhaps?"
If phase 2 Then errmsg "Error processing file. Ouchage."
If phase 3 Then errmsg "Vorbis header not found?!"
If phase 4 Then errmsg "Vorbis header not closed!"
If phase 5 Then errmsg "I found a vorbis header, but no tag information seems to exist.."
GetTag.Error = "ERR:" + errmsg
Exit Function
End Function
Form1.frm
=====
Function VorbisReader(Filename As String)
Dim p As VorbisTag
Dim tmp As Integer
If LCase$(Right$(Filename, 3)) <> "ogg" Then
tmp = MsgBox("Le fichier " & Filename & " n'est pas un fichier Vorbis !" & bnewline & "Voulez-vous quand même contninuer ?", 36, "Conflit")
If tmp = 7 Then Exit Function
End If
p = GetTag(Text1.Text)
If p.Error = "" Then
MsgBox "Title: " + p.Title & vbNewLine _
& "Artist: " + p.Artist & vbNewLine _
& "Genre: " + p.Genre & vbNewLine _
& "TrackNo: " + Format$(p.TrackNumber) & vbNewLine _
& "Year: " + p.Date & vbNewLine _
& "Album: " + p.Album & vbNewLine _
& "EncodedUsing: " + p.EncodedUsing
Else
MsgBox "Error: " + Right$(p.Error, Len(p.Error) - 4)
End If
Private Sub Form_Load()
VorbisReader ("C:\Mys Music\Treck 01.ogg")
End Sub
Dis moi ce que tu en pense.
8/10 tout de meme car y a du taf et de bonne idées.
KaViDee
Messages postés262Date d'inscriptiondimanche 1 septembre 2002StatutMembreDernière intervention18 juin 2008 22 juil. 2004 à 12:33
ça avait l'air bien mais il manque ccrpftv6.ocx :(
j'attends la maj
++
30 nov. 2005 à 21:18
30 nov. 2005 à 20:36
Hélas, je n'ai pas trouvé beaucoup d'info sur le web quant aux différents champs conventionnés du Tag Ogg. Mais parmi les fichiers que je possède, j'ai trouvé quelques champs non pris en compte dans le module:
DISKNUMBER=, SOURCEMEDIA=, RIPPEDWITH=
Si quelqu'un a d'autres infos, merci de les partager.
@+ et bon prog!
15 déc. 2004 à 12:43
23 juil. 2004 à 15:32
@++
23 juil. 2004 à 15:14
>>icarus
ayant fais un projet également orienté sur le tagging , je me suis senti un peu obligé de passé par là ;-)
ton appli a l'air intéressante, j'ai pa dl le source pour le moment, le ferai surement ce WE...
>>patate
merci de ton post ;-) ... je suis sur plusieur projet simultané et j'avais pas l'intention de me mettre à l'ogg tout de suite mais vu ke tu as l'air d'y tenir, je vais surement essayé de bosser de dessus...j'ai déjà trouvé kelkes infos intéressante...toutefois je pense ke je n'utiliserai pas le source ke tu nous a fourni en aide (nous = icarus et moi) car il ne m'embale pa...c'est sur k'il a l'air de marché mais bon si tu a regardé mon code tu doi surement comprendre ke c'est plutot en byte ke je cherche les zones etc....un truc notament ki m'oblige a ne pas utilisé ce code, c'est ke je n'ai aucune info sur le bitrate , la fréquence les cannaux etc...etc.. ce ki correspond au type TagMpeg de mon source actuel sur les tag mp3...j'ai par ailleurs déjà trouvé ce type d'info , la constitution du header en gros...enfin bref je vais voir comment gérer tout cela et surtout comment l'intégrer a ma class actuelle tout en concervant sa facilité d'utilisation....enfin voilà ...
pour conclure :
>>icarus :
bonne continuation et je te tiendrai au courant de ce ke je pense de ton source...car je ve pas faire ça dans la précipitation ;-)
>>patate :
je te tiendrai au courant de l'avancé du tagging ogg
@+
22 juil. 2004 à 15:47
je ferais bientôt une mise à jour
22 juil. 2004 à 13:01
L'explorateur de gauche est completement buggé chez moi kan je suis dans le poste de travail, g une erreur 63
Je te donné ici un code que j'avais donné a Yomm pour la gestion en lecture des tags OGG.
C/C
J'ai un code pour lire (et seuelement lire mais c un debut) les tag OGG. J'ai testé sur kelkes fichier que j'avais en ma poccession et j'ai pas eu de problème :)
modVorbis.bas
=========
Option Explicit
Public Type VorbisTag
Title As String
Artist As String
Album As String
Genre As String
Date As String
Comment As String
TrackNumber As Integer
EncodedUsing As String
Error As String
End Type
Public Function GetTag(Filename) As VorbisTag
Dim phase As Integer
Dim filelength As Long
Dim fileremaining As Long
Dim fileopened As Long
Dim filehandle As Integer
Dim errmsg As String
Dim tmp As Integer
Dim tmp4 As Integer
Dim tmp2 As Integer
Dim tmp3 As Integer
Dim foundatag As Boolean
Dim s$
GetTag.Album = ""
GetTag.Artist = ""
GetTag.Comment = ""
GetTag.Date = ""
GetTag.EncodedUsing = ""
GetTag.Error = ""
GetTag.Genre = ""
GetTag.TrackNumber = 0
GetTag.Title = ""
foundatag = False
s$ = Space$(2048)
'Phase is used so the error handler knows
'what we are up to
On Error GoTo Errhandler
phase = 1
'Phase 1: We're trying to open the file.
filelength = FileLen(Filename)
fileremaining = filelength
filehandle = FreeFile()
Open Filename For Binary Access Read As filehandle
'Phase 2: File open.. so it exists..
phase = 2
Do
Get filehandle, , s$
fileopened = fileopened + Len(s$)
fileremaining = fileremaining - Len(s$)
If fileremaining < 2048 Then
s$ = Space$(fileremaining)
End If
tmp = InStr(1, s$, "vorbis")
tmp2 = InStr(1, s$, "vorbis ")
If tmp <> 0 Then
If tmp2 < tmp Then
If tmp2 <> 0 Then
tmp = tmp2
End If
End If
Else
If tmp2 <> 0 Then
tmp = tmp2
End If
End If
If tmp <> 0 Then Exit Do
If fileremaining = 0 Then Exit Do
Loop
If tmp 0 Then phase 3: GoTo Errhandler
'Ok, we've found the vorbis header.
'Let's get a big chunk of data
Get filehandle, tmp, s$
'Ok, we've got 2kb of data after the header
'lets find the header close
tmp = InStr(7, s$, "vorbis")
If tmp 0 Then phase 4: GoTo Errhandler
'now we can get the required info
tmp = InStr(1, s$, "TITLE=")
If tmp <> 0 Then
foundatag = True
tmp2 = InStr(tmp, s$, Chr$(0) + Chr$(0) + Chr$(0))
tmp3 = InStr(tmp, s$, Chr$(1) + Chr$(5) + "vorbis")
If tmp3 < tmp2 Then tmp2 = tmp3 + 1
tmp2 = tmp2 - 1
GetTag.Title = Mid$(s$, tmp + 6, tmp2 - (tmp + 6))
End If
tmp = InStr(1, s$, "ARTIST=")
If tmp <> 0 Then
foundatag = True
tmp2 = InStr(tmp, s$, Chr$(0) + Chr$(0) + Chr$(0))
tmp3 = InStr(tmp, s$, Chr$(1) + Chr$(5) + "vorbis")
If tmp3 < tmp2 Then tmp2 = tmp3 + 1
tmp2 = tmp2 - 1
GetTag.Artist = Mid$(s$, tmp + 7, tmp2 - (tmp + 7))
End If
tmp = InStr(1, s$, "COMMENT=")
If tmp <> 0 Then
foundatag = True
tmp2 = InStr(tmp, s$, Chr$(0) + Chr$(0) + Chr$(0))
tmp3 = InStr(tmp, s$, Chr$(1) + Chr$(5) + "vorbis")
If tmp3 < tmp2 Then tmp2 = tmp3 + 1
tmp2 = tmp2 - 1
GetTag.Comment = Mid$(s$, tmp + 8, tmp2 - (tmp + 8))
End If
tmp = InStr(1, s$, "ALBUM=")
If tmp <> 0 Then
foundatag = True
tmp2 = InStr(tmp, s$, Chr$(0) + Chr$(0) + Chr$(0))
tmp3 = InStr(tmp, s$, Chr$(1) + Chr$(5) + "vorbis")
If tmp3 < tmp2 Then tmp2 = tmp3 + 1
tmp2 = tmp2 - 1
GetTag.Album = Mid$(s$, tmp + 6, tmp2 - (tmp + 6))
End If
tmp = InStr(1, s$, "DATE=")
If tmp <> 0 Then
foundatag = True
tmp2 = InStr(tmp, s$, Chr$(0) + Chr$(0) + Chr$(0))
tmp3 = InStr(tmp, s$, Chr$(1) + Chr$(5) + "vorbis")
If tmp3 < tmp2 Then tmp2 = tmp3 + 1
tmp2 = tmp2 - 1
GetTag.Date = Mid$(s$, tmp + 5, tmp2 - (tmp + 5))
End If
tmp = InStr(1, s$, "TRACKNUMBER=")
If tmp <> 0 Then
foundatag = True
tmp2 = InStr(tmp, s$, Chr$(0) + Chr$(0) + Chr$(0))
tmp3 = InStr(tmp, s$, Chr$(1) + Chr$(5) + "vorbis")
If tmp3 < tmp2 Then tmp2 = tmp3 + 1
tmp2 = tmp2 - 1
GetTag.TrackNumber = Val(Mid$(s$, tmp + 12, tmp2 - (tmp + 12)))
End If
tmp = InStr(1, s$, "GENRE=")
If tmp <> 0 Then
foundatag = True
tmp2 = InStr(tmp, s$, Chr$(0) + Chr$(0) + Chr$(0))
tmp3 = InStr(tmp, s$, Chr$(1) + Chr$(5) + "vorbis")
If tmp3 < tmp2 Then tmp2 = tmp3 + 1
tmp2 = tmp2 - 1
GetTag.Genre = Mid$(s$, tmp + 6, tmp2 - (tmp + 6))
End If
tmp = InStr(1, s$, "ENCODED_USING=")
If tmp <> 0 Then
foundatag = True
tmp2 = InStr(tmp, s$, Chr$(0) + Chr$(0) + Chr$(0))
tmp3 = InStr(tmp, s$, Chr$(1) + Chr$(5) + "vorbis")
If tmp3 < tmp2 Then tmp2 = tmp3 + 1
tmp2 = tmp2 - 1
GetTag.EncodedUsing = Mid$(s$, tmp + 14, tmp2 - (tmp + 14))
End If
If foundatag False Then phase 5: GoTo Errhandler
Exit Function
Errhandler:
Close filehandle
If phase 1 Then errmsg "Error opening file! Not found? Already in use, perhaps?"
If phase 2 Then errmsg "Error processing file. Ouchage."
If phase 3 Then errmsg "Vorbis header not found?!"
If phase 4 Then errmsg "Vorbis header not closed!"
If phase 5 Then errmsg "I found a vorbis header, but no tag information seems to exist.."
GetTag.Error = "ERR:" + errmsg
Exit Function
End Function
Form1.frm
=====
Function VorbisReader(Filename As String)
Dim p As VorbisTag
Dim tmp As Integer
If LCase$(Right$(Filename, 3)) <> "ogg" Then
tmp = MsgBox("Le fichier " & Filename & " n'est pas un fichier Vorbis !" & bnewline & "Voulez-vous quand même contninuer ?", 36, "Conflit")
If tmp = 7 Then Exit Function
End If
p = GetTag(Text1.Text)
If p.Error = "" Then
MsgBox "Title: " + p.Title & vbNewLine _
& "Artist: " + p.Artist & vbNewLine _
& "Genre: " + p.Genre & vbNewLine _
& "TrackNo: " + Format$(p.TrackNumber) & vbNewLine _
& "Year: " + p.Date & vbNewLine _
& "Album: " + p.Album & vbNewLine _
& "EncodedUsing: " + p.EncodedUsing
Else
MsgBox "Error: " + Right$(p.Error, Len(p.Error) - 4)
End If
Private Sub Form_Load()
VorbisReader ("C:\Mys Music\Treck 01.ogg")
End Sub
Dis moi ce que tu en pense.
8/10 tout de meme car y a du taf et de bonne idées.
22 juil. 2004 à 12:33
j'attends la maj
++