B
Brett
I posted a similar Q a couple of weeks ago and Jacob Skaria pointed me to
MrExcel's site. I'm now using the code from there to play wavfiles, but the
problem hasn't changed. When I play a wavfile at the start of a procedure it
will (more often than not) only play the first tenth of a second (subsequent
statements of
ANY kind seem to terminate it). Other times (in the SAME subroutine, and
without code changes) it will play completely. If I play the Wavfile at the
end of a procedure then it always plays all of it.
I have (from MrExcel)
Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal
lpszSoundName As String, ByVal uFlags As Long) As Long
Public Const SND_FILENAME = &H20000
Public Const SND_SYNC = &H0
Public Const SND_ASYNC = &H1
Public Const SND_NODEFAULT = &H2
Public Const SND_MEMORY = &H4
Public Const SND_LOOP = &H8
Public Const SND_NOSTOP = &H10
Dim WAVFile As String
and then a series of:
Sub G02_WAV_CHIMES()
WAVFile = "C:\0. QUO VADIS\SOUNDS\chimes.wav"
Call sndPlaySound(WAVFile, SND_ASYNC Or SND_FILENAME)
End Sub
What can be causing this intermittent problem please?
Is there something that needs to be cleared (or whatever) before playing a
WAV? Brett
MrExcel's site. I'm now using the code from there to play wavfiles, but the
problem hasn't changed. When I play a wavfile at the start of a procedure it
will (more often than not) only play the first tenth of a second (subsequent
statements of
ANY kind seem to terminate it). Other times (in the SAME subroutine, and
without code changes) it will play completely. If I play the Wavfile at the
end of a procedure then it always plays all of it.
I have (from MrExcel)
Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal
lpszSoundName As String, ByVal uFlags As Long) As Long
Public Const SND_FILENAME = &H20000
Public Const SND_SYNC = &H0
Public Const SND_ASYNC = &H1
Public Const SND_NODEFAULT = &H2
Public Const SND_MEMORY = &H4
Public Const SND_LOOP = &H8
Public Const SND_NOSTOP = &H10
Dim WAVFile As String
and then a series of:
Sub G02_WAV_CHIMES()
WAVFile = "C:\0. QUO VADIS\SOUNDS\chimes.wav"
Call sndPlaySound(WAVFile, SND_ASYNC Or SND_FILENAME)
End Sub
What can be causing this intermittent problem please?
Is there something that needs to be cleared (or whatever) before playing a
WAV? Brett