I'm having a difficult time figuring this one out:

  this value has type
      [_]
    but it should be a subtype of (the type of the value at line 13, char
14)
      source(_) (infered at line 13, char 43)

I'm working with liquidsoap trunk and experimenting with transitions
suggested by Romain. What do you think I'm doing wrong?


set("log.level", 4)
set("log.file",false)
set("log.stdout",true)

# Custom crossfade
def my_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=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" or mb["crossfade"] == "yes" then

     # For the example here, let's put a crossfade:
     add([fade.initial(b),fade.final(a)]

   else
     log("No transition defined: using default.")
     default(sa, sb)
   end
 end

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

myplaylist = playlist(id = "main_source", mode = "normal", "content.m3u")
myplaylist = my_smart_crossfade(myplaylist)
backup = noise(id="white_noise")
radio = fallback([myplaylist, backup])

#input2 = request.dynamic(id=fluxid, fun () ->
request(get_process_output(cmd)))


output.icecast(
      %mp3(samplerate=22050, bitrate=128),
      host = "localhost",
      port = 8000,
      password = "hackme",
      mount = "/test.mp3",
      name = "Loudcaster",
      description = "My little channel",
      genre = "anything",
      url = "http://loudcaster.com";,
      restart = true,
      restart_delay = 10,
      radio)


-- 
=========================================
Brandon Casci
Loudcaster
http://loudcaster.com
=========================================
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to