<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: recording from PulseAudio</title>
	<atom:link href="http://www.outflux.net/blog/archives/2009/04/19/recording-from-pulseaudio/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.outflux.net/blog/archives/2009/04/19/recording-from-pulseaudio/</link>
	<description>code is freedom -- patching my itch</description>
	<lastBuildDate>Tue, 24 Jan 2012 19:58:01 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
	<item>
		<title>By: Al Williams</title>
		<link>http://www.outflux.net/blog/archives/2009/04/19/recording-from-pulseaudio/comment-page-1/#comment-1112</link>
		<dc:creator>Al Williams</dc:creator>
		<pubDate>Tue, 12 Jul 2011 20:24:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.outflux.net/blog/?p=184#comment-1112</guid>
		<description>Just what I was looking for. I did make a slight change:

#!/bin/bash
WAV=&quot;$1&quot;
if [ -z &quot;$WAV&quot; ]; then
   echo 1&gt;&amp;2 Usage: pa-rec wavefile
    exit 1
fi
rm -f &quot;$WAV&quot;
# Get sink monitor:
MONITORS=$(pactl list &#124; egrep -A2 &#039;^(\*\*\* )?Source #&#039; &#124; grep &#039;Name: .*\.monitor$&#039; &#124; awk &#039;{print  $NF &quot; &quot;  $NF  }&#039;)
MONITOR=$(kdialog --menu &quot;Select Monitor:&quot; $MONITORS)
echo &quot;set-source-mute ${MONITOR} false&quot; &#124; pacmd &gt;/dev/null
# Record it raw, and convert to a wav
echo &quot;Recording $MONITOR to $WAV ...&quot;
echo &quot;^C to stop&quot;
parec -d $MONITOR &#124; sox -t raw -r 44k -sLb 16 -c 2 - $WAV



Obviously I use KDE.</description>
		<content:encoded><![CDATA[<p>Just what I was looking for. I did make a slight change:</p>
<p>#!/bin/bash<br />
WAV=&#8221;$1&#8243;<br />
if [ -z "$WAV" ]; then<br />
   echo 1&gt;&amp;2 Usage: pa-rec wavefile<br />
    exit 1<br />
fi<br />
rm -f &#8220;$WAV&#8221;<br />
# Get sink monitor:<br />
MONITORS=$(pactl list | egrep -A2 &#8216;^(\*\*\* )?Source #&#8217; | grep &#8216;Name: .*\.monitor$&#8217; | awk &#8216;{print  $NF &#8221; &#8221;  $NF  }&#8217;)<br />
MONITOR=$(kdialog &#8211;menu &#8220;Select Monitor:&#8221; $MONITORS)<br />
echo &#8220;set-source-mute ${MONITOR} false&#8221; | pacmd &gt;/dev/null<br />
# Record it raw, and convert to a wav<br />
echo &#8220;Recording $MONITOR to $WAV &#8230;&#8221;<br />
echo &#8220;^C to stop&#8221;<br />
parec -d $MONITOR | sox -t raw -r 44k -sLb 16 -c 2 &#8211; $WAV</p>
<p>Obviously I use KDE.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kees</title>
		<link>http://www.outflux.net/blog/archives/2009/04/19/recording-from-pulseaudio/comment-page-1/#comment-1100</link>
		<dc:creator>kees</dc:creator>
		<pubDate>Wed, 06 Apr 2011 20:01:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.outflux.net/blog/?p=184#comment-1100</guid>
		<description>Thanks for the updates! I&#039;ve adjusted the script for new &quot;pactl list&quot; output and added the unmuting.</description>
		<content:encoded><![CDATA[<p>Thanks for the updates! I&#8217;ve adjusted the script for new &#8220;pactl list&#8221; output and added the unmuting.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eric</title>
		<link>http://www.outflux.net/blog/archives/2009/04/19/recording-from-pulseaudio/comment-page-1/#comment-1095</link>
		<dc:creator>eric</dc:creator>
		<pubDate>Sun, 06 Mar 2011 22:05:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.outflux.net/blog/?p=184#comment-1095</guid>
		<description>Very useful script.
On my machine I had to insert these lines before recording:

# Unmute monitor :
echo &quot;set-source-mute ${MONITOR} false&quot; &#124; pacmd

Without them I was just recording silence..</description>
		<content:encoded><![CDATA[<p>Very useful script.<br />
On my machine I had to insert these lines before recording:</p>
<p># Unmute monitor :<br />
echo &#8220;set-source-mute ${MONITOR} false&#8221; | pacmd</p>
<p>Without them I was just recording silence..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kaapstorm</title>
		<link>http://www.outflux.net/blog/archives/2009/04/19/recording-from-pulseaudio/comment-page-1/#comment-1071</link>
		<dc:creator>kaapstorm</dc:creator>
		<pubDate>Sun, 16 Jan 2011 20:38:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.outflux.net/blog/?p=184#comment-1071</guid>
		<description>(Sorry about that. That regex should be &quot;^Source&quot;, not &quot;^\Source&quot;. The &quot;\&quot; will be ignored, so it doesn&#039;t really matter. But I&#039;m picky.)</description>
		<content:encoded><![CDATA[<p>(Sorry about that. That regex should be &#8220;^Source&#8221;, not &#8220;^\Source&#8221;. The &#8220;\&#8221; will be ignored, so it doesn&#8217;t really matter. But I&#8217;m picky.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kaapstorm</title>
		<link>http://www.outflux.net/blog/archives/2009/04/19/recording-from-pulseaudio/comment-page-1/#comment-1070</link>
		<dc:creator>kaapstorm</dc:creator>
		<pubDate>Sun, 16 Jan 2011 20:36:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.outflux.net/blog/?p=184#comment-1070</guid>
		<description>pactl found in Ubuntu 10.10 (Maverick) has slightly different output. Change lines 10 and 11 to:

MONITOR=$(pactl list &#124; grep -A2 &#039;^\Source &#039; &#124; \
        grep &#039;Name: .*\.monitor$&#039; &#124; cut -d&quot; &quot; -f2)</description>
		<content:encoded><![CDATA[<p>pactl found in Ubuntu 10.10 (Maverick) has slightly different output. Change lines 10 and 11 to:</p>
<p>MONITOR=$(pactl list | grep -A2 &#8216;^\Source &#8216; | \<br />
        grep &#8216;Name: .*\.monitor$&#8217; | cut -d&#8221; &#8221; -f2)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: josef</title>
		<link>http://www.outflux.net/blog/archives/2009/04/19/recording-from-pulseaudio/comment-page-1/#comment-1034</link>
		<dc:creator>josef</dc:creator>
		<pubDate>Sun, 10 Oct 2010 10:11:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.outflux.net/blog/?p=184#comment-1034</guid>
		<description>pactl is a localised application so you should call it with LANG=C.</description>
		<content:encoded><![CDATA[<p>pactl is a localised application so you should call it with LANG=C.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jahil</title>
		<link>http://www.outflux.net/blog/archives/2009/04/19/recording-from-pulseaudio/comment-page-1/#comment-1003</link>
		<dc:creator>Jahil</dc:creator>
		<pubDate>Wed, 18 Aug 2010 07:53:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.outflux.net/blog/?p=184#comment-1003</guid>
		<description>Can we do same thing with ffmpeg?</description>
		<content:encoded><![CDATA[<p>Can we do same thing with ffmpeg?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Youch</title>
		<link>http://www.outflux.net/blog/archives/2009/04/19/recording-from-pulseaudio/comment-page-1/#comment-1001</link>
		<dc:creator>Youch</dc:creator>
		<pubDate>Sun, 15 Aug 2010 15:17:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.outflux.net/blog/?p=184#comment-1001</guid>
		<description>Thank you for this script !
I added the ability to start when a sound occurs and to split in multiple files after 2s of silence. Just replace the line begining with &quot;parec -d &quot;$MONITOR&quot; &#124; sox...&quot; with this one :
parec -d &quot;$MONITOR&quot; &#124; sox -t raw -r 44100 -sLb 16 -c 2 - &quot;$WAV&quot; silence 1 0.50 0.1% 1 2.0 0.1% : newfile : restart</description>
		<content:encoded><![CDATA[<p>Thank you for this script !<br />
I added the ability to start when a sound occurs and to split in multiple files after 2s of silence. Just replace the line begining with &#8220;parec -d &#8220;$MONITOR&#8221; | sox&#8230;&#8221; with this one :<br />
parec -d &#8220;$MONITOR&#8221; | sox -t raw -r 44100 -sLb 16 -c 2 &#8211; &#8220;$WAV&#8221; silence 1 0.50 0.1% 1 2.0 0.1% : newfile : restart</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Smith</title>
		<link>http://www.outflux.net/blog/archives/2009/04/19/recording-from-pulseaudio/comment-page-1/#comment-821</link>
		<dc:creator>Ben Smith</dc:creator>
		<pubDate>Thu, 14 Jan 2010 16:24:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.outflux.net/blog/?p=184#comment-821</guid>
		<description>Thanks so much.  I just wasted a bunch of time trying to do this the wrong way and it is such a relief to have found your solution.</description>
		<content:encoded><![CDATA[<p>Thanks so much.  I just wasted a bunch of time trying to do this the wrong way and it is such a relief to have found your solution.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kees</title>
		<link>http://www.outflux.net/blog/archives/2009/04/19/recording-from-pulseaudio/comment-page-1/#comment-802</link>
		<dc:creator>kees</dc:creator>
		<pubDate>Wed, 18 Nov 2009 15:39:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.outflux.net/blog/?p=184#comment-802</guid>
		<description>Update the script for more recent PulseAudio (as found in Karmic):
http://outflux.net/software/pa-clone</description>
		<content:encoded><![CDATA[<p>Update the script for more recent PulseAudio (as found in Karmic):<br />
<a href="http://outflux.net/software/pa-clone">http://outflux.net/software/pa-clone</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hacklschorsch</title>
		<link>http://www.outflux.net/blog/archives/2009/04/19/recording-from-pulseaudio/comment-page-1/#comment-798</link>
		<dc:creator>hacklschorsch</dc:creator>
		<pubDate>Mon, 26 Oct 2009 12:39:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.outflux.net/blog/?p=184#comment-798</guid>
		<description>Thanks, works great!

I replaced &quot;44k&quot; by &quot;44100&quot;. This avoids the SOX problem pointed out by vadim, kees and 3pipe and, at the same time, gets you 44.1khz files, not 44khz ones.

(44.1khz is what you&#039;d want for burning on CDs or converting to MP3)</description>
		<content:encoded><![CDATA[<p>Thanks, works great!</p>
<p>I replaced &#8220;44k&#8221; by &#8220;44100&#8243;. This avoids the SOX problem pointed out by vadim, kees and 3pipe and, at the same time, gets you 44.1khz files, not 44khz ones.</p>
<p>(44.1khz is what you&#8217;d want for burning on CDs or converting to MP3)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: the_phoenix</title>
		<link>http://www.outflux.net/blog/archives/2009/04/19/recording-from-pulseaudio/comment-page-1/#comment-791</link>
		<dc:creator>the_phoenix</dc:creator>
		<pubDate>Fri, 25 Sep 2009 07:47:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.outflux.net/blog/?p=184#comment-791</guid>
		<description>Excellent, thanks for that:  works a treat!</description>
		<content:encoded><![CDATA[<p>Excellent, thanks for that:  works a treat!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben B</title>
		<link>http://www.outflux.net/blog/archives/2009/04/19/recording-from-pulseaudio/comment-page-1/#comment-750</link>
		<dc:creator>Ben B</dc:creator>
		<pubDate>Sat, 16 May 2009 03:41:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.outflux.net/blog/?p=184#comment-750</guid>
		<description>Thanks for the quick and easy solution to &#039;loop back&#039; recording.  I like this variation, for outputting an ogg file:
parec --format=s16le --device=&quot;$MONITOR&quot; &#124; oggenc --raw --quiet --quality=4 -o $WAV -</description>
		<content:encoded><![CDATA[<p>Thanks for the quick and easy solution to &#8216;loop back&#8217; recording.  I like this variation, for outputting an ogg file:<br />
parec &#8211;format=s16le &#8211;device=&#8221;$MONITOR&#8221; | oggenc &#8211;raw &#8211;quiet &#8211;quality=4 -o $WAV -</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vadim P.</title>
		<link>http://www.outflux.net/blog/archives/2009/04/19/recording-from-pulseaudio/comment-page-1/#comment-735</link>
		<dc:creator>Vadim P.</dc:creator>
		<pubDate>Mon, 20 Apr 2009 23:07:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.outflux.net/blog/?p=184#comment-735</guid>
		<description>Thanks xuzo! Your script worked great.</description>
		<content:encoded><![CDATA[<p>Thanks xuzo! Your script worked great.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: xuzo</title>
		<link>http://www.outflux.net/blog/archives/2009/04/19/recording-from-pulseaudio/comment-page-1/#comment-734</link>
		<dc:creator>xuzo</dc:creator>
		<pubDate>Mon, 20 Apr 2009 15:35:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.outflux.net/blog/?p=184#comment-734</guid>
		<description>The GStreamer version :)

$ gst-launch-0.10 pulsesrc device=$(pactl list &#124; grep -A1 &#039;^\*\*\* Source #&#039; &#124; \
    grep &#039;^Name: .*\.monitor$&#039; &#124; cut -d&quot; &quot; -f2 &#124; tail -n1)  \
  ! queue ! audio/x-raw-int,rate=44100,channels=2 \
  ! audioconvert ! lame vbr=4 vbr-quality=2 \
  ! filesink location=dump.mp3</description>
		<content:encoded><![CDATA[<p>The GStreamer version :)</p>
<p>$ gst-launch-0.10 pulsesrc device=$(pactl list | grep -A1 &#8216;^\*\*\* Source #&#8217; | \<br />
    grep &#8216;^Name: .*\.monitor$&#8217; | cut -d&#8221; &#8221; -f2 | tail -n1)  \<br />
  ! queue ! audio/x-raw-int,rate=44100,channels=2 \<br />
  ! audioconvert ! lame vbr=4 vbr-quality=2 \<br />
  ! filesink location=dump.mp3</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kees</title>
		<link>http://www.outflux.net/blog/archives/2009/04/19/recording-from-pulseaudio/comment-page-1/#comment-732</link>
		<dc:creator>kees</dc:creator>
		<pubDate>Mon, 20 Apr 2009 15:17:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.outflux.net/blog/?p=184#comment-732</guid>
		<description>The sox from Ubuntu Jaunty (9.04) works for this example.  If you can&#039;t use sox, just record to the raw file, and import it manually into audacity or something to save it.</description>
		<content:encoded><![CDATA[<p>The sox from Ubuntu Jaunty (9.04) works for this example.  If you can&#8217;t use sox, just record to the raw file, and import it manually into audacity or something to save it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 3pipe</title>
		<link>http://www.outflux.net/blog/archives/2009/04/19/recording-from-pulseaudio/comment-page-1/#comment-730</link>
		<dc:creator>3pipe</dc:creator>
		<pubDate>Mon, 20 Apr 2009 09:50:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.outflux.net/blog/?p=184#comment-730</guid>
		<description>Would you provide a link for an updated sox?  The latest version in the Ubuntu repositories still causes this problem.  Thanks.</description>
		<content:encoded><![CDATA[<p>Would you provide a link for an updated sox?  The latest version in the Ubuntu repositories still causes this problem.  Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kees</title>
		<link>http://www.outflux.net/blog/archives/2009/04/19/recording-from-pulseaudio/comment-page-1/#comment-729</link>
		<dc:creator>kees</dc:creator>
		<pubDate>Mon, 20 Apr 2009 04:14:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.outflux.net/blog/?p=184#comment-729</guid>
		<description>Right, you need a newer sox for that command line.</description>
		<content:encoded><![CDATA[<p>Right, you need a newer sox for that command line.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vadim P.</title>
		<link>http://www.outflux.net/blog/archives/2009/04/19/recording-from-pulseaudio/comment-page-1/#comment-727</link>
		<dc:creator>Vadim P.</dc:creator>
		<pubDate>Mon, 20 Apr 2009 01:05:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.outflux.net/blog/?p=184#comment-727</guid>
		<description>Hehe: sox sox: Rate value `44k&#039; is not a positive number

Full info here: http://paste.pocoo.org/show/113298/</description>
		<content:encoded><![CDATA[<p>Hehe: sox sox: Rate value `44k&#8217; is not a positive number</p>
<p>Full info here: <a href="http://paste.pocoo.org/show/113298/">http://paste.pocoo.org/show/113298/</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

