Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPublic Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Integer, ByVal hwndCallback As Integer) As Integer Public strFileToPlay As String Public bPlaying As Boolean Public Sub Play() If strFileToPlay <> "" Then mciSendString("play " & strFileToPlay, CStr(0), 0, 0) bPlaying = True End If End Sub Public Sub Open() If strFileToPlay <> "" Then mciSendString("open " & strFileToPlay & " type MPEGVideo", CStr(0), 0, 0) End If End Sub Public Sub Pause() If bPlaying Then mciSendString("pause " & strFileToPlay, CStr(0), 0, 0) bPlaying = False End If End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Call Pause() strFileToPlay = "chemin fichier.mp3" strFileToPlay = """" & strFileToPlay & """" Call Open() Call Play() End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click 'Arrete la lecture du son Call Pause() End Sub