I've implemented a custom crossfade based from one of the examples. The
crossfade works great, but metadata updates to icecast always stop after the
second track is played. If I restart liquidsoap metadata updates will
resume, but will stop after the second track is played. Metadata updates
process as usual when I remove the crossfade code. I'm using a trunk version
of liquidsoap that's about 2 or three weeks old. Any theories? Here is a
snippet of the code:
def my_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=false,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)
if ma["crossfade"] == "yes" and mb["crossfade"] == "yes" then
add(fade.initial(type="sin", sb),fade.final(type="sin", sa))
else
log("No transition defined: using default.")
default(sa, sb)
end
end
smart_cross(width=width, duration=start_next,
conservative=conservative,transition,s)
end
live_broadcast = input.http(id="live_broadcast_url", buffer = 5.0, "http://
#{live_server}:#{live_port}#{live_mount}")
live_broadcast = nrj(live_broadcast)
local_playlist = playlist(id = "local_playlist", mode = "normal",
"content.m3u")
local_playlist =
request.dynamic(id="local_playlist",{request.create(get_process_output("#{track_script}
#{channel_id}"))})
local_playlist = rewrite_metadata(
[
("title", '$(if $(player_title),"$(player_title)","$(title)")'),
],
local_playlist)
local_broadcast = my_crossfade(conservative=true, local_playlist)
radio = fallback(
id="live_fallback",
track_sensitive=false,
transitions = [fade_to_live_source, fade_to_local_source],
[
strip_blank(id="live_strip_blank",length=30., live_broadcast),
local_broadcast]
)
------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric
Ries, the creator of the Lean Startup Methodology on "Lean Startup
Secrets Revealed." This video shows you how to validate your ideas,
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users