You are not logged in.
Pages: 1
I'm trying to set up an icecast source client for an internet radio station. In linux, I have a variety of options, but as far as I can tell they're all simple playlist-based players. I want to be able to schedule certain sets of music to play at exact times (10pm, 11pm, etc.). The only solution I've found is an expensive commercial application for Mac OS X. I'd like to use OSS on linux, and windows is out of the question. Does anyone know of a program that can do this? It doesn't necessarily have to be an icecast source client, since I can route the output of the scheduling program into a separate source client.
If necessary, I might be willing to write my own script to do this. If I take that route, what might be a good approach?
Offline
To be more specific, here's an example of what I'd want to do:
We have three playlists:
Playlist A: .m3u with 30 minutes worth of mp3s
Playlist B: .m3u with 45 minutes worth of mp3s
Playlist X: .m3u with lots of mp3s
Playlist X plays randomly around the clock
At 10pm, we switch from X to A. A plays all the way through. When we reach the end of A, we return to X playing in random order.
At 11pm, we switch from X to B. B plays all the way through. When we reach the end of B, we return to X playing in random order.
This would involve skipping out of X in mid-track, to give priority to A and B for playing at exact times.
Last edited by moire (2007-02-12 01:40:30)
Offline
maybe something like this, just put it in /etc/cron.hourly
#!/usr/bin/env python
import os, sys
from time import strftime,time,localtime
from subprocess import Popen
hour = strftime("%H", localtime(int(time())))
clone = sys.argv[0]
player = "/usr/bin/mpg321"
plists = {'15':'playlistA.m3u','23':'playlistB.m3u','X':'playlistX.m3u'}
if hour in plists:
plist = plists[hour]
Popen(['/usr/bin/killall','-9',clone],shell=False)
Popen([player,'-@',plist],shell=False).wait()
Popen([player,'-Z@',plists['X']],shell=False).pid
Last edited by noriko (2007-02-12 15:27:42)
The.Revolution.Is.Coming - - To fight, To hunger, To Resist!
Offline
If you used mpd with icecast as a sound ouput source. You could do something similar to what noriko suggested. Use a cron script to fire off mpc commands to stop and load another playlist at specified times.
Offline
Cool, I didn't realize it was so simple. Thanks for the help.
Offline
Also take a look at the "at" command - it's more flexible for one-time deals than cron. It may not be needed for this particular project, but it's very handy to know about.
Unthinking respect for authority is the greatest enemy of truth.
-Albert Einstein
Offline
Pages: 1