Let's see how to stream a webradio. When you're on live, we play your voice. Otherwise, music will be played from a playlist.

We use icecast and mpd.

Setting up icecast and mpd

# pkg_add icecast mpd
# cp /usr/local/share/examples/icecast/icecast.xml.dist /var/icecast/icecast.xml

Edit icecast.xml:

<location>Sur Mars</location>
<!-- You may have multiple <listener> elements -->

Run icecast :

# rcctl enable icecast
# rcctl start icecast

Now edit /etc/mpd.conf :

music_directory      "/mnt/music"
# Pour icecast. Pensez à modifier le mot de passe
audio_output {
    type        "shout"
    encoding    "ogg"
    name        "My great radio"
    host        "localhost"
    port        "8000"
    mount       "/play.ogg"
    password    "greatpasspphrase"
    bitrate     "128"
    format      "44100:16:2"

Now run mpd :

# rcctl enable mpd
# rcctl start mpd

To deal with mpd and start playing, use mpc :

# pkg_add mpc

see man mpc.

Open port 8000.

Now try to play your radio on "http://athome.tld:8000/live.ogg".

Stream a live

We will stream on "/live.ogg", not on "/play.ogg".

You can stream with the well known VLC. Choose the menu Stream (ctrl-d), add a file of choose a device. When a destination is asked, choose Icecast.