Jump to content
Sign in to follow this  

beep sound - how do I generate in AutoIt3

Recommended Posts


When certain slow activities are complete in my program, I want to send an audible cue to the user to respond. The help says ASCII 7 is "Bell, rings the bell... (Plays Windows' default beep)"; but:

Send("{ASC 7}")

doesn't work. Thanks

Share this post

Link to post
Share on other sites

Soundplay launches the media player - this is a little heavy for a simple beep. I thought a little more about this and came up with something that works:


MsgBox(0,"Before the Beep","")


MsgBox(0,"After the Beep","")



Func beep()

If Not FileExists("C:\BEEP.bat") Then

$str = "prompt "

FileWriteLine("C:\BEEP.bat", $str)


RunWait(@ComSpec & " /c C:\BEEP.bat", "", @SW_HIDE)



Note: in $str = is ctrl-G character

Thanks to 'scriptkitty' for earlier posting on using RunWait without flashing.

Is there any way to make this shorter - esp to eliminate the need for BAT file?


Share this post

Link to post
Share on other sites

Wow, it actually beeps the pc speaker... It is maybe better find a way to select the .wav?

Share this post

Link to post
Share on other sites

Run(@ComSpec & " /c echo " & Chr(7), "", @SW_HIDE)

Hope that works for you

Very neat, Sluggie :) .. at last my dumb pc has found its voice!

:huh2: Perhaps this can find its way into the CHM as an example of .. I dunno, @SW_HIDE? Hmmm .. or even as part of the rumoured tutorial :D

Share this post

Link to post
Share on other sites

ok have not tried this but, here are the associated players that can play a wav from with in windows...


from what i have read almost if not all support /play /close switches afterwards followed by the wav file path and name of file.... the only one that is different is the amovie.ocx and it command are

rundll amovie.ocx,RunDll /play /close

i believe... if it doesn't run with rundll, try rundll32. also all the above is not included in all versions of windows. you will have to experiment... i cannot find amovie.ocx, and mplayer.exe in windws 2000. Oh i have read somewhere that mplay32.exe is limited in path length, so let it be known... i hope this all helps...




Madness is the first step to understanding...

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this