Rebroadcasting streams on a schedule, shuffle and repeat
  • Vote Up1Vote Down muhoomuhoo
    Posts: 41Member
    I have a need for some features that I can't seem to figure out how to do in Airtime.

    1) Rebroadcast a stream on a schedule. i.e. to set up a show, and instead of adding a local playlist, add an m3u file or remote stream. I'd want to rebroadcast or repeat another streaming station, say, between 12AM and 6AM, then have other (local) shows scheduled at other times. Is there a way to do this inside Airtime?

    2) Shuffle a playlist randomly. To have a show that has a randomly-shuffled playlist of songs. For example, for times that a rebroadcast stream is not available or cuts out, I'd want to jukebox some songs from the local audio file library.

    3) Repeat a playlist endlessly, ideally with a re-shuffle  per the above. I'm looking for a way to fill in dead times with some shuffled music, unattended.

    These features are needed for a fully automated station that will want to rebroadcast other stations at scheduled times, run some scheduled shows at other times, and at still other times just run a shuffled filler playlist.

    Do they exist in Airtime? If so, where would I find them? If not, are they in the works?

    Thanks!
    Post edited by muhoo at 2012-07-07 04:02:41
  • 6 Comments sorted by
  • it's because this script is in the French section of the forum :)


    For the record ,
    it seems this script is not compatible with the "Liquidsoap Flow service" register script,
    when i try to use both tweak in the .liq file, Liquidsoap failed to start

    stream = register_flow(
      radio="My radio",
      description="The sound of my computer",
      genre="reggae",
      user="foo",
      password="bar",
      streams=[("mp3/128k","http://my.web.site/stream")],
      stream)



    Post edited by Fred Percevault at 2012-07-25 11:05:07
  • Hi!

    #1 is planned for 2.2, although we do not have a release date at the moment
    #2 is also planned for the future at the moment this looks like it may be included in 2.2
    #3 we call this a fallback playlist and currently have this scheduled for 2.3

    To tide you over in the meantime, I'd suggest you look at some modifications users have created in these forums. There is a 2 line change available that will allow you to point Liquidsoap (Airtime's playout engine) to a directory and randomly play tracks from that location during periods when nothing is scheduled. 
    Airtime Pro Hosting: http://airtime.pro
  • Vote Up0Vote Down muhoomuhoo
    Posts: 41Member
    Thanks. I ended up doing something along the lines of this:

    #!/usr/bin/liquidsoap

    %include "/usr/lib/airtime/pypo/bin/liquidsoap_scripts/library/pervasives.liq"

    # TODO: set up server port

    set("log.file.path","/var/log/liquidsoap/mystream.log")
    set("log.stdout", true)


    # check both drop and imported locations,
    # just in case something screws up via airtime
    jukebox = mksafe(random([playlist(reload=86400, "/home/drop"),
                             playlist(reload=86400, "/srv/airtime/stor")]))


    ## lifted from airtime
    def transition(a,b) =
        source.skip(a)
      # This eats the last remaining frame from a
      sequence([a,b])
    end


    #need this hack to deal with airtime shooting blanks when nothing scheduled!
    airtime= strip_blank(threshold=-80.0,
                         length=20.0,
                         input.http("http://localhost:8000/mystream_ogg"))


    final = fallback(track_sensitive=false,
                     transitions=[transition,transition],
                     [input.http("http://stream.somewhere.com:8050/stream"),
                      airtime,
                      jukebox])


    #TODO: better passwords!

    output.icecast(%vorbis,
                   host = "localhost",
                   port = 8000,
                   password = "donthackme",
                   mount = "stream.ogg",
                   genre = "Awesome",
                   url = "http://mystreamradio.somewhere.com",
                   final)

    output.alsa(final)


  • Vote Up0Vote Down AlexAlex
    Posts: 18Member
    Hey Martin,

      You mention a 2 line change available that will allow you to point Liquidsoap (Airtime's playout engine) to a directory and randomly play tracks from that location during periods when nothing is scheduled. 

      I have searched the forum for like 1/2 an hour for ls_script.liq edits that let me create a random playlist and I am having a hard time finding it. If you could post the 2 lines or a link I would be super appreciative. Can't wait for these features to make it into the front end in later versions.

    Cheers,
    Alex
  • Reply to @Fred+Percevault:

    Must be a simple mistake as they should be compatible with each other. Try running liquidsoap manually like so:

     sudo -u pypo /usr/lib/airtime/pypo/bin/airtime-liquidsoap

    and post the error output here.
    Airtime Pro Hosting: http://airtime.pro