Jump to content

How to make autoit play an audio alert on my pc?


Popeye1
 Share

Recommended Posts

beep is the command you are looking for. It is in the help file.

http://www.autoitscript.com/autoit3/docs/functions/Beep.htm

Found the code in the help file but it's a little complex for me and for what I want it to do. I just want it to make a constant beep that sounds a bit like an alarm if certain conditions are met. Can anyone break it down into a simpler form?

For instance, it checks to see what colours are found at a certain pixel, if colour X is found, play this bit of code (the alarm part, just can't figure out how to add it in a simple form)

Like, check coordinates X Y, if ABC

(sound high pitch alarm without ever stopping) - This is the part I don't know how to add, in the brackets, just a simple constant beep, I don't need it complex.

Edited by Popeye1
Link to comment
Share on other sites

Found the code in the help file but it's a little complex for me and for what I want it to do. I just want it to make a constant beep that sounds a bit like an alarm if certain conditions are met. Can anyone break it down into a simpler form?

For instance, it checks to see what colours are found at a certain pixel, if colour X is found, play this bit of code (the alarm part, just can't figure out how to add it in a simple form)

Like, check coordinates X Y, if ABC

(sound high pitch alarm without ever stopping) - This is the part I don't know how to add, in the brackets, just a simple constant beep, I don't need it complex.

This is basic. If you can't grasp how to do this, then take AutoIt 1 2 3. The link is in my signature. Trust me when I tell you this - Take the AutoIt course, then try to do what you have in mind. It will be cake after you take the course. Yes, it is that easy.
Link to comment
Share on other sites

This is basic. If you can't grasp how to do this, then take AutoIt 1 2 3. The link is in my signature. Trust me when I tell you this - Take the AutoIt course, then try to do what you have in mind. It will be cake after you take the course. Yes, it is that easy.

While 1 ;start master loop

Local $iFreq = 2500

_WinAPI_Beep($iFreq, 120)

WEnd ; end master loop

So far i've got that, it works, but I want to set it to only sound for 60 seconds, how can I set that?

Link to comment
Share on other sites

Well the help file says

_WinAPI_Beep($iFreq = 500, $iDuration = 1000)

so try _WinAPI_Beep($iFreq, 60 * 1000) (that's because the duration is in milliseconds)

plus, you have to place the command outside that While ... Wend loop, or it'll still go on forever

PS A bit ironical that you chose _WinAPI_Beep and not Beep, considering it was you that

complained about complication ...

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...