Advertisement
andydurant

Jukebox Liquidsoap

Jun 14th, 2012
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.45 KB | None | 0 0
  1. #!/usr/local/bin/liquidsoap -v
  2.  
  3. # Launched 2012-01-27 00:36
  4.  
  5. set("log.stdout",true)
  6. #set("log.level",4)
  7. #set("server.telnet.bind_addr", "")
  8. set("server.telnet", true)
  9. set("log.file", true)
  10. set("log.file.path","/var/log/uryjukebox.log")
  11.  
  12. # Interlude for sound break
  13. interludelong = mksafe(single("/jukebox/intermission-long.mp3"))
  14. interludelong = crossfade(start_next=2., fade_in=1.2, fade_out=1.2, interludelong)
  15. techdiff = mksafe(single("/jukebox/TechnicalDifficultiesVoice.mp3"))
  16. techlude = add([interludelong, switch([({0s}, techdiff)])])
  17.  
  18. # Jingles every 15min~ish
  19. jingles = mksafe(playlist(mode="randomize", reload=3600, "/jukebox/jingles"))
  20. jingles = delay(900. , jingles)
  21.  
  22. # Playlists - Change to ratios - A=4,B=3,CDN=1 (but maybe more N as playlists are not very long)
  23. # A list every 10min~ish
  24. alist = playlist(mode="randomize", "/etc/liquidsoap/playlists/a-list.pls", mime_type="application/xspf+xml")
  25. alist = delay(600. , alist)
  26. # B list
  27. #blist = playlist(mode="randomize", "/etc/liquidsoap/playlists/b-list.pls", mime_type="application/xspf+xml")
  28. #blist = delay(600. , blist)
  29. # C list
  30. #clist = playlist(mode="randomize", "/etc/liquidsoap/playlists/c-list.pls", mime_type="application/xspf+xml")
  31. #clist = delay(600. , clist)
  32. # D list
  33. #dlist = playlist(mode="randomize", "/etc/liquidsoap/playlists/d-list.pls", mime_type="application/xspf+xml")
  34. #dlist = delay(600. , dlist)
  35.  
  36.  
  37. # Main requests queue from Web API/Interface
  38. requests = request.queue(id="jukebox_requests")
  39.  
  40. # Normal playlist is the default
  41. default = playlist(mode="randomize", "/etc/liquidsoap/playlists/normal-list.pls", mime_type="application/xspf+xml")
  42.  
  43. # Watershed only between 11pm and 4am
  44. watershed = playlist(mode="randomize", "/etc/liquidsoap/playlists/watershed.pls", mime_type="application/xspf+xml")
  45. watershed = switch([({23h-4h}, watershed)])
  46. default = random(weights=[1,3], [watershed, default])
  47.  
  48. # Super Campus Jukebox jingles every 30min
  49. cjjingle = mksafe(playlist(mode="randomize", reload=3600, "/jukebox/cj-jingles"))
  50. cjjingle = delay(1800., cjjingle)
  51.  
  52. # Jukebox radio
  53. jukebox = fallback([cjjingle, jingles, requests, alist, default])
  54. jukebox = fallback(track_sensitive=false, [jukebox, techlude])
  55.  
  56. # Avoid too much blank/silence in tracks
  57. jukebox = skip_blank(length=3., jukebox)
  58.  
  59. # Apply replay gain
  60. jukebox = amplify(1.,override="replay_gain",jukebox)
  61.  
  62. # Add in some crossfade
  63. jukebox = smart_crossfade(start_next=5., fade_in=3., fade_out=3., jukebox, conservative=true)
  64.  
  65. # Output to soundcards
  66. output.alsa(device="hw:0,0", jukebox, start=true)
  67.  
  68. # Icecast outputs use a seperate clock to remove lag from the ALSA output
  69. clock.assign_new(id="jukebox",
  70. [output.icecast(
  71. %mp3(bitrate=192, samplerate=44100, stereo=true),
  72. host="icecast",
  73. port=7070,
  74. password="<omitted>",
  75. mount="jukebox",
  76. start=true,
  77. url="http://ury.org.uk",
  78. description="UK's oldest legal independant radio station",
  79. name="URY Jukebox",
  80. genre="Student Radio",
  81. mksafe(buffer(jukebox)))])
  82.  
  83. # Campus Playout Stream - adds studios when needed
  84. studio_stream = input.harbor(
  85. "studio-stream-harbor",
  86. password="<omitted>",
  87. )
  88.  
  89. campus_playout = fallback(track_sensitive=false, [studio_stream, jukebox])
  90. #campus_playout = smart_crossfade(fade_in=3., fade_out=3., campus_playout) ## This causes the stream to speed up. ?!?
  91.  
  92. # icecast clock
  93. clock.assign_new(id="campus-playout",
  94. [output.icecast(
  95. %mp3(bitrate=192, samplerate=44100, stereo=true),
  96. host="icecast",
  97. port=7070,
  98. password="<omitted>",
  99. mount="campus-playout",
  100. start=true,
  101. url="http://ury.org.uk",
  102. description="The UK's oldest legal independant radio station.",
  103. name="URY Campus Playout",
  104. genre="Student Radio",
  105. mksafe(buffer(campus_playout)))])
  106.  
  107. # Outside Broadcast Stream
  108. # To do: Change this to a harbor, requires external jukebox access
  109. #ob_stream = input.http("<omitted>")
  110.  
  111. #ob = fallback(track_sensitive=false, [ strip_blank(length=30.,ob_stream), techlude])
  112.  
  113. # icecast clock
  114. #clock.assign_new(id="OB_line",
  115. #[output.icecast(
  116. # %mp3(bitrate=192, samplerate=44100, stereo=true),
  117. # host="icecast",
  118. # port=7070,
  119. # password="<omitted>",
  120. # mount="OB_line",
  121. # start=true,
  122. # url="http://ury.org.uk",
  123. # description="((URY)) Outside Broadcast Feed - internal use only",
  124. # name="URY Outside Broadcast Feed",
  125. # genre="Student Radio",
  126. # mksafe(buffer(ob)))])
  127. #
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement