I would like to know a couple of questions about how Sound Play works, namely:
1. Is there a download every time SoundPlay is called, or only 1 time during the entire operation of the script?
2. I saw an example example for Ahk v1 with a call to PlaySound, How to make it work on V2?
Code: Select all
Start := FileRead("Assets\Sound\Suspend Off.wav", "RAW")
PlaySound(Start)
Sleep 1000
PlaySound( &Sound ) {
Return DllCall("winmm.dll\PlaySound" ( 1 ? "W" : "A" ), "UInt", Sound, "UInt", 0
, "UInt", ((SND_MEMORY:=0x4)|(SND_NODEFAULT:=0x2)))
}
Error: Parameter #1 of PlaySound requires a variable reference, but
received a Buffer.
I want the file to be loaded in advance into memory for later playback. How to implement it correctly?