
HELP!!!! Multimedia MCI Control
Quote:
> I am trying to use the MCI control to allow my app to play various *wav
> files.
> It seems I am doing something wrong, or the MCI control has a mind of
> its own. for some reason, I am not able to change the wave file--if i
> try to load a new sound, the control either loads the last wave file
> played, or it doesn't load anything.
> Can someone please show me how to switch back and forth between 2
> different wav files using code?
> Any help would really be appreciated.
> Thanks, Clark
If you are designing an app that utilizes sound effects, I suggest using
the Win32 API function 'sndPlaySound'. To save you some time, I have
included the declare as well as the constants for the function.
Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal
lpszSoundName As String, ByVal uFlags As Long) As Long
' flag values for uFlags parameter
Public Const SND_SYNC = &H0 ' play synchronously (default)
Public Const SND_ASYNC = &H1 ' play asynchronously
Public Const SND_NODEFAULT = &H2 ' silence not default, if sound
not found
Public Const SND_MEMORY = &H4 ' lpszSoundName points to a memory
file
Public Const SND_ALIAS = &H10000 ' name is a WIN.INI [sounds] entry
Public Const SND_FILENAME = &H20000 ' name is a file name
Public Const SND_RESOURCE = &H40004 ' name is a resource name or atom
Public Const SND_ALIAS_ID = &H110000 ' name is a WIN.INI [sounds] entry
identifier
Public Const SND_ALIAS_START = 0 ' must be > 4096 to keep strings in same
section of resource file
Public Const SND_LOOP = &H8 ' loop the sound until next
sndPlaySound
Public Const SND_NOSTOP = &H10 ' don't stop any currently playing
sound
Public Const SND_VALID = &H1F ' valid flags / ;Internal /
Public Const SND_NOWAIT = &H2000 ' don't wait if the driver is busy
Public Const SND_VALIDFLAGS = &H17201F ' Set of valid flag bits.
Anything outside
' this range will raise an error
Public Const SND_RESERVED = &HFF000000 ' In particular these flags are
reserved
Public Const SND_TYPE_MASK = &H170007