-
lecture fichier mp3
Bonjour,
je suis en train de concevoir un lecteur complètement indépendant de winamp ou wmp.Cependant je ne peux lire que des fichier .wav,.avi mais pas les mp3 voici mon code:
Private Sub Dir_Change()
'initialisation du contrôle filelistbox
'après modif. du répertoire de recherche
'.......
File.Path = Dir.Path
File.Pattern = "*.wav"
End Sub
Private Sub Drive_Change()
'Initialisation des contrôles drivelistbox,
'dirlistbox et filelistbox après la modif.
'du disque de recherche
'.........
Dir.Path = Left$(Drive.Drive, 2) + "\"
File.Path = Dir.Path
File.Pattern = "*.wav"
End Sub
Private Sub File_Click()
MMControl1.Visible = True
MMControl1.Enabled = True
End Sub
Private Sub Form_Load()
'.......
'définition du répertoire de départ
'.......
Drive.Drive = "c:\"
Dir.Path = "c:\"
File.Path = "c:\"
File.Pattern = "*.wav"
'........
'initialisation du périphérique MCI
'........
MMControl1.Notify = False
MMControl1.Wait = False
MMControl1.Shareable = False
MMControl1.DeviceType = "WaveAudio"
End Sub
Private Sub Jouer_Click()
'........
'Fin de léventuel wav en cours
'........
MMControl1.Command = "Close"
If Right$(Dir.Path, 1) = "\" Then
nom = Dir.Path + File.FileName
Else
nom = Dir.Path + "\" + File.FileName
End If
MMControl1.FileName = nom
'.........
'Activation du wav sélectionner
'.........
MMControl1.Command = "Open"
MMControl1.Notify = False
MMControl1.Wait = False
MMControl1.Command = "Play"
End Sub
Private Sub Quitter_Click()
'........
'Fin du wav et du programme
'........
MMControl1.Notify = False
MMControl1.Wait = True
MMControl1.Command = "Close"
End
End Sub
Private Sub Stop_Click()
'........
'Arrêt du wav
'........
MMControl1.Notify = False
MMControl1.Wait = True
MMControl1.Command = "Stop"
End Sub
pourriez-vous me guider merci
-
Pour les mp3 c'est la propriété MMControl1.Devicetype = "..." qu'il faut modifier
je crois que pour les mp3 c'est "MPEG" mais je ne suis pas sur !
Fait une recherche sur vbsource c'est là que j'ai trouvé mais je pense qu'il y a aussi ça sur dvlp.net/com
-
non je ne vois vraiment pas, je n'ai cpas trouvé même dans les cours le bon devicetype qu'il me faut pour le mp3 il ne le spécifie pas.
:oops:
-
ca y est trouver pour info c'est mpegvideo le devicetype
merci quand meme