Jump to content

Automation for Radio Stations and Internet Streams


 Share

Recommended Posts

Hello all

Can somebody check this script please?

It shows no errors on syntax and it works good.

But, I need to see if it can be done any simpler

or should I leave it alone?

Thanks

Example of WAAM.au3

"The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward

Link to comment
Share on other sites

First thing that jumps out at me, id that your script sleeps for 1000 miliseconds, or 1 second, and its conditional on seconds.

That says to me you are bound at some point to miss the 00 seconds

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

The seconds to 00 doesn't matter too much.

It was early on, but the script would max the CPU load if I didn't add 1 second to it.

I'll look into it again.

Thanks for your reply

"The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward

Link to comment
Share on other sites

I rechecked the 1 second line.

It does indeed need to be included, or else the script will max the CPU.

It's weird. Does anyone know why this happens?

-- Thanks

"The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward

Link to comment
Share on other sites

Yes you must have a sleep in there, but my point is this

While 1
Sleep(1000); <================================================= sleeping 1 second
If @MIN = 00 and @SEC = 00 Then; <============================= Relying on in seconds
SoundPlay("c:\Podcast\MCID.mp3", 0) ; Plays ID at the top of every hour
Sleep(1000)
EndIf
If @MIN = 55 and @SEC = 00 Then
Run(@ComSpec & " /c " & 'c:\Podcast\download.exe http://64.26.15.101/feeds/FSNBulletin.mp3 /update /output:c:\Podcast', "",@SW_HIDE) ; Downloads the lastest news spot
Sleep(1000)
EndIf

So if 00 seconds occurs while your code is sleeping that particular second, it may well miss it and your sound will not play.

I could be off the mark here so dont take me at my word, but for me, if the sleep had to be that much it would be Sleep(999)

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Ah - I see what you're saying. It has a 1 in 60 chance of missing 00.

Whats the optimal sleep value at that line?

--Thanks

"The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward

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...