You do not have to pack unpack sound files to hard disk(No need for IncludeBinary)
You can play sound files direct from memory as follows :
1- Save the next resource file as "Sound_Files.rc"
2- Add the resource file to your code using Compiler -->Compiler Options --> Resources
3- Save your code
4- Run any file from memory using the following snippet
Sound_Files.rc :
;*************************************************
// LANGUAGE LANG_ENGLISH,SUBLANG_ENGLISH_US
SOUND_1 WAVE "e:\\flourishGSM.wav"
SOUND_2 WAVE "e:\\flourishIMA.wav"
SOUND_3 WAVE "e:\\flourishMPG.wav"
SOUND_4 WAVE "e:\\flourishMSA.wav"
;*************************************************
Code: Select all
hInst = GetModuleHandle_(#Null)
hResInfo = FindResource_(hInst, "SOUND_1", "WAVE")
hRes = LoadResource_(hInst, hResInfo)
lpRes = LockResource_(hRes)
sndPlaySound_(lpRes,#SND_MEMORY | #SND_SYNC | #SND_NODEFAULT)
hResInfo = FindResource_(hInst, "SOUND_3", "WAVE")
hRes = LoadResource_(hInst, hResInfo)
lpRes = LockResource_(hRes)
sndPlaySound_(lpRes,#SND_MEMORY | #SND_SYNC | #SND_NODEFAULT)