hannah2233
New Member
- Joined
- May 7, 2014
- Messages
- 15
Hey guys!!
In VBA i made a countdown timer, when it gets to 0 it executes an .wav audiofile then the countdown timer resets and counts down again. The problem is the code waits for the audiofile to play (~3 sec) before continuing. So you could imagine, if I counted down for 1min, the actual time would be 1min, 3seconds.
Is there a way to get the audiofile to play, while the remaining code still runs? I tried SND_ASYNC but that hasnt seemed to work. This is what code I have
Much love, hannah
In VBA i made a countdown timer, when it gets to 0 it executes an .wav audiofile then the countdown timer resets and counts down again. The problem is the code waits for the audiofile to play (~3 sec) before continuing. So you could imagine, if I counted down for 1min, the actual time would be 1min, 3seconds.
Is there a way to get the audiofile to play, while the remaining code still runs? I tried SND_ASYNC but that hasnt seemed to work. This is what code I have
Code:
Declare PtrSafe Function sndPlaySound32 Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpazSoundName As String, ByVal uFlags As Long) As Long
Public Const MySoundsPath = "C:\Users\Hannah\Music\"
Sub Playbeep()
sndPlaySound32 MySoundsPath & "wololo.wav ", SND_ASYNC
End Sub
Much love, hannah