<?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>PC Pro blog &#187; audio</title>
	<atom:link href="http://www.pcpro.co.uk/blogs/tag/audio/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pcpro.co.uk/blogs</link>
	<description>Blogging in the real world</description>
	<lastBuildDate>Wed, 08 Feb 2012 16:54:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Adding audio to your website with HTML5</title>
		<link>http://www.pcpro.co.uk/blogs/2010/08/23/adding-audio-to-your-website-with-html5/</link>
		<comments>http://www.pcpro.co.uk/blogs/2010/08/23/adding-audio-to-your-website-with-html5/#comments</comments>
		<pubDate>Mon, 23 Aug 2010 09:25:52 +0000</pubDate>
		<dc:creator>Ian Devlin</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">http://www.pcpro.co.uk/blogs/?p=22981</guid>
		<description><![CDATA[
With all the furore around the HTML5 video element, the poor audio element sits in the background wondering what it&#8217;s done wrong to receive so little attention. So in an attempt to redress the balance, I&#8217;m going to show you how you can stream audio to your website visitors without any additional plugins.
As with the video [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.pcpro.co.uk/blogs/wp-content/uploads/2010/08/gramaphone-2.jpg" alt="old gramaphone" /><br />
With all the furore around the HTML5 <a href="http://www.pcpro.co.uk/blogs/2010/05/18/adding-video-to-your-website-with-html5/">video element</a>, the poor audio element sits in the background wondering what it&#8217;s done wrong to receive so little attention. So in an attempt to redress the balance, I&#8217;m going to show you how you can stream audio to your website visitors without any additional plugins.</p>
<p>As with the video element, in the past the only method of embedding audio files into a web page was to use Flash or another third-party plugin. There simply was no other way. With the introduction of the audio element, this has changed.</p>
<p><span id="more-22981"></span></p>
<p><strong>Browsers and file types</strong></p>
<p>There are currently three different audio file types that are supported, and (of course) the different browsers each support different formats. The table below illustrates this:</p>
<table style="text-align: center;margin: 20px 0" border="0">
<thead>
<tr style="margin: 6px 0">
<th></th>
<th>Vorbis OGG</th>
<th>MP3</th>
<th>WAV</th>
</tr>
</thead>
<tbody>
<tr style="margin: 6px 0">
<td style="text-align:left">Firefox 3.6.8</td>
<td>✓</td>
<td>x</td>
<td>✓</td>
</tr>
<tr style="margin: 6px 0">
<td style="text-align:left">Chrome 5</td>
<td>✓</td>
<td>✓</td>
<td>x</td>
</tr>
<tr style="margin: 6px 0">
<td style="text-align:left">Safari 5</td>
<td>x</td>
<td>✓</td>
<td>✓</td>
</tr>
<tr style="margin: 6px 0">
<td style="text-align:left">Opera 10.6</td>
<td>✓</td>
<td>x</td>
<td>✓</td>
</tr>
<tr style="margin: 6px 0">
<td style="text-align:left">Internet Explorer 8</td>
<td>x</td>
<td>x</td>
<td>x</td>
</tr>
<tr style="margin: 6px 0">
<td style="text-align:left">Internet Explorer 9</td>
<td>x</td>
<td>✓</td>
<td>x</td>
</tr>
<tr style="margin: 6px 0">
<td style="text-align:left">iPhone</td>
<td>x</td>
<td>✓</td>
<td>✓</td>
</tr>
<tr style="margin: 6px 0">
<td style="text-align:left">Android</td>
<td>x</td>
<td>x</td>
<td>x</td>
</tr>
</tbody>
</table>
<p><strong>Code</strong></p>
<p>So how do we actually go about adding an audio file to a web page? Well it&#8217;s quite simple really, especially if you&#8217;ve already used the <a href="http://www.pcpro.co.uk/blogs/2010/05/18/adding-video-to-your-website-with-html5/">video</a> element.</p>
<p>Instead of using the &lt;<code>video&gt;</code> element we naturally use its brother, the <code>&lt;audio&gt;</code> element. Like the <code>&lt;video&gt;</code> element, we can use the <code>src</code> attribute to directly specify the audio file to play, but, as shown above, it&#8217;s more practical to use the <code>&lt;source&gt;</code> element to indicate a number of possible sources in order to cover <del datetime="2010-08-21T07:27:38+00:00">all</del> most browsers.</p>
<p><strong>The &lt;audio&gt; element</strong></p>
<p>The <code>audio</code> element takes the following attributes:</p>
<table style="text-align:left;padding-right:5px" border="0" width="400px">
<thead>
<tr style="background-color:#e2001a;color:#fff">
<th>Attribute</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr style="background-color:#ddd">
<td style="padding-left:5px" valign="top">src</td>
<td style="padding-left:5px">a valid URL to the audio file itself</td>
</tr>
<tr style="background-color:#ddd">
<td style="padding-left:5px" valign="top">preload</td>
<td style="padding-left:5px">Specifies if the audio is to be preloaded or not. Possible values:</p>
<ul style="padding-left:15px;color:#222">
<li>auto &ndash; loads the entire audio file when the page loads</li>
<li>meta &ndash; only load the audio files meta data when the page loads</li>
<li>none &ndash; don&#8217;t load the audio file when the page loads</li>
</ul>
</td>
</tr>
<tr style="background-color:#ddd">
<td style="padding-left:5px" valign="top">autoplay</td>
<td style="padding-left:5px">a boolean indicating whether the audio file should be played automatically</td>
</tr>
<tr style="background-color:#ddd">
<td style="padding-left:5px" valign="top">controls</td>
<td style="padding-left:5px">a boolean indicating that the default media controls should be displayed by the browser</td>
</tr>
<tr style="background-color:#ddd">
<td style="padding-left:5px" valign="top">loop</td>
<td style="padding-left:5px">a boolean indicating whether the audio file should be played repeatedly (this is evil)</td>
</tr>
</tbody>
</table>
<p>So you can easily add a WAV audio file to your website by using the following markup:</p>
<p><code>&lt;audio src="audioFile.wav" autoplay controls&gt;&lt;/audio&gt;</code></p>
<p>Of course, as mentioned above, this can limit your browser compatibility and it&#8217;s better to provide different audio sources using the <code>&lt;source&gt;</code> element.</p>
<p><strong>The &lt;source&gt; element</strong></p>
<p>The <code>source</code> element can take the following attributes:</p>
<table style="text-align:left;padding-right:5px" border="0" width="400px">
<thead>
<tr style="background-color:#e2001a;color:#fff">
<th>Attribute</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr style="background-color:#ddd">
<td style="padding-left:5px" valign="top">src</td>
<td style="padding-left:5px">a valid URL to the media (in this case audio) file itself</td>
</tr>
<tr style="background-color:#ddd">
<td style="padding-left:5px" valign="top">type</td>
<td style="padding-left:5px">the type of the media file which must be a <a href="http://www.webmaster-toolkit.com/mime-types.shtml" target="new">MIME type</a>, e.g. <code>type="audio/ogg"</code> indicates that it is a Vorbis OGG audio file, and you can also provide the MIME codec to help the browser to decide how to play the audio by using <code>type='audio/ogg; codecs="vorbis"</code>.</td>
</tr>
</tbody>
</table>
<p><strong>Stacking the audio sources</strong></p>
<p>Combining the <code>&lt;audio&gt;</code> and <code>&lt;source&gt;</code> elments together couldn&#8217;t be simpler, as the code below shows:</p>
<p><code>&lt;audio controls autobuffer&gt;<br />
&lt;source src="audioFile.ogg"&gt;<br />
&lt;source src="audioFile.mp3"&gt;<br />
&lt;source src="audioFile.wav"&gt;<br />
Sorry, your browser does not support the audio element<br />
&lt;/audio&gt;</code></p>
<p>The code above should play the specified audio file in all of the browsers mentioned above (except for the current incarnations of Internet Explorer and Android &#8211; which will display the message indicating as much. This could be replaced with a Flash fallback of course).</p>
<p>Feel free to <a href="http://www.pcpro.co.uk/blogs/wp-content/uploads/2010/08/html5-audio-test-2.html">test this code for yourself</a>.</p>
<p><strong>Conclusion</strong></p>
<p>So there it is in its simplest form, adding an audio file to a web page. Of course it depends on the browser the page is being viewed in, and, as usual, we&#8217;re still waiting for Internet Explorer to catch up (A beta version of IE9 is due out next month).  Nevertheless, it&#8217;s still worth using today. Just don&#8217;t set your files to autoplay!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pcpro.co.uk/blogs/2010/08/23/adding-audio-to-your-website-with-html5/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>How to connect your PC to your hi-fi</title>
		<link>http://www.pcpro.co.uk/blogs/2009/03/25/how-to-connect-your-pc-to-your-hi-fi/</link>
		<comments>http://www.pcpro.co.uk/blogs/2009/03/25/how-to-connect-your-pc-to-your-hi-fi/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 11:01:20 +0000</pubDate>
		<dc:creator>David Fearon</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[hi-fi]]></category>
		<category><![CDATA[laptop]]></category>
		<category><![CDATA[pc]]></category>
		<category><![CDATA[stereo]]></category>

		<guid isPermaLink="false">http://www.pcpro.co.uk/blogs/?p=5333</guid>
		<description><![CDATA[It appears there&#8217;s some confusion, even among a few of my colleagues, about audio and PC speakers and amplifiers and stuff like that. Specifically, whether you can plug a PC into normal stereo speakers, whether it will work if you do and how to do it. We&#8217;ll start with a few simple facts in handy [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.pcpro.co.uk/blogs/wp-content/uploads/2009/03/audioblogtop.jpg"><img class="alignleft size-full wp-image-5350" title="audioblogtop" src="http://www.pcpro.co.uk/blogs/wp-content/uploads/2009/03/audioblogtop.jpg" alt="" width="250" height="235" /></a>It appears there&#8217;s some confusion, even among a few of my colleagues, about audio and PC speakers and amplifiers and stuff like that. Specifically, whether you can plug a PC into normal stereo speakers, whether it will work if you do and how to do it. We&#8217;ll start with a few simple facts in handy question-and-answer format.</p>
<p><strong>Can I use normal living-room stereo speakers with my PC?</strong></p>
<p>Probably not directly, but essentially yes. There’s no fundamental difference between PC speakers and normal speakers, except that PC speakers have a built-in amplifier. To use standard hi-fi stereo speakers you just need an amplifier to drive them. So, either get yourself a separate hi-fi amp and speakers, or take the cheap option and plug your PC into the stereo in the living room.</p>
<p><span id="more-5333"></span></p>
<p><strong>How do I do that then?</strong></p>
<p>If you take a look at the back of your stereo or TV surround-sound receiver, you&#8217;ll almost certainly see a couple of spare plugs labelled something like &#8216;Aux&#8217;. You can directly attach the audio output of your PC into one of these. Usually, inputs to your hi-fi are RCA (also called phono) connectors, with separate white and red plugs for the left and right stereo channels like this:</p>
<p><a href="http://www.pcpro.co.uk/blogs/wp-content/uploads/2009/03/audioblog1.jpg"><img class="size-full wp-image-5334" title="audioblog1" src="http://www.pcpro.co.uk/blogs/wp-content/uploads/2009/03/audioblog1.jpg" alt="" width="428" height="329" /></a></p>
<p>The output from your PC is likely to be a single, 3.5mm audio output jack. If you have multi-channel HD audio there will be several jacks but you want the green one, which will probably be labelled with an arrowed icon showing it&#8217;s an output like this:</p>
<p><a href="http://www.pcpro.co.uk/blogs/wp-content/uploads/2009/03/audioblog4a.jpg"><img class="alignnone size-full wp-image-5340" title="audioblog4a" src="http://www.pcpro.co.uk/blogs/wp-content/uploads/2009/03/audioblog4a.jpg" alt="" width="428" height="167" /></a></p>
<p>All you need to connect the PC to the stereo is a 3.5mm-to-RCA stereo cable, which costs a <strong><a href="http://www.maplin.co.uk/Module.aspx?ModuleNo=31700">few quid from somewhere like Maplin</a></strong>.</p>
<p><strong>I can&#8217;t see an &#8216;Aux&#8217; connector on the back of my stereo<br />
</strong></p>
<p>Not the end of the world. You can put your PC&#8217;s audio output into almost any analogue input of a hi-fi amplifier. It doesn’t matter if it’s labelled ‘CD’, ‘tape in’, ‘aux’ or something like ‘A/V’. They’re just convenient labels – they all take the same line-level audio signal. As long as there are two RCA plugs, one red and one white, and they&#8217;re labelled as an input or grouped in with the other inputs (in other words it&#8217;s not an output like &#8216;tape out&#8217;) then you can use it. So for instance on the back of the A/V receiver pictured above, you could use the &#8216;tape in&#8217; inputs.</p>
<p>There&#8217;s only one analogue input you <em>can&#8217;t</em> use:</p>
<p><strong>Can I use the phono input?</strong></p>
<p>No, sorry. The phono input of a stereo (sometimes labelled MM or MC, for &#8216;moving magnet&#8217; and &#8216;moving coil&#8217;) is for a record player, and it&#8217;s designed to accept the tiny electrical signal that&#8217;s generated by the needle moving in the grooves of a record. If you attach the PC audio output to it, you&#8217;re unlikely to do any damage but the sound will be hideously distorted. So don&#8217;t. Note that, annoyingly, the word &#8216;phono&#8217; is also applied to RCA cables. But phono cables and the phono input are different things.</p>
<p><strong>Right, I&#8217;ve found a spare input on the back of my stereo. </strong></p>
<p>Good. All you need to do now is plug the 3.5mm audio jack into the green output of your PC, and the Phono connectors into the left and right sockets of your chosen input at the back of the stereo.</p>
<p>Now switch on your stereo and <strong>turn the volume down</strong>. As in, down to almost zero. That prevents all sorts of issues ranging from spilt tea to burst eardrums if you&#8217;re stupid enough to put your ear right next to the speaker (never, ever put your ear right next to a speaker: you&#8217;ll end up partially deaf when it suddenly cuts in at full volume). Now press whatever button you need to press on the front of the stereo to select the input you&#8217;re using.</p>
<p>Finally, try playing some music on the PC, or clicking the volume slider in Windows to get the &#8216;bonk&#8217; sound. If you can&#8217;t hear anything, increase the volume <strong>slowly</strong>. If you still can&#8217;t hear anything, don&#8217;t turn the volume up to full, turn it back down again. It&#8217;s probably something simple at fault. Prime candidates are accidentally having the audio muted in Windows, or having the wrong output selected in Windows&#8217; audio properties.</p>
<p><strong>Can I use a digital output? </strong></p>
<p>A hefty proportion of PCs these days have some sort of digital audio output, which will potentially give you better quality than using the analogue output. To make use of it though, you&#8217;ll need a stereo with digital inputs that&#8217;s able to convert the digital ones and zeroes into an analogue signal that the amplifier can use to drive your speakers. Either that, or an offboard DAC (digital-to-analogue converter) to mediate between the two.</p>
<p>There are two types of digital audio output you might find on your PC. Both use the same digital format (known as S/PDIF for the Sony/Philips digital interface format). But one uses electrical signals while the other uses light. They&#8217;re known, not surprisigly, as electrical (sometimes coaxial) S/PDIF, and optical S/PDIF.</p>
<p>If your motherboard has a digital coaxial output, it&#8217;ll be coloured yellow. But don&#8217;t take that as proof positive because other things like composite video outputs can also be yellow &#8211; you&#8217;ll need to check in your notherboard manual.</p>
<p>Optical digital outputs will have a little socket with a kind of bung in them. Pull it out and you&#8217;ll probably see it glowing red in a terrific sci-fi kind of way. Optical digital connections need a cable called a TOSLINK cable, the name of which is derived from &#8216;Toshiba Link&#8217; and looks like this:</p>
<p><a href="http://www.pcpro.co.uk/blogs/wp-content/uploads/2009/03/audioblog6.jpg"><img class="alignnone size-full wp-image-5339" title="audioblog6" src="http://www.pcpro.co.uk/blogs/wp-content/uploads/2009/03/audioblog6.jpg" alt="" width="428" height="282" /></a></p>
<p><strong>Laptops</strong></p>
<p>The great thing about optical digital outputs is that they can be integrated into laptops. They&#8217;re often disguised as 3.5mm audio jacks, and are actually dual-use. You can plug a 3.5mm electrical audio cable in to get an analogue audio output, or you can <a href="http://www.maplin.co.uk/module.aspx?moduleno=29296">get yourself</a> a TOSLINK-to-3.5mm adapter and plug it in like this:</p>
<p><a href="http://www.pcpro.co.uk/blogs/wp-content/uploads/2009/03/audioblog5.jpg"><img class="alignnone size-full wp-image-5338" title="audioblog5" src="http://www.pcpro.co.uk/blogs/wp-content/uploads/2009/03/audioblog5.jpg" alt="" width="428" height="287" /></a></p>
<p>That means that you can use your laptop as a kind of handy media-centre jukebox, ripping all your CDs to it. I did this a few years back and it&#8217;s a hell of a lot more convenient than digging CDs out.</p>
<p>If you&#8217;re determined to use a digital output from your PC/laptop but your stereo doesn&#8217;t have either a coaxial or optical digital input, you can get yourself an offboard DAC like <strong><a href="http://www.richersounds.com/showproduct.php?cda=showproduct&amp;pid=CAMB-DACMAGIC-08-BLK">this one</a></strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pcpro.co.uk/blogs/2009/03/25/how-to-connect-your-pc-to-your-hi-fi/feed/</wfw:commentRss>
		<slash:comments>38</slash:comments>
		</item>
	</channel>
</rss>

