shoutcast.liq 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. %ifdef output.icecast
  2. # Output to shoutcast.
  3. # @category Source / Output
  4. # @param ~id Output's ID
  5. # @param ~start Start output threads on operator initialization.
  6. # @param ~user User for shout source connection. Useful only in special cases, like with per-mountpoint users.
  7. # @param ~icy_reset Reset shoutcast source buffer upon connecting (necessary for NSV).
  8. # @param ~dumpfile Dump stream to file, for debugging purpose. Disabled if empty.
  9. # @param ~fallible Allow the child source to fail, in which case the output will be (temporarily) stopped.
  10. # @param ~on_start Callback executed when outputting starts.
  11. # @param ~on_stop Callback executed when outputting stops.
  12. # @param ~on_error Callback executed when an error happens. If returned value is positive, connection wll be tried again after this amount of time (in seconds).
  13. # @param ~on_connect Callback executed when connection starts.
  14. # @param ~on_disconnect Callback executed when connection stops.
  15. # @param ~icy_metadata Send new metadata using the ICY protocol. One of: "guess", "true", "false"
  16. # @param ~format Format, e.g. "audio/ogg". When empty, the encoder is used to guess.
  17. # @param e Endoding format. For shoutcast, should be mp3 or AAC(+).
  18. # @param s The source to output
  19. def output.shoutcast(
  20. ~id="output.shoutcast",~start=true,
  21. ~host="localhost",~port=8000,
  22. ~user="source",~password="hackme",
  23. ~genre="Misc",~url="http://savonet.sf.net/",
  24. ~name="Liquidsoap Radio!",~public=true, ~format="",
  25. ~dumpfile="", ~icy_metadata="guess",
  26. ~on_connect={()}, ~on_disconnect={()},
  27. ~aim="",~icq="",~irc="",~icy_reset=true,
  28. ~fallible=false,~on_start={()},~on_stop={()},
  29. ~on_error=fun(_)->3., e,s) =
  30. icy_reset = if icy_reset then "1" else "0" end
  31. headers = [("icy-aim",aim),("icy-irc",irc),
  32. ("icy-icq",icq),("icy-reset",icy_reset)]
  33. output.icecast(
  34. e, format=format,
  35. id=id, headers=headers,
  36. start=start,icy_metadata=icy_metadata,
  37. on_connect=on_connect, on_disconnect=on_disconnect,
  38. host=host, port=port, user=user, password=password,
  39. genre=genre, url=url, description="UNUSED",
  40. public=public, dumpfile=dumpfile,encoding="ISO-8859-1",
  41. name=name, mount="/", protocol="icy",on_error=on_error,
  42. fallible=fallible,on_start=on_start,on_stop=on_stop,
  43. s)
  44. end
  45. %endif