<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Confessions of a Guru &#187; mp3</title>
	<atom:link href="http://www.guru.net.nz/blog/category/mp3/feed" rel="self" type="application/rss+xml" />
	<link>http://www.guru.net.nz/blog</link>
	<description>Random stuff from a Dunedin (NZ) based web developer, beer drinker and dad</description>
	<lastBuildDate>Wed, 14 Dec 2011 09:18:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Screen recording with Linux</title>
		<link>http://www.guru.net.nz/blog/2008/09/screen-recording-with-linux.html</link>
		<comments>http://www.guru.net.nz/blog/2008/09/screen-recording-with-linux.html#comments</comments>
		<pubDate>Wed, 03 Sep 2008 09:33:00 +0000</pubDate>
		<dc:creator>GuruBob</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[mp3]]></category>

		<guid isPermaLink="false">http://www.guru.net.nz/newblog/?p=185</guid>
		<description><![CDATA[Hello to my future self &#8211; I&#8217;ve anticipated that I will be back in the future to read this post because I&#8217;m sure I would have forgotten how to do this stuff. Firstly, a disclaimer &#8211; I am by no means an expert in this field, I just banged it &#8217;till it worked. If you [...]]]></description>
			<content:encoded><![CDATA[<p>Hello to my future self &#8211; I&#8217;ve anticipated that I will be back in the future to read this post because I&#8217;m sure I would have forgotten how to do this stuff.  Firstly, a disclaimer &#8211; I am by no means an expert in this field, I just banged it &#8217;till it worked.  If you are having trouble doing similar things then I encourage you to post comments where they can be seen and responded to by all.</p>
<p>Secondly, an explanation of what it is I&#8217;m doing here.  A while back I saw some screencasts re <a href="http://www.inkscape.org/">Inkscape</a> at <a href="http://screencasters.heathenx.org/">screencasters.heathenx.org</a>.  I was impressed &#8211; it was a great way to teach people how to use Inkscape.</p>
<p>I had a play around and managed to get to the point where I can now do the following:</p>
<ul>
<li>Record my screen, or any particular window</li>
<li>Use my Logitech USB headset to record the audio</li>
<li>Play the resulting movie back, sound through speakers or headset</li>
</ul>
<p>For some reason I seem to be having a ridiculously hard time determining where the audio output goes for my Linux apps.  In Windows, when I plug my headset in, it becomes the default audio device for all applications.  Currently running applications still use their normal sound output, until restarted.  If I dig deep enough I might even be able to find settings in each program that allows me to specify which sound device (headset or sound card) should get the output.</p>
<p>In Linux (Ubuntu 8.04, Gnome to be precise) I discovered under System &gt; Preferences &gt; Sound an application that allows me to adjust the sound preferences.  In the dropdown list for each playback type I have seven possible playback device options (Auto, USB Audio, Intel ICH5, Intel ICH5 &#8211; IEC958, ALSA, OSS &amp; PulseAudio).  It seems that if I set them all to USB Audio then I get lucky and most things play through the headphones.  Some things, especially the Adobe Flash Player plugin insists on playing through my desktop speakers regardless.  I saw someone complaining that this was Adobe&#8217;s fault, not Linux but I can&#8217;t comment.  In order to avoid all this confusion I found out how to specify the sound device that you want to use for each operation.  This is pretty much the crux of this post.</p>
<p>Anyway, here&#8217;s what I did &#8230;</p>
<h2>Recorded My Desktop</h2>
<p>There&#8217;s a package in the Ubuntu universe repository called recordmydesktop which as the name suggests can be used to record your desktop, with sound.  This is great for making recordings of how to do things to share with others.  I installed the recordmydesktop package, along with the GTK front end to save me having to look up the commands all the time..</p>
<pre>bob@sparkie:~$ sudo apt-get install recordmydesktop gtk-recordmydesktop</pre>
<p><a href="http://www.guru.net.nz/blog/uploaded_images/Screenshot-recordMyDesktop-715177.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://www.guru.net.nz/blog/uploaded_images/Screenshot-recordMyDesktop-715167.png" border="0" alt="" /></a>Once installed I then hit Alt-F2 (to bring up the Run  Application dialog) and typed in gtk-recordmydesktop.</p>
<p>It seemed that by default it was trying to record sound via the mic input on my sound card.  Fat chance it would have had because I don&#8217;t have a mic in my soundcard, instead I have a USB headset.</p>
<p>After Googling around I discovered that if I click the Advanced button in gtk-recordmydesktop I could then enter the sound device to use to capture audio.  I used the device name &#8220;plughw:Headset,0,0&#8243; and was able to record sound via my USB headset.</p>
<p>The key to this was finding out what to type in for the device name.  I discovered the aplay and arecord utilities that allow you to play and record sound.  Each utility has a -l switch which lists the available devices.  Here&#8217;s the output of my arecord -l:</p>
<pre>bob@sparkie:~$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: ICH5 [Intel ICH5], device 0: Intel ICH [Intel ICH5]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: ICH5 [Intel ICH5], device 1: Intel ICH - MIC ADC [Intel ICH5 - MIC ADC]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: ICH5 [Intel ICH5], device 2: Intel ICH - MIC2 ADC [Intel ICH5 - MIC2 ADC]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: ICH5 [Intel ICH5], device 3: Intel ICH - ADC2 [Intel ICH5 - ADC2]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Headset [Logitech USB Headset], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0</pre>
<p>You can see beside each &#8220;card&#8221; there is a device name, either ICH5 (my sound card) or Headset.  Each of those cards has a number of subdevices &#8211; in the case of the sound card you can see there are four possible subdevices I could have chosen (numbered 0 to 3) and for the headset it&#8217;s a free ride because there&#8217;s only one to choose from (as I would have expected).</p>
<p>So, now that plughw:Headset,0,0 should make a bit more sense.  With that all set up, I hit record, wiggled my mouse around, spoke some gibberish and created a .ogg file of my session.</p>
<h2>Sound Recording and Playback</h2>
<p>While I was debugging my sound devices I fiddled around a bit with arecord and aplay.  Using the command <span style="font-size:85%;"><span style="font-family: courier new;">arecord -Dplughw:Headset,0,0 -f S16_LE -c2 -r44100 &gt; myfile.wav</span></span> I created a 44kHz wav file using the headset mic as my recording device.</p>
<p>When I played it back with aplay myfile.wav, it played through my desktop speakers.  To play it through my headset I just specified the device name as I did with the arecord command, thus  <span style="font-family: courier new;font-size:85%;">aplay -Dplughw:Headset,0 myfile.wav</span></p>
<p>If you want to use mplayer to play something back using a specific device for audio output, this command will do the trick for you:<span style="font-size:85%;"><span style="font-family: courier new;"> mplayer -ao alsa:device=hw=1.0 ep069.flv</span></span>.  Device 1.0 is card #1, device 0 &#8211; and that&#8217;s the headset.</p>
<p>If you need to adjust the volume, I found you can use the alsamixer.  To control each card you can specify which one with the -c switch.  In my case card 0 is the default and internal sound card, and card 1 is the USB Headset: <span style="font-size:85%;"><span style="font-family: courier new;">alsamixer -c 1</span></span></p>
<p>That&#8217;s all for now!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.guru.net.nz/blog/2008/09/screen-recording-with-linux.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convert ASX to MP3 (or WAV)</title>
		<link>http://www.guru.net.nz/blog/2007/08/convert-asx-to-mp3-or-wav.html</link>
		<comments>http://www.guru.net.nz/blog/2007/08/convert-asx-to-mp3-or-wav.html#comments</comments>
		<pubDate>Tue, 14 Aug 2007 11:51:00 +0000</pubDate>
		<dc:creator>GuruBob</dc:creator>
				<category><![CDATA[asx]]></category>
		<category><![CDATA[convert]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mp3]]></category>
		<category><![CDATA[mplayer]]></category>

		<guid isPermaLink="false">http://www.guru.net.nz/newblog/?p=156</guid>
		<description><![CDATA[From an email tonight &#8230; Hey Geoff, Great success! I managed to easily convert your news.asx file to a MP3 (and a PCM file in between if that&#8217;s useful to you). First of all, I installed mplayer and ffmpeg (I didn&#8217;t have either):bob@stella:~$ sudo apt-get install ffmpeg mplayer Then, I converted the news.asx file to [...]]]></description>
			<content:encoded><![CDATA[<p>From an email tonight &#8230;</p>
<blockquote><p>Hey Geoff,</p>
<p>Great success!  I managed to easily convert your news.asx file to a MP3 (and a PCM file in between if that&#8217;s useful to you).</p>
<p>First of all, I installed mplayer and ffmpeg (I didn&#8217;t have either):<br />bob@stella:~$ sudo apt-get install ffmpeg mplayer</p>
<p>Then, I converted the news.asx file to a PCM file:<br />bob@stella:~$ mplayer -ao pcm news.asx</p>
<p>This created a file called audiodump.wav.  I then converted that to a MP3 using ffmpeg.<br />bob@stella:~$ ffmpeg -i audiodump.wav news.mp3</p>
<p>I was then left with a mp3 file which I could do what I pleased with.  Ironically I used mplayer to confirm that it&#8217;s content was playable &#8211; we&#8217;ve come full circle:<br />bob@stella:~$ mplayer news.mp3</p>
<p>Then, because I&#8217;m a tidy kiwi I cleaned up behind myself:<br />bob@stella:~$ rm audiodump.pcm</p>
<p>Let me know how you get on.</p>
<p>Cheers,</p>
<p>- Bob -</p>
<p>Geoff Barkman wrote:<br />> Hi Bob<br />> This is the asx file that I was talking to you about tonight at the dunlug meeting.<br />> I record using mimms, which is a media file grabber. It plays using mplayer if needed&#8230; but I haven&#8217;t found a way to convert it to an editable file that I can just grab a 5 minute clip out of the audio&#8230; I have to play it in real time and hit record when the news starts.<br />> I looked at recording less than a 11 minute clip&#8230; but the time seems to vary at the radio station and I end up loosing the start or finish of the news.<br />><br />> My shell script that I run using a crontab has this code in it.<br />><br />> #!/bin/bash<br />><br />> mimms -t 11 -c http://www.thesomethingorother.com/listenlive/news.asx /home/geoff/NEWS/news.asx &#038;<br />><br />> It gets saved as a file called news.asx.<br />> I looked at recording it using just an ordinairy old radio tuner&#8230; but it is only broadcast on AM radio in dunedin&#8230; the web stream option has higher quality audio on it.<br />><br />> Cheers<br />> Geoff Barkman</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.guru.net.nz/blog/2007/08/convert-asx-to-mp3-or-wav.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

