Playing a sound in loop.

Got a problem you cannot solve? Try here.
Post Reply
Kniforz
Posts: 2
Joined: Tue Apr 15, 2008 9:49 am

Playing a sound in loop.

Post by Kniforz »

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!
Kniforz
Posts: 2
Joined: Tue Apr 15, 2008 9:49 am

Post by Kniforz »

Nevermind, i found...

put the secong long parameter to 9.
0x0001 (SND_ASYNC)
0x0008 (SND_LOOP)


SND_LOOP | SND_ASYNC = 1000 | 0001 = 1001 = 9 :)
Post Reply