Playing a sound in loop.
Posted: Tue Apr 15, 2008 9:56 am
Hi, I read somewhere in another thread that we could include a sound in the installer with this method.
1.- Add your wav file as a support file
2.- Add winmm.dll also as a support file, (This file may be found in the c:\\windows\\system32 folder)
3.- Now include a "Run DLL Function" command in the MSI code with the following characteristics:
DLL Path: $SUPPORTDIR$winmm.dll
Function Name: PlaySound
Parameters:
Type: allocated string buffer, Value: $SUPPORTDIR$filename.wav (replace filename with the name of your wav file)
Type: Long, Value: 0
Type: Long, Value: 1
Return Type must be bool
Return result in variable: any var of your choice
It works great. But we need to play a background music while installing. So, I was wondering if there was a way to loop that sound.
I tried to change the second Long parameter to 8 (SND_LOOP), just like in winmm.dll, but it is not working. Any ideas?!
Thanks!
1.- Add your wav file as a support file
2.- Add winmm.dll also as a support file, (This file may be found in the c:\\windows\\system32 folder)
3.- Now include a "Run DLL Function" command in the MSI code with the following characteristics:
DLL Path: $SUPPORTDIR$winmm.dll
Function Name: PlaySound
Parameters:
Type: allocated string buffer, Value: $SUPPORTDIR$filename.wav (replace filename with the name of your wav file)
Type: Long, Value: 0
Type: Long, Value: 1
Return Type must be bool
Return result in variable: any var of your choice
It works great. But we need to play a background music while installing. So, I was wondering if there was a way to loop that sound.
I tried to change the second Long parameter to 8 (SND_LOOP), just like in winmm.dll, but it is not working. Any ideas?!
Thanks!