[心得] 切換DJ

看板WebRadio作者 (踢踢歪)時間18年前 (2007/02/06 13:04), 編輯推噓2(200)
留言2則, 2人參與, 最新討論串1/1
本篇適用於SAM+SHOUTcast使用者。 這是一個PAL Script,在SAM的討論區找來的, 用處在於不同DJ要接手伺服器時,可以順利的切換到另一位DJ, 不會發生中斷現象。 運作原理簡單來說... 用這個pal script的人 1.共用同一台shoutcast server 2.互相知道密碼 所以使用這個pal script, 可以直接把現在在線上的DJ踢掉(kill source) 接下來他自動會幫你連上(預設是第一個encoder) 要修改的部分有 const shoutcast_password = 'changeme'; ←請把密碼換掉 const shoutcast_host = 'localhost';←IP設定(SHOUTcast在本機就不動) const shoutcast_port = '8000'; ←請把port換成你設定的port 另外這裡預設是啟動第一個encoder 如果一次要啟動所有encoder 請把 Encoders[0].Start; 用{}框起來 (0代表第一個encoder) Encoders.StartAll;則不要用{}框起來 程式碼如下,請複製存成xxx.pal (我存成switchDJ.pal) 或是從這裡下載修改 http://0rz.tw/c02oi 在SAM的Desktop B, 有個小視窗便是PAL scripts,按+就可以加入這個script。 {Switching DJ's A lot of stations have more than one DJ operating the station, most of the time these DJ's are spread across the world. They employ a nifty trick to switch between DJ sessions. If you new DJ wishes to start their session, they log into the SHOUTcast admin panel and kick the current DJ's encoder, and then quickly connect with their own encoder. The following PAL script can completely automate this process:} { About: This script will disconnect any source connected to a SHOUTcast server and then connects this SAM Broadcaster as the new source. Usage: a) Create a single MP3 encoder to connect to the SHOUTcast server. b) Supply your SHOUTcast server details in the configuration section below c) Use the Event Scheduler to start this PAL script at the correct time. } { CONFIGURATION } {==================================================} const shoutcast_password = 'changeme'; const shoutcast_host = 'localhost'; const shoutcast_port = '8000'; {==================================================} { IMPLEMENTATION } {--------------------------------------------------} { Build URL used to send command to SHOUTcast server } var URL : String; URL := 'http://admin:'+shoutcast_password+'@'+shoutcast_host+':'+shoutcast_port+'/admin.cgi?mode=kicksrc'; { Kick source from SHOUTcast server } WebToFile('c:\dummy.txt',URL); { Now start & connect all encoders } { NOTE: This assumes you only have one encoder Encoders.StartAll; } {TIP: Use this to start a specific encoder:} Encoders[0].Start; {--------------------------------------------------} -- ▃▄▆◤▃▄▆◣ ▁ ◢ ▉ ▉ ▌ ◥◣ ◢◤ http://radio.douzo.net/ ▃▆◤ ◥◢◤ 一個讓你享受點歌樂趣的世界。 ▌ ▌ ▋ ◢◤◣ ▍ ▍ ◥▄◤◢◤ ◥█◣的小世界。夜夜伴你入睡的好聲音。 ﹊﹉﹉﹊﹊﹊﹉﹉﹉﹊﹊﹉﹊﹉﹊﹉﹊﹊﹊﹊﹉﹊﹉﹊﹉﹊﹊﹉﹊﹊﹊﹉﹊ ζTTYζ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.119.73.222 ※ 編輯: Tingyutony 來自: 140.119.73.222 (02/07 09:41)

02/08 19:25, , 1F
下次所有DJ可以輪流了 XDD
02/08 19:25, 1F

02/12 12:30, , 2F
很有用的資訊! 感激不盡~
02/12 12:30, 2F
文章代碼(AID): #15o0nw5- (WebRadio)
文章代碼(AID): #15o0nw5- (WebRadio)