dox/html/darkice-to-icecast.html

131 lines
8.4 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<title>To stream any audio using darkice to apradio icecast server</title>
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
</style>
<style>
a.sourceLine { display: inline-block; line-height: 1.25; }
a.sourceLine { pointer-events: none; color: inherit; text-decoration: inherit; }
a.sourceLine:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode { white-space: pre; position: relative; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
code.sourceCode { white-space: pre-wrap; }
a.sourceLine { text-indent: -1em; padding-left: 1em; }
}
pre.numberSource a.sourceLine
{ position: relative; left: -4em; }
pre.numberSource a.sourceLine::before
{ content: attr(title);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; pointer-events: all; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
color: #aaaaaa;
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
a.sourceLine::before { text-decoration: underline; }
}
code span.al { color: #ff0000; font-weight: bold; } /* Alert */
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #7d9029; } /* Attribute */
code span.bn { color: #40a070; } /* BaseN */
code span.bu { } /* BuiltIn */
code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code span.ch { color: #4070a0; } /* Char */
code span.cn { color: #880000; } /* Constant */
code span.co { color: #60a0b0; font-style: italic; } /* Comment */
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code span.do { color: #ba2121; font-style: italic; } /* Documentation */
code span.dt { color: #902000; } /* DataType */
code span.dv { color: #40a070; } /* DecVal */
code span.er { color: #ff0000; font-weight: bold; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #40a070; } /* Float */
code span.fu { color: #06287e; } /* Function */
code span.im { } /* Import */
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #007020; font-weight: bold; } /* Keyword */
code span.op { color: #666666; } /* Operator */
code span.ot { color: #007020; } /* Other */
code span.pp { color: #bc7a00; } /* Preprocessor */
code span.sc { color: #4070a0; } /* SpecialChar */
code span.ss { color: #bb6688; } /* SpecialString */
code span.st { color: #4070a0; } /* String */
code span.va { color: #19177c; } /* Variable */
code span.vs { color: #4070a0; } /* VerbatimString */
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
</style>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="css/style.css"/>
</head>
<body>
<header id="title-block-header">
<h1 class="title">To stream any audio using darkice to apradio icecast server</h1>
</header>
<nav id="TOC">
<ul>
<li><a href="#create-a-null-audio-sink">Create a null audio sink</a></li>
<li><a href="#install-and-configure-darkice">Install and configure darkice</a></li>
<li><a href="#start-darkice">Start darkice</a></li>
<li><a href="#start-playing-your-audio">Start playing your audio</a></li>
<li><a href="#rtfm">RTFM</a></li>
</ul>
</nav>
<p>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.</p>
<h1 id="create-a-null-audio-sink">Create a null audio sink</h1>
<p>Enter <code>pactl load-module module-null-sink sink_name=stream</code> on the command line to create a virtual output named “stream” which doesnt actually point at a sound card, but allows other programs to capture that output before its 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 its audio input.</p>
<h1 id="install-and-configure-darkice">Install and configure darkice</h1>
<p>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.</p>
<p>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.</p>
<p>Only the relevant options in darkice.cfg are shown below. See a complete example <a href="./cfg/darkice.cfg">here</a>.</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode ini"><code class="sourceCode ini"><a class="sourceLine" id="cb1-1" title="1"><span class="kw">[input]</span></a>
<a class="sourceLine" id="cb1-2" title="2"><span class="dt">device </span><span class="ot">=</span><span class="st"> pulseaudio</span></a>
<a class="sourceLine" id="cb1-3" title="3"><span class="dt">sampleRate </span><span class="ot">=</span><span class="st"> </span><span class="dv">44100</span></a>
<a class="sourceLine" id="cb1-4" title="4"><span class="dt">bitsPerSample </span><span class="ot">=</span><span class="st"> </span><span class="dv">16</span></a>
<a class="sourceLine" id="cb1-5" title="5"><span class="dt">channel </span><span class="ot">=</span><span class="st"> </span><span class="dv">2</span></a>
<a class="sourceLine" id="cb1-6" title="6"><span class="dt">paSourceName </span><span class="ot">=</span><span class="st"> stream.monitor</span></a>
<a class="sourceLine" id="cb1-7" title="7"></a>
<a class="sourceLine" id="cb1-8" title="8"><span class="kw">[icecast2-0]</span></a>
<a class="sourceLine" id="cb1-9" title="9"><span class="dt">format </span><span class="ot">=</span><span class="st"> mp3</span></a>
<a class="sourceLine" id="cb1-10" title="10"><span class="dt">bitrateMode </span><span class="ot">=</span><span class="st"> vbr</span></a>
<a class="sourceLine" id="cb1-11" title="11"><span class="dt">quality </span><span class="ot">=</span><span class="st"> </span><span class="fl">0.8</span></a>
<a class="sourceLine" id="cb1-12" title="12"><span class="dt">server </span><span class="ot">=</span><span class="st"> radio.anarchyplanet.org</span></a>
<a class="sourceLine" id="cb1-13" title="13"><span class="dt">port </span><span class="ot">=</span><span class="st"> </span><span class="dv">8000</span></a>
<a class="sourceLine" id="cb1-14" title="14"><span class="dt">password </span><span class="ot">=</span><span class="st"> [secret password]</span></a>
<a class="sourceLine" id="cb1-15" title="15"><span class="dt">mountPoint </span><span class="ot">=</span><span class="st"> live</span></a>
<a class="sourceLine" id="cb1-16" title="16"></a></code></pre></div>
<h1 id="start-darkice">Start darkice</h1>
<p>Run <code>darkice -c darkice.cfg</code> from the command line. Darkice should now show up in the recording tab.</p>
<p>Change the audio source for darkice to <code>Monitor of Null Output.</code></p>
<h1 id="start-playing-your-audio">Start playing your audio</h1>
<p>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).</p>
<p>Change the audio output for your playback device audio to <code>Null Output.</code></p>
<h1 id="rtfm">RTFM</h1>
<ul>
<li><a href="https://chinmay.audio/blog/streaming-audio">https://chinmay.audio/blog/streaming-audio</a></li>
<li><a href="http://www.skyehaven.net/blog/2011/03/14/mumble-icecast/">http://www.skyehaven.net/blog/2011/03/14/mumble-icecast/</a></li>
</ul>
</body>
</html>