作者Tingyutony (踢踢歪)
看板WebRadio
标题[心得] 切换DJ
时间Tue Feb 6 13:04:55 2007
本篇适用於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)
1F:推 picadar:下次所有DJ可以轮流了 XDD 02/08 19:25
2F:推 novapig:很有用的资讯! 感激不尽~ 02/12 12:30