Oh, I forgot, this will only with if you remove track marks on the live source, 
otherwise it would also cross-fade the live tracks, which will not work. Fixed 
script:

```
# 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 = merge_tracks(live)

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)
```



-- 
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-459973359
_______________________________________________
Savonet-users mailing list
Savonet-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to