Hey all! So more testing shows that I was wrong. `buffer()` sounds like a 
solution to have proper transitions between live and playlists. Here's the 
example I'm testing:
```
# This is to make sure that we always do a fade transition:
def smart_crossfade (~start_next=5.,~fade_in=3.,~fade_out=3.,
                     ~default=(fun (a,b) -> sequence([a, b])),
                     ~high=-15., ~medium=-32., ~margin=4.,
                     ~width=2.,~conservative=true,s)
  fade.out = fade.out(type="sin",duration=fade_out)
  fade.in  = fade.in(type="sin",duration=fade_in)
  add = fun (a,b) -> add(normalize=false,[b, a])
  log = log(label="smart_crossfade")

  def transition(a,b,ma,mb,sa,sb)
    list.iter(fun(x)-> log(level=4,"Before: #{x}"),ma)
    list.iter(fun(x)-> log(level=4,"After : #{x}"),mb)
    log("Transition: crossed, fade-in, fade-out.")
    add(fade.out(sa),fade.in(sb))
  end

  smart_cross(width=width, duration=start_next, conservative=conservative,
              transition,s)
end

live = input.harbor("test")

live = buffer(fallible=true,buffer=10.,live)

pl = playlist("~/Music")

s = fallback(track_sensitive=false,[live,pl])

s = on_metadata(print,s)

s = smart_crossfade(s)
```

Couple things to note:
* The `buffer` needs to have data for both the transition in and out of the 
source. Here, we buffer `5.` seconds each time so I set it to `10.`. You can do 
more for good practice. Remember, though, that this will delay the time the 
live sources goes on the air by as much time.
* There was a slight bug preventing a proper `live->playlist` transition. It's 
fixed with the latest master

If any of y'all could test with the latest `master` that would be great. I'm 
leaving this open as I want to make sure this is in the doc somewhere before 
closing.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/savonet/liquidsoap/issues/695#issuecomment-459973087
_______________________________________________
Savonet-users mailing list
Savonet-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to