Jump to content

Waiting for an event to happen


fflaque
 Share

Recommended Posts

I am stuck and was wondering if anyone could help me out. Right now I am trying to have two programs interact where the trigger would be the playing of a wav file(which is where I am having trouble). How could I have the prog listen and wait for the wav file to be played to activate the autoit to then perform the functions i already have coded?

Link to comment
Share on other sites

I am stuck and was wondering if anyone could help me out.  Right now I am trying to have two programs interact where the trigger would be the playing of a wav file(which is where I am having trouble).  How could I have the prog listen and wait for the wav file to be played to activate the autoit to then perform the functions i already have coded?

<{POST_SNAPBACK}>

You might use WinWaitActive()

The script is going to go on only when he'll see a window poped up with a specified name

Link to comment
Share on other sites

k thanks, i'll try that and see if it works :ph34r:

<{POST_SNAPBACK}>

little problem, i just realized that when the wav file is played it is not opened separately in windows media but through the program i am using, is there a way to check if a file(like a wav file) is being accessed by a program.
Link to comment
Share on other sites

Guest BlackDiablo110

Why don't u just use the Sleep () command? Just set it to sleep for like 10 seconds if your thing is really slow or whatever.

Link to comment
Share on other sites

try looping fileopen() on the file. if fileopen fails, perhaps you can assume the file is open, and playing...

While FileOpen("file.mp3") <> -1

  Sleep(5000)

Wend

if the mp3 is shorter than 5 seconds this may fail... this is only a theory... no idea if it is applicable.

LAr.

<{POST_SNAPBACK}>

Thanks Larry I'll try that and see if it works, hopefully it will.
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...