ライン入力にFMラジオの出力をつなぎ、あとはキャスティングするだけ。
Webを検索するとShoutcastが簡単でよいらしい。
うまい事使うとapacheやffmpegでも出来そうではあるが、あんまり情報がない。
という事でshoutcastを使う事に。
サーバはShoutcastのホームページから次の二つのファイルをダウンロード。
$ mkdir shoutcast
$ cd shoutcast
$ wget http://yp.shoutcast.com/downloads/sc1-9-8/sc_serv_1.9.8_Linux.tar.gz
$ wget http://yp.shoutcast.com/downloads/sc_trans_posix_040.tgz
どうやらsc_servがラジオサーバでsc_transがラジオサーバに音を送り込む構造になっているらしい。
二つのファイルをtar -xvzf ほにゃららで解凍
サーバの実行ファイルは
sc_serv
設定ファイルは
sc_serv.conf
なので、これをいじって設定する。
基本でいじるところは意外と少ない。
$ vi sc_serv.conf
; CANNOT BE BLANK.
Password=honyarara
; console systems only)
RealTime=0
; running servers in background without their own terminals. Default is 1
ScreenLog=0
; of the source plug-in or of a SHOUTcast server that is being relayed.
PublicServer=never
ぐらい
パスワードを設定してコンソールに無駄な情報を表示しないように、そしてshoutcastのパブリックリストに載らないようにneverと設定。
サーバに音を送り込むソフトsc_transの設定
vi sc_trans.conf
; PlaylistFile (required EVEN IF RELAYING) - playlist file (to create, use
; find /path/to/mp3/directory -type f -name "*.mp3" > playlist_filename.lst
PlaylistFile=example.lst
; カレントにあるexample.lstに記述したファイルやDSPを配信する
; ServerIP/ServerPort are the target server to send to
ServerIP=192.168.0.7 ;sc_servの稼働するアドレスを記載
ServerPort=8000 ;sc_serv.confと同じに
; StreamTitle/URL/Genre define the data that appears on the directory and in the
; stream info.
StreamTitle=Streaming FM
StreamURL=http://raijin.ddo.jp
Genre=FMRadio
; 適当に(^^ゞ
; 96kbps stereo 96000/44100/2
; 128kbps stere0 128000/44100/2
Bitrate=96000
SampleRate=44100
Channels=2
; Quality is from 1-10. 1 is best, 10 is fastest.
Quality=1
;送り込む品質を決める。
そしてLine入力からのFMラジオの音を送るにはexample.lstの記載が大事
# the following 2 lines are sample playlist lines. you should replace them with
# actual mp3 files, being sure to adhere to all the content guidelines set forth in
# the .conf file!
#/home/sctrans/content/test_1.mp3
#/home/sctrans/content/test_2.mp3
DSP:/dev/dsp
そう、このDSP:/dev/dspの記載である。
初めDSP:を書かずに/dev/dspとしていたのでまったく配信されないで悩んだ・・・
ファイル内の説明を読んで設定したらおぉきちんと音が出る(^^)
起動は実行ファイルがあるディレクトリに移動して
./sc_serv &
./sc_trans_linux &
で配信される。
終了はプロセスIDを調べて
$ ps ax | grep sc_
kill 8923
とかやる。
参考ページ