3

I'd attempting to schedule a liquidsoap streaming source to be played at a specific date and time in the future. I believe this can be accomplished using the Liquidsoap switch command but I'm having trouble understanding the documentation for it described here: http://liquidsoap.fm/doc-1.2.0/reference.html#switch

Is this possible using liquidsoap? I'd be nice if I could simply pass a timestamp.

Adam Soffer
  • 1,614
  • 5
  • 20
  • 36
  • Are you saying that Liquidsoap is running all the time and you want to switch to a different source at a specific time? Or, you want to fire up a Liquidsoap instance at a specific time? – Brad Apr 19 '16 at 23:36
  • 1
    Good question. I do see that Liquidsoap offers a socket interface so I guess I could create a new stream at a specific time without restarting the server. I'm just not sure what's considered best practice. – Adam Soffer Apr 20 '16 at 18:46
  • Big picture, I want to create a web interface for users to upload playlists and specify a date and time for liquidsoap to begin playing those playlists at separate mountpoints. – Adam Soffer Apr 20 '16 at 18:52
  • 1
    If it's at different mount points, I would run them all as separate instances. That way if/when they crash, it's isolated. Plus, you don't want one users' script to be able to affect another. How you schedule this is easy. You're just executing a she'll command. You could even use cron, but you'll probably want to write a supervisor process within your application. – Brad Apr 20 '16 at 19:40
  • That makes sense. Thank you! – Adam Soffer Apr 20 '16 at 20:52

1 Answers1

5

I'm not sure you can pass an absolute timestamp to switch, you can pass a time of day or week. See the "Time Intervals" section: https://www.liquidsoap.info/doc-1.4.0/language.html#time-intervals

I think your best bet is using a playlist file that is rewritten via cron, or using request.dynamic with a custom external script that determines what to play based on the time.

See the documentation for playlist here: https://www.liquidsoap.info/doc-1.4.0/reference.html#playlist

Bigue Nique
  • 381
  • 2
  • 5
freedrull
  • 2,194
  • 4
  • 21
  • 33
  • Regarding `request.dynamic`, given that it takes some time to load files via Liquidsoap - what is the idea to schedule something at some *exact* time, eliminating any delays produced by the scheduling itself? – david Feb 14 '20 at 11:43