Windows is calling the library mmsystem.dll. Following is a statement calling the API (the code of these procedures on the statement in part):
1. 'CD player and AVI needed a statement.
DeclareFunctionmciSendStringLib "MMSYSTEM" (ByVallpstrCommandasString, ByVallpstrReturnStrasAny, ByValwRetumLenasInteger, ByValhCallBackasInteger) asLong
'WAV player needed a statement
DeclareFunctionsndPlaySoundLib "MMSYSTEM.DLL" (ByVallpszSoundNameasString, ByValwF1agsasInteger) asInteger
'Detection of sound card required for the statement
DeclareFunctionauxGetNaumDevsLib "MMSYSTEM" () asInteger
'Used by the global variable declaration
GlobalConstSND_SYNC = & H0000 'play WAV use global variables
GlobalConstSND_ASYNC = &-H0001 'play WAV use global variables
GlobalConstSND_NODEFAULT = & H0002 'play WAV use global variables
GlobalConstSND_LOOP = & H0008 'play WAV use global variables
GlobalConstSND_NOSTOP = &-H0010 'play WAV use global variables
'Followed by calls these statements
FunctionauxTest () asBoolean
DimiAsInteger
I = auxGetNumDevs ()
Ifi> 0Then
AuxTest = True 'If I return to the sound card is
ExitFunction
Else
AuxTest = False 'If not detected then return to the false Audio
ExitFunction
Else
AuxTest = False 'If not detected then return to the false Audio
ExitFunction
EndIf
EndFunction
2. CD player source code
SubPlayCD (bAsInteger)
'B for the broadcast of the track,
DimaAsLong
a = mciSendString ( "opencdaudioaliascdwait", 0 &, 0,0) 'drive initialization
a = mciSendString ( "setcdtimeformattmsf", 0 &, 0,0)
a = mciSendString ( "playcdfrom" & Str (b), 0 &, 00) 'audio player
EndSub
3. AVI player of the source code
SubplayAVI (AVIFileAsString)
DimRValasLong
AVIFile = "play" + AVIFile + "fullscreen" 'full-screen playback AVI files
RVal = mciSendString (AVIFile, 0 &, 0,0 &)
EndSub
4. WAV Player source code
SubplayWAV (WAVFileAsString)
DimFlagasInteger
DimaasInteger
WFlag = SND_ASYNCorSND_NODEFAULT
A = sndPlaySound (WAVFile, Flag)
EndSub
Program is more than I used to call when the multi-media module, you can simply call up the top of the module in the process that is a direct call |