'Déclaration
Private Const SND_ASYNC = &H1 'Joue le son en arrière-plan.
Private Const SND_FILENAME = &H20000 'Le son provient d'un fichier externe
Private Const SND_LOOP = &H8 ' Répète le son jusqu'au prochain appel de PlaySound
Private Const SND_PURGE = &H40 'Stop la lecture du fichier
Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
'Exemple d'utilisation
'Joue en boucle un fichier wav
PlaySound "C:\fichier1.wav", ByVal 0&, SND_FILENAME Or SND_ASYNC Or SND_LOOP
'Arrete de jouer le wav
PlaySound vbNullString, ByVal 0&, SND_PURGE