-
When playing wav files with the Multi Media control, you have to load each file individually. I've noticed that there is a delay time while the file loads if you change it...iS there a way to 'pre load' the wav's so that there's no delay time before it plays?
Thanks,
-
API!
If you just need to play WAVs, you don't need a huge MCI control. The API can do it quickly and efficiently.
Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Public Const SND_ASYNC = &H1
Public Const SND_NODEFAULT = &H2
Put the above code in the General Declarations of a module. Then, to play a file, use:
Call sndPlaySound("C:\MyFile.wav", SND_ASYNC Or SND_NODEFAULT)
To stop all wave sounds currently playing, use:
Call sndPlaySound(vbNullString, SND_NODEFAULT)
The next step would be getting rid of your MCI control and cursing the day you heard of it. :D
-
Great!
Works very well... Thanks!