Hi,

Totally beginner in LiquidSoap (I discovered it in LinuxMag), I'm trying to make a .liq and I have almost reached the end of what I want to do (I don't understand all the concept but the possibilities of this program are awesome and I think it deserves some headaches :) )

But I need your help on two things: (.liq below)

First, the delay:
I need to put a delay for live sessions (30 to 90 seconds) because we shoutcast some games and we want to reduce the delay with games TV servers for the listeners.

But the delay doesn't work. When I run my .liq with a delay of 30s, the first time live source is connected, the delay is only 5 seconds and the following are 15 to 25 seconds. The problem is that is never the same time.
Bug in the delay or is the method bad?


The second thing is switch:
I would like to do this: when playlists are changed with switch (with track_sensitive=false), I would like to skip the song of the previous playlist. I tried this

def start(a, b)
   source.skip(a)
   sequence([jingle, b])
end
# changement toutes les 30s pour tester
playlists = switch(track_sensitive=false,
                   [({0s-29s}, start(reggae, electro)),
                   ({30s-59s}, start(electro, reggae))])

with no success :/ If I remove source.skip, the jingle is played and the playlist too, but without a new song. I tried with fallback.skip and different combination too.

My question is, can I force to skip the song in start() with track_sensitive=false instead of true? I thought to do like the transition live->playlist (see below)

It's not primordial but I would like to know if it's possible. And it would be great if it could be only
                   [({0s-29s}, start(electro)),
                   ({30s-59s}, start(reggae))])

I hope I was clear, thanks in advance for your help and for creating LiquidSoap.

Bye.


#!/usr/bin/liquidsoap

host = "localhost"
port = 8080
pass = "***"
mountmp3 = "***.mp3"
mountogg = "***.ogg"
name ="***"

set("log.file.path", "/home/nvradio/log/liquidsoap.log")

set("harbor.bind_addr", "0.0.0.0")
set("harbor.port", 8000)
set("harbor.password", pass)
live = input.harbor("live.mp3")
# un délai de 30 secondes
live = delay(30., live)

### playlists suivant le style de musique
electro = mksafe(playlist(reload=3600, "/home/nvradio/mp3/electro/"))
reggae = mksafe(playlist(reload=3600, "/home/nvradio/mp3/reggae"))

### les jingles
jingle = playlist.safe("/home/nvradio/jingles/")

### transition live->playlist ###
# 1. passer au morceau suivant sur la playlist
# 2. jouer un jingle avant de lancer la playlist
def live2playlist(j, a, b)
   source.skip(b)
   sequence([j, b])
end

### transition playlist->live ###
# 1. fade out sur la playlist
# 2. lancement du live
def playlist2live(a, b)
   add(normalize=false,
       [sequence([blank(duration=.5), b]), fade.final(duration=1., a)])
end

### lancement des playlists ###
# un jingle comme intro, puis la playlist
def start(a)
   sequence([jingle, a])
end


### les playlists suivant les heures ###
# attendre la fin de la chanson avant de changer de playlist (track_sensitive=true)
# TOUTES LES 30 SECONDES POUR TEST
playlists = switch(track_sensitive=false,
                   [({0s-29s}, start(electro)),
                   ({30s-59s}, start(reggae))])

### la priorité des streams ###
radio = fallback(track_sensitive=false,
               transitions=[playlist2live, live2playlist(jingle)],
               [live, mksafe(playlists)])

radio = normalize(radio)
radio = compress(radio)

# envoyer le tout en ogg et mp3
output.icecast.vorbis(host=host, port=port, password=pass,
             mount=mountogg, name=name, restart=true, radio)
output.icecast.mp3(host=host, port=port, password=pass, bitrate=128,
          mount=mountmp3, name=name, restart=true, radio)


Reply via email to