Help with sound script
Help with sound script
Please help me create a script .
The script should be :
when u press a key sound1 will play but if u hold down the same key a sound2 will play but if u release the key all sounds would stop.
The script should be :
when u press a key sound1 will play but if u hold down the same key a sound2 will play but if u release the key all sounds would stop.
Re: Help with sound script
How would the first sound finish if the key is always released?
Take it step by step; think it through. Provide a detailed example for each scenario.
Take it step by step; think it through. Provide a detailed example for each scenario.
Re: Help with sound script
So you want to play 300 ms of a sound? Is it just a SoundBeep, or a MP3 or WAV file?
Re: Help with sound script
So the key is pressed down. What happens next? What happens after that? Please provide an example, step by step.
Re: Help with sound script
I press lbutton then sound1 will play but if I don't release the lbutton it will start playing sound2... so while a key is held down the sound2 will play ... and when i release the lbutton the sound2 will stop
Re: Help with sound script
Code: Select all
soundDir = d:\mwsounds
sound1 = %soundDir%\02-The_Things_We_Do_for_Love.mp3
sound2 = %soundDir%\The_Beatles_-_05_-_All_Together_Now.mp3
LButton::
SoundPlay, %sound1%
Sleep, 1000
LButton Up::SoundPlay, % GetKeyState("LButton", "P") ? sound2 : ""
Last edited by mikeyww on 30 Jun 2022, 11:13, edited 7 times in total.