Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'mp3 alarmclock?' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
mp3 alarmclock?
Authored by: Tiresias on Jan 22, '03 09:47:07PM

Anyone know how to implement this as an MP3 alarmclock? I've got mpg123 (commandline mp3 player) which I would like to use as an alarm in the morning but I haven't gotten it to work. My other option is to make it run "open musicfile.mp3" which will automatically open in iTunes due to the nature of open. This method isn't acceptable because I can't get a random mp3 to play or a list of mp3s to play like I could do with mpg123.

[ Reply to This | # ]
mp3 alarmclock?
Authored by: tcurtin on Jan 22, '03 11:38:17PM

Check out this previous article here - the poster included a bash script that will run itunes and tell it to play from a playlist. You can pretty easily adapt what you get from the script to your own nefarious purposes. ;)

For instance, I put the following line (all one line) into my .cshrc file in my home directory:
alias music 'echo tell application \"Itunes\" to play \(some track of playlist \"Library\"\) | /usr/bin/osascript; echo tell application \"Finder\" to set visible of process \"itunes\" to false | /usr/bin/osascript'

Once you add that line, quit Terminal, and when you restart it you can type 'music' in any terminal window, and itunes starts up, plays a random track, and hides itself. I'm used to writing scripts in perl and sh - AppleScript is taking a while to get used to, but this makes a good start!

Good luck,

[ Reply to This | # ]
mp3 alarmclock?
Authored by: GEllenburg on Jan 23, '03 07:21:45AM


I do this all the time. Note though, my iTunes folder is not in my Library folder, it's on an NFS share on my file-server, so you'll need to modify the path below to reference where YOUR iTunes folder is:

% at 7:10<Return>
/sw/bin/mpg123 -a CoreAudio -os "/mnt/athlon/stuff/music/Soundtrack/The Sopranos/01 A3 - Woke Up This Morning.mp3"

This will play the theme song to The Soprano's at 7:10am.

Of course, one could do the same by adding a line to their crontab by typing:

% crontab -e<Return>


0 5 * * * /sw/bin/mpg123 -a CoreAudio -os "/mnt/athlon/stuff/music/Soundtrack/The Sopranos/01 A3 - Woke Up This Morning.mp3"

Hope this helps.

[ Reply to This | # ]