you wont be able to hear the sound because it is played many hundreds of times a second.
i used SoundBeep and commented out SoundPlay because it would just fill your audioCard and create a mess sound wise.
I have visual alerts turned on for hearing impairment in the Accessibility page of Control Panel.
When I run the above script it makes a light show out of my monitor despite no sound coming through.
If you would like to play your .wav, move it into the same directory as your .ahk file and change the following lines
Code: Select all
click
;SoundPlay, *-1 ;plays a console beep, exchange this with your mp3 file's path
SoundBeep,,5 ;plays a console beep for 5ms
Sleep, -1
into
Code: Select all
click
SoundPlay, %A_ScriptDir%\YOURSOUNDFILE.wav ;this will load the directory of your .ahk file and look for "YOURSOUNDFILE.wav" in the same folder.
;SoundBeep,,5 ;plays a console beep for 5ms
Sleep, -1
if your sound is still not playing, amend the WAIT command to SoundPlay. This will force it to wait until the sound is done being played before clicking again.
Code: Select all
SoundPlay, %A_ScriptDir%\YOURSOUNDFILE.wav, WAIT
I might imagine that putting "#MaxThreads 2" (or more) at the very beginning of your script might allow it to play the sound along the running code.
This is just a guess because I have no idea what type of thread SoundPlay produces or if it will make a thread for itself.