set("server.telnet.bind_addr","127.0.0.1") set("server.telnet",true)
#!/usr/local/bin/liquidsoap # создаём переменные быстрого исправления в одном месте по необходимости # базовая информация о выводимом потоке out = output.icecast( # хост с icecast host = "192.168.56.1", # его порт port = , # логин user = "", # и пароль password = "", # и всякое разное # название name = "Поток для форума", # жанр genre = "NON-STOP music", # ссылка на сайт url = "http://", # кодировка encoding = "UTF-8" ) # _____________________________________ # абсолютный путь к рабочей директории wd = "/home/stream/radio/radioFORUM" # путь к папке с коллекцией pl = "#{wd}/collection" # техническая папка tech = "#{wd}/technical" # логи set("log.file.path","#{tech}/liquidsoap.log") set("log.level", 3) # папка с объявлениями promo_dir = "#{pl}/promo" # папка с программами program_dir = "#{pl}/programs" # папка с коллекцией временных вставок #clock_dir = "#{pl}/clock" # папка с изменяющимся эфиром ef = "#{pl}/efir" # папки соответствующих эфиров ni = "#{ef}/night" mo = "#{ef}/morning" da = "#{ef}/daytime" ev = "#{ef}/evening" F1 = "#{wd}/FORUM/9-11" F2 = "#{wd}/FORUM/14-16" F3 = "#{wd}/FORUM/18-20" # папки с музыкой mus_ni_dir = "#{ni}/music" mus_mo_dir = "#{mo}/music" mus_da_dir = "#{da}/music" mus_ev_dir = "#{ev}/music" mus_F1_dir = "#{F1}/music" mus_F2_dir = "#{F2}/music" mus_F3_dir = "#{F3}/music" # папки с джинглами jin_ni_dir = "#{ni}/jingles" jin_mo_dir = "#{mo}/jingles" jin_da_dir = "#{da}/jingles" jin_ev_dir = "#{ev}/jingles" jin_F1_dir = "#{F1}/jingles" jin_F2_dir = "#{F2}/jingles" jin_F3_dir = "#{F3}/jingles" # _____________________________________ # загружаем плейлисты, джинглы, новости и всё такое mus_ni = playlist (reload = 360, "#{mus_ni_dir}") mus_mo = playlist (reload = 360, "#{mus_mo_dir}") mus_da = playlist (reload = 360, "#{mus_da_dir}") mus_ev = playlist (reload = 360, "#{mus_ev_dir}") mus_F1 = playlist (reload = 360, "#{mus_F1_dir}") mus_F2 = playlist (reload = 360, "#{mus_F2_dir}") mus_F3 = playlist (reload = 360, "#{mus_F3_dir}") jin_ni = playlist (reload = 360, "#{jin_ni_dir}") jin_mo = playlist (reload = 360, "#{jin_mo_dir}") jin_da = playlist (reload = 360, "#{jin_da_dir}") jin_ev = playlist (reload = 360, "#{jin_ev_dir}") jin_F1 = playlist (reload = 360, "#{jin_F1_dir}") jin_F2 = playlist (reload = 360, "#{jin_F2_dir}") jin_F3 = playlist (reload = 360, "#{jin_F3_dir}") program = playlist (reload = 360, "#{program_dir}") promo = playlist (reload = 360, "#{promo_dir}") #clock_0 = single ("#{clock_dir}/jingleT_0.mp3") #clock_1 = single ("#{clock_dir}/jingleT_1.mp3") #clock_2 = single ("#{clock_dir}/jingleT_2.mp3") #clock_3 = single ("#{clock_dir}/jingleT_3.mp3") #clock_4 = single ("#{clock_dir}/jingleT_4.mp3") #clock_5 = single ("#{clock_dir}/jingleT_5.mp3") #clock_6 = single ("#{clock_dir}/jingleT_6.mp3") #clock_7 = single ("#{clock_dir}/jingleT_7.mp3") #clock_8 = single ("#{clock_dir}/jingleT_8.mp3") #clock_9 = single ("#{clock_dir}/jingleT_9.mp3") #clock_10 = single ("#{clock_dir}/jingleT_10.mp3") #clock_11 = single ("#{clock_dir}/jingleT_11.mp3") #clock_12 = single ("#{clock_dir}/jingleT_12.mp3") #clock_13 = single ("#{clock_dir}/jingleT_13.mp3") #clock_14 = single ("#{clock_dir}/jingleT_14.mp3") #clock_15 = single ("#{clock_dir}/jingleT_15.mp3") #clock_16 = single ("#{clock_dir}/jingleT_16.mp3") #clock_17 = single ("#{clock_dir}/jingleT_17.mp3") #clock_18 = single ("#{clock_dir}/jingleT_18.mp3") #clock_19 = single ("#{clock_dir}/jingleT_19.mp3") #clock_20 = single ("#{clock_dir}/jingleT_20.mp3") #clock_21 = single ("#{clock_dir}/jingleT_21.mp3") #clock_22 = single ("#{clock_dir}/jingleT_22.mp3") #clock_23 = single ("#{clock_dir}/jingleT_23.mp3") # _____________________________________ # строим 4 потока, сразу всё перемешивая # смешиваем вставки ins_ni = rotate (weights = [2, 1, 1], [jin_ni, program, promo]) ins_mo = rotate (weights = [2, 1, 1], [jin_mo, program, promo]) ins_da = rotate (weights = [2, 1, 1], [jin_da, program, promo]) ins_ev = rotate (weights = [2, 1, 1], [jin_ev, program, promo]) # смешиваем вставки и потоки rot_ni = rotate (weights = [1, 1], [mus_ni, ins_ni]) rot_mo = rotate (weights = [3, 1], [mus_mo, ins_mo]) rot_da = rotate (weights = [3, 1], [mus_da, ins_da]) rot_ev = rotate (weights = [3, 1], [mus_ev, ins_ev]) rot_F1 = rotate (weights = [3, 1], [mus_F1, jin_F1]) rot_F2 = rotate (weights = [3, 1], [mus_F2, jin_F2]) rot_F3 = rotate (weights = [3, 1], [mus_F3, jin_F3]) #_______________________________________________________________________ radio = switch (track_sensitive = true, [ ({ 2h - 6h }, rot_ni), ({ 6h - 9h }, rot_mo), ({ 9h - 11h }, rot_F1), ({ 11h - 14h }, rot_da), ({ 14h - 16h }, rot_F2), ({ 16h - 18h }, rot_da), ({ 18h - 20h }, rot_F3), ({ 20h - 2h }, rot_ev) ]) #_______________________________________________________________________ # делаем красивые вхождения. crossfade оставим на будущее, посмотрим на звучание smart_crossfade radio = crossfade(start_next=1., fade_out=1., fade_in=1., radio) # запускаем вещалку out( %mp3(bitrate = 256, id3v2 = true), description = "MP3 256 Kbps", mount = "Radio_for_Forum", mksafe(radio) )
radio = crossfade(start_next=1., fade_out=1., fade_in=1., radio)
mus_ni = playlist (reload = 360, "#{mus_ni_dir}")