<?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>larryaronson.com &#187; Firefox</title>
	<atom:link href="http://larryaronson.com/tag/firefox/feed/" rel="self" type="application/rss+xml" />
	<link>http://larryaronson.com</link>
	<description>Systems Psychoanalyst</description>
	<lastBuildDate>Wed, 14 Dec 2011 04:17:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Understanding HTML5 Audio</title>
		<link>http://larryaronson.com/2010/understanding-html5-audio/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://larryaronson.com/2010/understanding-html5-audio/#comments</comments>
		<pubDate>Sun, 14 Nov 2010 00:14:04 +0000</pubDate>
		<dc:creator>Larry Aronson</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[iTunes]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[mp3]]></category>
		<category><![CDATA[Napster]]></category>
		<category><![CDATA[ogg]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[Safari]]></category>
		<category><![CDATA[sound effects]]></category>
		<category><![CDATA[wav]]></category>
		<category><![CDATA[Web development]]></category>
		<category><![CDATA[YouTube]]></category>

		<guid isPermaLink="false">http://larryaronson.com/?p=1640</guid>
		<description><![CDATA[<a href="http://larryaronson.com/2010/understanding-html5-audio/"><img src="http://larryaronson.com/wp-content/uploads/hismastersvoice.jpg" alt="His Master&#039;s Voice" title="hismastersvoice" width="75" height="54" class="alignleft size-thumbnail wp-image-1741" /></a>A quickie tutorial on the HTML5 audio element and its JavaScript API. Examples illustrate applications such as: background music, sound effects, alert noises and audio content. ]]></description>
			<content:encoded><![CDATA[<p><audio id="ella" preload><br />
  <source src="http://larryaronson.com/wp-content/uploads/swonderful.ogg" type="audio/ogg" /><br />
  <source src="http://larryaronson.com/wp-content/uploads/swonderful.mp3" type="audio/mpeg" /><br />
</audio><br />
<audio id="thanks" preload><br />
  <source src="http://larryaronson.com/wp-content/uploads/thanks.ogg" type="audio/ogg" /><br />
  <source src="http://larryaronson.com/wp-content/uploads/thanks.mp3" type="audio/mpeg" /><br />
</audio></p>
<h2>Now Hear This!</h2>
<p><img src="http://larryaronson.com/wp-content/uploads/hismastersvoice.jpg" alt="His Master&#039;s Voice" title="hismastersvoice" width="240" height="172" class="alignleft size-full wp-image-1741" />With all the talk about Flash versus HTML5 you might be forgiven for thinking that HTML5 is just about video. It&#8217;s not, of course. HTML5 is a major extension of HTML in many areas including media.</p>
<p> Today, I&#8217;d like to explore <strong>HTML5 audio</strong>, which is similar to HTML5 video in many respects, but fundamentally different in others. For starters, a video element is essentially just a TV set embedded in a webpage whereas audio can serve multiple purposes &ndash; four examples:</p>
<ul style="margin: 1em auto;">
<li><strong>Sound effects</strong>. A button can make a sound when it&#8217;s clicked. How about a swoosh sound when a division is toggled open or closed?</li>
<li><strong>Alerts and notifications</strong>. A little bell can sound when an AJAX request completes and updates a page section. Or, an audio &#8220;Uh Oh!&#8221; can play when you enter a malformed email address into a input field.</li>
<li><strong>Background sounds</strong>. Some web pages can benefit from background music. But say you have a photo gallery of birds. Wouldn&#8217;t it be nice to be able to click one and hear it tweet?</li>
<li><strong>Spoken content</strong>. Yes, we have podcasts, but we also need something simpler such as  pronunciations of foreign words and phrases, or a click-to-have-this-post-read-to-you feature so you can go off and browse other webpages while I continue to read this one to you.</li>
</ul>
<p>S i l e n c e.</p>
<h3>Yo Dawg, I can&#8217;t hear your website!</h3>
<p>This isn&#8217;t as dumb a statement as it first, um, sounds. Web developers have shied away from including sound in webpages because of several  difficulties:</p>
<ul>
<li><strong>Confusion</strong> &ndash; There are codecs and there are file formats. A codec is a method of encoding audio data. A file format is a container for the codec and optional metadata, such as a song title. Some file formats can accommodate multiple codecs; other formats are codec specific. For simplicity, we can narrow this discussion to the most popular file formats/codecs for the Web. These are:
<ul style="margin: 1em auto">
<li><strong>wav</strong> &ndash; An uncompressed format. A wav file with 30 seconds of silence is the same size (megabytes) as a file with 30 seconds of symphonic music.</li>
<li><strong>mp3</strong> &ndash; A popular format for music that uses a lossy compression format resulting in file sizes typically 1/10 the size of a wav file with the same audio content.</li>
<li><strong>ogg</strong>  &ndash; An open-source alternative to mp3 that also uses a lossy compression format.</li>
</ul>
</li>
<li><strong>Cross-browser incompatibility</strong> &ndash; Unlike images, where all major browsers support the three major file types&mdash;gif, jpg and png&mdash;all browsers do not support all audio formats. For instance: mp3 is a proprietary format and its decoding software cannot be included in  GPL-licensed, open-source applications such as the Mozilla Foundation&#8217;s Firefox browser. Here&#8217;s a table showing which formats are supported by the current versions of the major web browsers:<br />
<table width="90%"  border="1" cellspacing="0" cellpadding="6" style="margin: 1em auto;">
<tr>
<th></th>
<th>IE</th>
<th>Firefox</th>
<th>Safari</th>
<th>Chrome</th>
<th>Opera</th>
</tr>
<tr>
<th>wav</th>
<td>NO</td>
<td>YES</td>
<td>YES</td>
<td>NO</td>
<td>NO</td>
</tr>
<tr>
<th>mp3</th>
<td>NO*</td>
<td>NO</td>
<td>YES</td>
<td>YES</td>
<td>YES</td>
</tr>
<tr>
<th>ogg</th>
<td>NO</td>
<td>YES</td>
<td>NO</td>
<td>YES</td>
<td>NO</td>
</tr>
</table>
<p><span style="font-size: x-small">(* IE8 does not recognize the audio element at all. The IE9 beta works only with mp3 files. )</span></li>
<li><strong>Plugin required </strong>&ndash; HTML4 Browsers do not support audio natively. A plugin is required and JavaScript must be enabled. While most browsers support audio with a distributed default plugin, web developers must still use the ugly and opaque <i>object</i>, <i>embed</i> and <i>param</i> elements to bring sounds to a webpage.</li>
<li><strong>Insufficient processing power</strong> &ndash; For the first time visitor to a page, it can take several seconds for an older or overloaded browser to load the player code, download, decode and play a audio file. This pretty much nixes using sound for mouseover effects, even simple click sounds for navigation buttons.</li>
</ul>
<p><strong>YouTube</strong> made Web video workable. No such service existed to popularize the use of audio in webpages. On the contrary, Napster.com and iTunes focused attention on downloadable music applications. Wouldn&#8217;t it be great if there was an easy way to incorporate sounds on a webpage for other purposes. Good News! There is. All major browsers now support basic HTML5 audio with the notable exception of Internet Explorer.</p>
<h3>The HTML5 Audio Solution</h3>
<p>HTML5 audio consists of the <i>audio</i> element and a JavaScript API for playing the sound it represents. The element is a container (it has both opening and closing tags) and what&#8217;s inside is fallback content for legacy browsers and search-bots. It can be written simply as: </p>
<pre style="color: #090; font-size: small;">
&lt;audio src="<i>url</i>" autoplay loop&gt;
        Aw, snap. Your browser doesn't support HTML5 audio!
&lt;/audio&gt;
</pre>
<p>The above would be perfect for playing background music on a webpage. it could be placed anywhere in the body of the document&mdash;heard but not seen. For creating a controllable audio player, the <i>controls</i> attribute can be added to the opening tag.</p>
<pre style="color: #090; font-size: small;">
&lt;audio src="<i>url</i>" controls&gt;
        &lt;a href="<i>url</i>"&gt;Download the audio file&lt;/a&gt;
&lt;/audio&gt;
</pre>
<p>Which, depending on your browser will create a player like one of these:*</p>
<table cellspacing="0" style="margin: 1em auto;">
<tr>
<td style="text-align:right">IE</td>
<td>&nbsp;&nbsp;&nbsp;<a href="javascript:void(0)#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Download the audio file</a></td>
</tr>
<tr>
<td style="text-align:right">Firefox</td>
<td><img src="http://larryaronson.com/wp-content/uploads/firefox_audio.gif" alt="Firefox audio controls" title="firefox_audio" width="321" height="56" class="alignnone size-full wp-image-1700" /></td>
</tr>
<tr>
<td style="text-align:right">Safari</td>
<td><img src="http://larryaronson.com/wp-content/uploads/safari_audio.gif" alt="Safari audio controls" title="safari_audio" width="217" height="41" class="alignnone size-full wp-image-1701" /></td>
</tr>
<tr>
<td style="text-align:right">Chrome</td>
<td><img src="http://larryaronson.com/wp-content/uploads/chrome_audio.gif" alt="Chrome audio controls" title="chrome_audio" width="314" height="47" class="alignnone size-full wp-image-1699" /></td>
</tr>
<tr>
<td style="text-align:right">Opera</td>
<td><img src="http://larryaronson.com/wp-content/uploads/opera_audio.gif" alt="Opera Audio controls" title="opera_audio" width="312" height="36" class="alignnone size-full wp-image-1727" /></td>
</tr>
</table>
<p><span style="font-size: x-small">(* Just pictures of the controls in different browsers. They don&#8217;t work here; neither does the link.)</span></p>
<p>Unfortunately, because of the differing support among browsers for the three file types, this approach won&#8217;t work in all browsers. That means having at least mp3 and ogg audio file versions and using browser detection to figure out which to load. </p>
<p>But wait. There&#8217;s an alternate form of the audio element that takes a different approach: try one format and, if it doesn&#8217;t work, try another. You still need at least two files but the syntax is much simpler.</p>
<pre style="color: #090; font-size: small;">
&lt;audio id="bgSound" loop&gt;
        &lt;source src="audio/bgSound.mp3" type="audio/mp3" /&gt;
        &lt;source src="audio/bgSound.ogg" type="audio/ogg" /&gt;
        &lt;-- <i>lnsert fallback Flash Player code here</i> --"&gt;
&lt;/audio&gt;
</pre>
<p>The audio element must be in the body of the html document. I&#8217;ve given an <i>id</i> attribute to the above so it can be referred to by JavaScript statements. Place a script element right after the audio element to get its DOM object:</p>
<pre style="color: #090; font-size: small;">
&lt;script type="text/javascript"&gt;
  var bgSound = document.getElementById('bgSound');
&lt;/script&gt;
</pre>
<p>Don&#8217;t put the JavaScript in the head of the document, the audio element must be defined before its DOM object can be referenced. The DOM object for the audio allows you to change its properties, start and stop the music. To play the audio as page background, add an <i>onload</i> attribute to the body tag:</dt>
<pre style="color: #090; font-size: small;">
&lt;body onload="bgSound.play();"&gt;
</pre>
<p>As an alternative, use jQuery in the document head to call the play method at document ready time (when all the HTML is parsed but images may still be loading.)</p>
<pre style="color: #090; font-size: small;">
&lt;script type="text/javascript"&gt;
  $(document).ready( function () {$('#bgSound').play();} );
&lt;/script&gt;
</pre>
<p>The jQuery <i>$</i> function is similar to JavaScript&#8217;s <i>getElementById( )</i> method. You&#8217;ll need the jQuery library for this to work. If it isn&#8217;t already loaded, placing the following script element in the document head will get it from Google.</p>
<pre style="color: #090; font-size: small;">
&lt;script type="text/javascript"
 src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"&gt;
&lt;/script&gt;
</pre>
<p>To play a sound effect when the user&#8217;s mouse is over a link, remove the <i>loop</i> attribute from the audio tag and add <i>preload</i>, then use the <i>onmouseover</i> attribute in the link. You can get the DOM object and play it in one move:</p>
<pre style="color: #090; font-size: small;">
&lt;audio id="thanks" preload&gt;
        &lt;source src="audio/thanks.mp3" type="audio/mpeg" /&gt;
        &lt;source src="audio/thanks.ogg" type="audio/ogg" /&gt;
&lt;/audio&gt; 

&lt;a href="javascript:void(0);"
   onmouseover="document.getElementById('thanks').play();"&gt;A shout out&lt;/a&gt;
</pre>
<p>Or, to assign a sound to a button like the one at the bottom of this post</p>
<pre style="color: #090; font-size: small;">
&lt;audio id="ella" preload&gt;
        &lt;source src="audio/swonderful.mp3" type="audio/mpeg" /&gt;
        &lt;source src="audio/swonderful.ogg" type="audio/ogg" /&gt;
&lt;/audio&gt;

&lt;button onclick="document.getElementById('ella').play()"&gt;
        I like it!
&lt;/button&gt;
</pre>
<p>The JavaScript API for HTML5 Media elements contains many more properties and features including a <i>track</i> property which can be used to segment a file into separate sounds of different durations. One audio element could be used to (pre)load dozens of different sound effects for a website. Not all advanced API features will be supported by all browsers in the near future, but eventually, using sound on a website will become as natural and as easy to do as using images.</p>
<p><a href="javascript:void(0);#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed" onmouseover="document.getElementById('thanks').play();">A shout out</a> to my friends at <a href="http://www.facebook.com/home.php?sk=group_171764366167976&#038;ap=1" target="_blank">WWWAC</a> who helped test HTML5 Audio on the IE9 beta release.</p>
<p>What do you think of HTML Audio? &nbsp;&nbsp; <button onclick="document.getElementById('ella').play()">I like it!</button></p>
<hr size="1" />
]]></content:encoded>
			<wfw:commentRss>http://larryaronson.com/2010/understanding-html5-audio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://larryaronson.com/wp-content/uploads/swonderful.ogg" length="68391" type="audio/ogg" />
<enclosure url="http://larryaronson.com/wp-content/uploads/swonderful.mp3" length="61930" type="audio/mpeg" />
<enclosure url="http://larryaronson.com/wp-content/uploads/thanks.ogg" length="16357" type="audio/ogg" />
<enclosure url="http://larryaronson.com/wp-content/uploads/thanks.mp3" length="17635" type="audio/mpeg" />
		</item>
		<item>
		<title>Two New Browsers</title>
		<link>http://larryaronson.com/2008/two-new-browsers/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://larryaronson.com/2008/two-new-browsers/#comments</comments>
		<pubDate>Wed, 29 Oct 2008 19:17:10 +0000</pubDate>
		<dc:creator>Larry Aronson</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Flock]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Safari]]></category>
		<category><![CDATA[Social Media]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[YouTube]]></category>

		<guid isPermaLink="false">http://larryaronson.com/?p=63</guid>
		<description><![CDATA[<img class="left" src="/wp-content/uploads/chrome_icon.gif" width="75" height="75" /> Two new Web browsers have recently become available for exploring the Internet. Google Chrome and Flock take radically different approaches to the browsing experience and I recommend you take a look at them when you get a chance.]]></description>
			<content:encoded><![CDATA[<p>Two new Web browsers have recently become available for exploring the Internet. <a title="Download Google Chrome" href="http://google.com/chrome" target="_blank">Google Chrome</a> and <a title="Visit the Flock, Inc. Website" href="http://flock.com/" target="_blank">Flock</a> take radically different approaches to the browsing experience and I recommend you take a look at them when you get a chance.</p>
<p><a href="http://larryaronson.com/wp-content/uploads/chrome_icon.gif#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="size-medium wp-image-72 alignleft" title="chrome_icon" src="http://larryaronson.com/wp-content/uploads/chrome_icon.gif" alt="" width="165" height="156" /></a><a title="Download Google Chrome" href="http://google.com/chrome" target="_blank">Google Chrome</a> is a minimalist&#8217;s browser. It doesn&#8217;t offer a multitude of features, but it&#8217;s very fast and solid as a rock. It relies heavily on tabs when visiting different sites and each tab runs in its own process. This keeps the browser from crashing from a page error or some misbehaved plug-in, and prevents pages in the background from slowing down the foreground window. I like Chrome&#8217;s history function. When you open a new tab or window it displays thumbnails and links to your most recently vistited pages.</p>
<p>Chrome offers a single address bar for both URLs and keywords. <a href="http://google.com" target="_blank">Google</a> is the default search engine, but it can be switched to others—<a href="http://wikipedia.org" target="_blank">Wikipedia</a>, <a href="http://aol.com" target="_blank">Aol</a>, <a href="http://yahoo.com/" target="_blank">Yahoo</a>, etc. The address bar has a fast auto-suggest function. For flying around the Web from site to site, Chrome is a jet fighter. However, if you mostly stay put on a collection of actively fed &#8220;home&#8221; pages, Flock may be the browser for you. It&#8217;s a mega-cruise ship.</p>
<p><a href="http://larryaronson.com/wp-content/uploads/flock_icon1.gif#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="alignleft size-medium wp-image-73" title="flock_icon1" src="http://larryaronson.com/wp-content/uploads/flock_icon1.gif" alt="" width="136" height="128" /></a><a title="Visit the Flock, Inc. Website" href="http://flock.com/" target="_blank">Flock</a> is <a href="http://www.mozilla.org" target="_blank">Firefox</a> on social media steroids. Flock takes a framed approach to visiting the Social Media Web, grabing feeds from places, such as: <a href="http://facebook.com/" target="_blank">Facebook</a>, <a href="http://twitter.com/" target="_blank">Twitter</a> and <a href="http://myspace.com" target="_blank">MySpace</a> into sidebars and <a href="http://youTube.com/" target="_blank">YouTube</a> selections into a headband. Flock works best opened full-screen on a big, wide, LCD display. Beware! The shear number and variety of tool bars, control tabs, bookmarks, menus and search boxes can overwhelm.</p>
<p>Flock, by default, remembers the sites you had loaded when you last quit and reopens them. It also opens a generated page, &#8220;My World&#8221; that captures all your various feeds, messages and pings.  I like the way Flock integrates with Gmail, and find it useful as an &#8220;active desktop&#8221; – a one-stop site that I scan every so often to keep in the mix as I&#8217;m doing other work. Flock pops-up a standard blog editor when I want to post something  and just about anything can be shared with a drag-n-drop action.</p>
<p>The online support documentation provided by the these two new browsers also provide a facinating contrast. Google wrote <a href="http://www.google.com/googlebooks/chrome/" target="_blank">a </a><a href="http://www.google.com/googlebooks/chrome/" target="_blank">Chrome </a><a href="http://www.google.com/googlebooks/chrome/" target="_blank">comic book</a> that teaches you how to use Chrome with a technical depth that&#8217;s actually readable. Flock has uploaded a series of youTube <a title="Google Chrome Quick Start" href="http://www.youtube.com/watch?v=X1UrhhRnYYs" target="_blank">videos showing Flock&#8217;s Features</a> in action. Check it out, you&#8217;ll get a better idea of what Flock is like and I won&#8217;t have to insert a screenshot here.</p>
<p>Google Chome is only available now for Windows. When it becomes available for the Mac, I&#8217;ll probably be using both Flock and Chrome more often than Firefox and Safari.</p>
<p><em>— Larry</em></p>
<p><a href="http://www.youtube.com/watch?v=X1UrhhRnYYs"><br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://larryaronson.com/2008/two-new-browsers/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

