Page 1 of 1

Play sounds simultaneously?

Posted: 26 Jul 2017, 16:00
by fpsdredd
Hi everyone. I cant figure out how to play multiple sounds at once. I have short sounds (less than 1 second) that need to play and overlap. Any ideas how to do this? Code samples would be helpful. :dance:

Re: Play sounds simultaneously?  Topic is solved

Posted: 27 Jul 2017, 14:33
by fpsdredd

Re: Play sounds simultaneously?

Posted: 27 Jul 2017, 15:16
by gwarble
i think this will work for you, but I didn't test it:

Code: Select all

FileRead,Sound,*c chimes.wav
PlaySoundAsync(Sound)

PlaySoundAsync( ByRef Sound ) {
 Return DllCall( "winmm.dll\PlaySound" ( A_IsUnicode ? "W" : "A" ), UInt,&Sound, UInt,0, UInt, 0x7 )
}

Re: Play sounds simultaneously?

Posted: 28 Jul 2017, 18:54
by fpsdredd
That didn't work for me Garble.

I tried this:
DllCall( "winmm.dll\PlaySound", AStr,"C:\Users\barney\Desktop\minimap\left.wav", UInt,0, UInt, 0)
DllCall( "winmm.dll\PlaySound", AStr,"C:\Users\barney\Desktop\minimap\right.wav", UInt,0, UInt, 0)

Finishes playing the first sound and then plays the second.