swin4ort Posted May 26, 2004 Posted May 26, 2004 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
swin4ort Posted May 26, 2004 Author Posted May 26, 2004 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","") beep() MsgBox(0,"After the Beep","") Exit ; Func beep() If Not FileExists("C:\BEEP.bat") Then $str = "prompt " FileWriteLine("C:\BEEP.bat", $str) EndIf RunWait(@ComSpec & " /c C:\BEEP.bat", "", @SW_HIDE) EndFunc ----------------- 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? IAN
CyberSlug Posted May 27, 2004 Posted May 27, 2004 Run(@ComSpec & " /c echo " & Chr(7), "", @SW_HIDE)Hope that works for you Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
ezzetabi Posted May 27, 2004 Posted May 27, 2004 Wow, it actually beeps the pc speaker... It is maybe better find a way to select the .wav?
trids Posted May 27, 2004 Posted May 27, 2004 Run(@ComSpec & " /c echo " & Chr(7), "", @SW_HIDE)Hope that works for youVery neat, Sluggie .. at last my dumb pc has found its voice! 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
Somerset Posted May 27, 2004 Posted May 27, 2004 ok have not tried this but, here are the associated players that can play a wav from with in windows... wmplayer.exe mplayer2.exe amovie.ocx sndrec32.exe mplay32.exe mplayer.exe 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...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now