1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| '---- Pour son WAV
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" ( _
ByVal lpszSoundName As String, _
ByVal uFlags As Long) As Long
Private Declare Function sndPlaySoundmem Lib "winmm.dll" Alias "PlaySoundA" ( _
ByVal lpszName As Long, _
ByVal hModule As Long, _
ByVal dwFlags As Long) As Long
' Joue le fichier de manière synchrone (attend la fin de la lecture pour rendre la main).
Private Const SND_SYNC = &H0
' Joue le fichier de manière asynchrone (rend la main immédiatement).
Private Const SND_ASYNC = &H1
' N'attend pas si le driver son est occupé.
Private Const SND_NOWAIT = &H2000
Public Sub JouerFichierWav(stFichier As String)
' Joue le fichier son envoyé en paramêtre si le driver est disponible.
Call sndPlaySound(stFichier, SND_ASYNC Or SND_NOWAIT)
End Sub
Sub lance_son()
Call JouerFichierWav("C:\untie.wav")
End Sub |
Partager