MacOS X alarm clock with radio

4

2

How can I use my Macbook Air to wake me up in the morning using an Internet radio station of my choice? The solution should wake up the laptop from sleep and be reliable. Here's what I know:

  • Macs can be reliably woken up from suspend, by software, at a specified time.
  • There are a number of programs including the free Alarm Clock 2 as well commercial Awaken and Aurora. These have the feature of specifying an iTunes playlist, which can include radio stremas.

However, the feature of waking up to internet radio, if implemented, doesn't seem to be well tested. In my tests, Alarm Clock 2 didn't recognize the internet stream at all, while Aurora didn't manage to play the stream after waking up in the morning, the latter failure presumably being a result of the WiFi connection taking a few seconds to establish.

Waking up to internet radio seems to be an eminently useful option. Any solutions?

loevborg

Posted 2011-07-29T09:36:31.243

Reputation: 151

I had the same results with Alarm Clock (it played the default alarm sound instead) and Aurora (beachball'd Playback tab). – Lri – 2011-07-29T11:30:07.143

Answers

1

At least Aurora allows you to run an AppleScript, which could be used to play a radio stream:

set volume 1 -- 0 to 7
say "wake up"
tell application "iTunes"
    activate
    set sound volume to 40 -- 0 to 100
    -- delay 15
    play track 1 of playlist "Radios"
end tell

lsalarm — Gist

I spent the last five hours writing this shell script. It uses uses pmset schedule to wake up the computer and launchctl to start an AppleScript like the one above. (I have no shell scripting skills, so it sucks at the moment. If anyone wants to fork the gist or republish a modified version then go ahead.)

Lri

Posted 2011-07-29T09:36:31.243

Reputation: 34 501

Goode idea. Coming from Unix, I didn't think of AppleScript. – loevborg – 2011-07-29T13:22:44.130

1

Try putting the internet radio station in the playlist after a few (perhaps 20 or so) 1 second "blank" tracks. You can often find these on CDs with a hidden track after a minute or so of silence. This should give your WiFi a chance to connect.

Chris Nava

Posted 2011-07-29T09:36:31.243

Reputation: 7 009