dox/md/darkice-to-icecast.md

2.6 KiB

title
To stream any audio using darkice to apradio icecast server

Some programs might have their own methods of streaming to Icecast. However, anything you can listen to on your computer you can stream to the apradio Icecast server.

Create a null audio sink

Enter pactl load-module module-null-sink sink_name=stream on the command line to create a virtual output named "stream" which doesn't actually point at a sound card, but allows other programs to capture that output before it's dumped. Pulseaudio creates a 'monitor' for that output which you can use as input for another program such as darkice. In this case it will be called "stream.monitor". Darkice will be using stream.monitor as it's audio input.

Install and configure darkice

The default systemwide darkice.cfg is at /etc/darkice.cfg. You can edit this but it's better to copy /etc/darkice.cfg somewhere else (e.g. ~/darkice/darkice.cfg) and use different darkice configurations for different streaming setups.

Configure darkice to send audio from the monitor of the newly-created output to the apradio icecast server. Most settings can be left as default.

Only the relevant options in darkice.cfg are shown below. See a complete example here.

[input]
device          = pulseaudio
paSourceName    = stream.monitor

[icecast2-0]
format          = vorbis
server          = radio.anarchyplanet.org
port            = 8000
password        = [secret password]
mountPoint      = source.ogg

Start darkice

Run darkice -c darkice.cfg from the command line. Darkice should now show up in the recording tab. Change the audio source for darkice to Monitor of Null Output.

Start playing your audio

This playback device should now show up in the Playback tab of the PulseAudio control panel. (For example, if you are playing audio in your browser, a new row should appear in the Playback tab showing your browser making sound). Change the audio output for your playback device audio to Null Output.

[TODO]{.todo .TODO} fix stream address

currently it's https://radio.anarchyplanet.org/icecast/stream.ogg

RTFM