<?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>Mozilla Hacks - the Web developer blog &#187; Audio</title>
	<atom:link href="http://hacks.mozilla.org/category/audio/feed/" rel="self" type="application/rss+xml" />
	<link>http://hacks.mozilla.org</link>
	<description>hacks.mozilla.org</description>
	<lastBuildDate>Wed, 08 Feb 2012 22:52:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Introducing Aurora 11 with tons of new features and improvements</title>
		<link>http://hacks.mozilla.org/2011/12/introducing-aurora-11-with-tons-of-new-features-and-improvements/</link>
		<comments>http://hacks.mozilla.org/2011/12/introducing-aurora-11-with-tons-of-new-features-and-improvements/#comments</comments>
		<pubDate>Fri, 23 Dec 2011 17:58:26 +0000</pubDate>
		<dc:creator>Robert Nyman</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[Aurora]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[Featured Article]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=10611</guid>
		<description><![CDATA[We have now released Aurora 11, soon to become Firefox 11, and wanted to cover all the the things we have improved in this version! Highlights To quickly edit the outerHTML of an element, we have now added support for element.outerHTML. The Battery API Storing files in IndexedDB Support for loop attributes for media elements [...]]]></description>
			<content:encoded><![CDATA[<p>We have now released <a href="http://www.mozilla.org/en-US/firefox/channel/">Aurora 11</a>, soon to become Firefox 11, and wanted to cover all the the things we have improved in this version!</p>
<p><span id="more-10611"></span></p>
<h2>Highlights</h2>
<ul>
<li>To quickly edit the outerHTML of an element, we have now added support for element.outerHTML.</li>
<li>The Battery API</li>
<li>Storing files in IndexedDB</li>
<li>Support for loop attributes for media elements</li>
<li>SPDY (off by preferences)</li>
<li>WebSockets no longer needs a prefix when you call them</li>
</ul>
<h2>All new features</h2>
<p>Below is a list of all the new improvements in Aurora 11, grouped by category together with a link to each bug in bugzilla if you are interested in reading up more about it and its process.</p>
<h3>DOM</h3>
<ul>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=92264">Support element.outerHTML property</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=280391">SVGSVGElement.getElementById not implemented</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=692642">IndexedDB: support indexedDB.cmp</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=692630">IndexedDB: multientry indexes</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=692614">IndexedDB now support all key types, including floating point numbers, dates and arrays!</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=678694">Battery API</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=651072">Support HTML parsing in XMLHttpRequest per XMLHttpRequest Level 2</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=704171">Remove the no-argument form of requestAnimationFrame</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=704175">requestAnimationFrame callback function name should be &#8220;sample&#8221;, not &#8220;onBeforePaint&#8221;</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=647518">Allow mozRequestAnimationFrame requests to be cancelable</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=708173">Use cancelRequestAnimationFrame where appropriate instead of boolean flags</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=710981">Add mozCancelAnimationFrame</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=675884">Implement Event constructors</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=708701">Implement HTML event ctors</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=709127">Implement MouseEvent and UIEvent ctors</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=661877">Enable storing files in IndexedDB</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=694138">IndexedDB: Allow passing an array as keypath</a></li>
</ul>
<h3>GFX</h3>
<ul>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=631479">Add Graphite2 to gecko</a></li>
</ul>
<h3>Layout</h3>
<ul>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=627842">-moz-text-size-adjust CSS property</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=511909">[css3-conditional] allow @-rules inside of @media and @-moz-document</a></li>
</ul>
<h3>Media</h3>
<ul>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=449157">Implement the looping attributes in media elements</a></li>
</ul>
<h3>Network</h3>
<ul>
<li><a href="https://wiki.mozilla.org/Platform/Features/SPDY">SPDY (Preffed off)</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=573043">Enable Extended Protection (channel and service binding) for NTLM authentication</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=704989">add workaround for broken Outlook Web App (OWA) attachment handling</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=700589">HTTP content type charset parameter accepts single quotes</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=703380">XMLHttpRequest can fire an abort event after a load event, but should not</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=701787">Disallow responseType and withCredentials for sync XHR</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=664179">Allow Cross-Origin URLs in EventSource (Server-Sent Events)</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=707142">Support unprefixed responseType == &#8220;json&#8221; in XMLHttpRequest</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=676439">Implement Binary Messages for Websockets</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=664284">Add HSTS support for websockets</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=710964">No longer dispatch incoming WebSocket messages in CLOSING state</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=711205">Set WebSocket message size limit to 2 GB</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=695635">Tracking bug: unprefix WebSockets</a></li>
</ul>
<h3>Performance</h3>
<ul>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=666446">Lots of animated gifs swamp us with paint events</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2011/12/introducing-aurora-11-with-tons-of-new-features-and-improvements/feed/</wfw:commentRss>
		<slash:comments>42</slash:comments>
		</item>
		<item>
		<title>speak.js: Text-to-Speech on the Web</title>
		<link>http://hacks.mozilla.org/2011/08/speak-js-text-to-speech-on-the-web/</link>
		<comments>http://hacks.mozilla.org/2011/08/speak-js-text-to-speech-on-the-web/#comments</comments>
		<pubDate>Wed, 17 Aug 2011 18:36:56 +0000</pubDate>
		<dc:creator>azakai</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[Demo]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=9213</guid>
		<description><![CDATA[Text-to-Speech (TTS) can make content more accessible, but there is so far no simple and universal way to do that on the web. One possible approach is shown in this demo, which is powered by speak.js, a new 100% pure JavaScript/HTML5 TTS implementation. speak.js is a port of eSpeak, an open source speech synthesizer, from [...]]]></description>
			<content:encoded><![CDATA[<p>Text-to-Speech (TTS) can make content more accessible, but there is so far no simple and universal way to do that on the web. One possible approach is shown in <strong><a href="http://syntensity.com/static/espeak.html">this demo</a></strong>, which is powered by <a href="https://github.com/kripken/speak.js">speak.js</a>, a new 100% pure JavaScript/HTML5 TTS implementation. speak.js is a port of <a href="http://espeak.sourceforge.net/">eSpeak</a>, an open source speech synthesizer, from C++ to JavaScript using <a href="http://emscripten.org">Emscripten</a>.</p>
<p>Compiling an existing speech synthesis engine to JavaScript is a good way to avoid writing a complicated project like eSpeak from scratch. Once compiled, the eSpeak code in speak.js doesn&#8217;t know it&#8217;s running on the web: speak.js uses the <a href="https://github.com/kripken/emscripten/wiki/Filesystem-Guide"> Emscripten emulated filesystem</a> to &#8216;fake&#8217; the normal file reading and writing calls that the eSpeak C++ code has (fopen, fread, etc.). This allows the normal eSpeak datafiles to be used (either through an xhr, or by converting them to JSON and bundling them with the script file). The result of running the compiled eSpeak code is that it &#8216;writes&#8217; a .wav file with the generated audio to the emulated filesystem. speak.js then takes that data, encodes it using base64, and creates a data URL. That URL is then loaded in an HTML5 audio element, letting the browser handle playback. (Note that while that is a very simple way to do things, it isn&#8217;t the most efficient. speak.js has not yet focused on speed, but with some additional work it could be much faster, if that turns out to be an issue.)</p>
<p>Why would you want TTS in JavaScript? Well, with speak.js you can bundle a single .js file in your website, and then generating speech is about as simple as writing</p>
<blockquote>
<pre>speak("hello world")</pre>
</blockquote>
<p>(see the <a href="https://github.com/kripken/speak.js">speak.js website</a> for instructions). The generated speech will be exactly the same on all platforms, unlike if your users each did TTS in their own way (using an OS capability, or a separate program). speak.js can also be used to build browser addons in a straightforward way, since it&#8217;s pure JavaScript &#8211; no need for platform dependent binaries, and the addon will work the same on all OSes.</p>
<p>A few more comments:</p>
<ul>
<li>JavaScript is getting more and more capable all the time. The development versions of the top JavaScript engines today can run code compiled from C++ only 3-5X slower than a fast C++ compiler, and getting even better. As a consequence, expanding the capabilities of the web platform can in many cases be done in JavaScript or by compiling to JavaScript, instead of adding new code to the browsers themselves, which inevitably takes longer &#8211; especially if you wait for all browsers to implement a particular feature.</li>
<li>While speak.js uses only standards-based APIs, due to browser limitations it can&#8217;t work everywhere yet. It won&#8217;t work in IE, Safari or Opera since they don&#8217;t support typed arrays, nor in Chrome since it doesn&#8217;t support WAV data URLs. So currently speak.js only works properly in Firefox. However, the missing features just mentioned are not huge and hopefully those browser makers will implement them soon. It is also possible to implement workarounds in speak.js for these issues (see next comment).</li>
<li>Help with improving speak.js is very welcome! One important thing we need is to implement workarounds for the issues that prevent speak.js from running on the browsers it currently can&#8217;t run on. Another goal is to build browser addons using speak.js. Please get in touch <a href="https://github.com/kripken/speak.js">on github</a> if you want to help out.</li>
<li>eSpeak supports multiple languages so speak.js can too. You do need to include the additional language files though. <a href="http://syntensity.com/static/espeak_fr.html">Here</a> is an experimental build where you can switch between English and French support (note that it is an unoptimized build, so it will run slower).</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2011/08/speak-js-text-to-speech-on-the-web/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>JSMad &#8211; a JavaScript MP3 decoder</title>
		<link>http://hacks.mozilla.org/2011/06/jsmad-a-javascript-mp3-decoder/</link>
		<comments>http://hacks.mozilla.org/2011/06/jsmad-a-javascript-mp3-decoder/#comments</comments>
		<pubDate>Sun, 19 Jun 2011 12:57:31 +0000</pubDate>
		<dc:creator>Chris Heilmann</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[Firefox 4]]></category>
		<category><![CDATA[Firefox 5]]></category>
		<category><![CDATA[decoding]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[mp3]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=8466</guid>
		<description><![CDATA[It always amazes me just how fast modern browsers and their JavaScript engines are. And how creative people get when trying to make things work inside a browser instead of relying on a plugin that our end users would have to install (and more importantly constantly keep up to date). The latest thing that make [...]]]></description>
			<content:encoded><![CDATA[<p>It always amazes me just how fast modern browsers and their JavaScript engines are. And how creative people get when trying to make things work inside a browser instead of relying on a plugin that our end users would have to install (and more importantly constantly keep up to date). </p>
<p><a href="http://jsmad.org"><img src="http://hacks.mozilla.org/wp-content/uploads/2011/06/jsmad.png" alt="JS MAd" width="500"  /></a></p>
<p>The latest thing that make me go &#8220;wow&#8221; is <a href="http://jsmad.org">jsmad</a> (<a href="https://github.com/nddrylliog/jsmad">source on GitHub</a>) by <a href="http://twitter.com/#!/nddrylliog">Amos Wenger</a>, <a href="http://twitter.com/#!/jensnockert">Jens Nockert</a> and <a href="http://twitter.com/#!/mgeorgi">Matthias Georgi</a>. JSMad is an MP3 decoder in JavaScript! </p>
<p>&#8220;So what&#8221;, you say? Well, having JSMad means that now Firefox can play MP3 files without any Flash. It also means that you can listen to MP3 in the browser without the 64bit issues on Linux. With JSMad we can dive deep into the MP3 format and not only play the song but also get information about it. It allows us to build a lot of native dj-mixers, samplers and sequencers in the nearer future. </p>
<p>Right now JSMad works in Firefox 4+ and on Chrome 13.0+, if you enable the Web Audio API in &#8216;about:flags&#8217;. </p>
<p>I remember when MP3 came out and my computer back then was too slow to encode it without locking up in WinAmp. Back then a scene player also helped me out. Now we do the same inside a browser rather than desktop applications.</p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2011/06/jsmad-a-javascript-mp3-decoder/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>The story of an Audio &amp; WebGL Demo: No Comply</title>
		<link>http://hacks.mozilla.org/2011/03/nocomply/</link>
		<comments>http://hacks.mozilla.org/2011/03/nocomply/#comments</comments>
		<pubDate>Fri, 25 Mar 2011 16:49:27 +0000</pubDate>
		<dc:creator>Paul Rouget</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[Demo]]></category>
		<category><![CDATA[Firefox 4]]></category>
		<category><![CDATA[WebGL]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=7727</guid>
		<description><![CDATA[The audio team is made up of a group Mozilla volunteers who developed the Audio API and, most recently,  a new generation of WebGL demos. This is the story of the development of the No Comply demo. In the fall, after finishing Flight of the Navigator, our team of audio and WebGL hackers was looking [...]]]></description>
			<content:encoded><![CDATA[<p><em><br />
The audio team is made up of a group Mozilla volunteers who developed the <a href="https://developer.mozilla.org/en/Introducing_the_Audio_API_Extension">Audio API</a> and, most recently,  a new generation of WebGL demos. This is the story of the development of the <a href="http://webofwonder.org/en-US/#nocomply">No Comply</a> demo.<br />
</em></p>
<p><a href="http://hacks.mozilla.org/wp-content/uploads/2011/03/nocomply.png"><img src="http://hacks.mozilla.org/wp-content/uploads/2011/03/nocomply-500x293.png" alt="" title="nocomply" width="500" height="293" class="aligncenter size-large wp-image-7738" /></a></p>
<p>In the fall, after finishing <a href="https://demos.mozilla.org/en-US/#fotn">Flight of the Navigator</a>, our team of audio and WebGL hackers was looking for a new challenge.  We&#8217;d finished the new Audio API in time for Firefox 4, and were each maintaining various open web libraries, exploiting the new features of HTML5, Audio, JavaScript, and WebGL. We wanted to take another shot at testing the limits of Firefox 4 &#8211; then, still in beta.</p>
<p><a href="http://kraddyodaddy.com"><img src="http://hacks.mozilla.org/wp-content/uploads/2011/03/kraddy-logo-220x125.png" alt="" title="kraddy-logo" width="220" height="125" style="background-color: black; float: right; padding: 10px; margin: 10px;" /></a></p>
<p><a href="http://twitter.com/binder">Seth Bindernagel</a> had the answer.  He&#8217;d been in contact with a DJ and producer friend named <a href="http://kraddyodaddy.com/">Kraddy</a>, who had just finished an amazing new album.  &#8220;What if we tried to do something with his sound?&#8221;  The idea was too good to pass up, and with Kraddy&#8217;s support, we dove into the tracks and started imagining what these songs might look like, when interpreted through the medium of the web.</p>
<p><q style="font-style: italic; font-size: 1.5em; text-align: left; ">«The web that Firefox 4 makes possible is a web ready for artists, developers, filmmakers, and musicians alike»</q></p>
<p>Kraddy&#8217;s music was easy to demo because of its complex nature, with plenty of emphatic transitions and cue points&#8211;this music wants to be visualized!  The music for No Comply also provided a dark and introspective sound on which to build a narrative.  On <a href="http://kraddyodaddy.com/the-meaning-of-labyrinth/">his blog</a>, Kraddy had already written about how he understood the album&#8217;s meaning:</p>
<blockquote><p>This EP is about Theseus&#8217; decision to be a hero and his decent into the Labyrinth to kill the Minotaur. In a broader sense the EP is about the battle we all face when we challenge ourselves as people.  We must enter the Labyrinth of our minds and at the center we find our  greatest fears.  To defeat those fears we must kill a part of ourselves. And in killing a part of ourselves we create the potential to grow into a more developed person.</p></blockquote>
<p>Kraddy&#8217;s vision informed our early outlines and <a href="http://audioscene.org/scene-files/humph/boards.pdf">storyboards</a>.  We knew that we wanted to play on the story of the Minotaur and the Maze, and the idea of facing down ones&#8217; own fears.  Together we came up with the idea of re-telling the story using a mixture of real-life video and 8-bit video game styling.  Because the album was deeply personal to Kraddy, we decided to feature him in the demo.  Kraddy agreed to be filmed, and <a href="http://twitter.com/remixmanifesto">Brett Gaylor</a> used the footage to create the opening and closing video sequences.  We also used Kraddy as the inspiration for the demo&#8217;s main video game character.</p>
<p><a href="http://audioscene.org/scene-files/humph/boards.pdf"><img src="http://hacks.mozilla.org/wp-content/uploads/2011/03/sb-250x387.png" alt="" title="sb" width="210" style="float: right;  margin: 10px;" /></a></p>
<p>The launch of Firefox 4 brings a lot to the web, not least WebGL.  As the web shifts from a 2D-only to a 2D and 3D space, we wanted to explore the intersection of these two familiar graphical paradigms.  Rather than picking just one, we chose to create a hybrid, dream world, composed of 3D and 2D elements.  Many people will recognize in our 2D characters and graphics an homage to much earlier video games, like Double Dragon.  We wanted to celebrate the fact that these two paradigms can now exist together in a simple web page&#8211;everything we do in the demo is one web page, whether audio, video, 2D, 3D, or text.</p>
<p>Like the <a href="https://demos.mozilla.org/en-US/#fotn">Flight of the Navigator(FOTN)</a> demo before it, we chose the <a href="https://github.com/cjcliffe/CubicVR.js">CubicVR.js</a> engine to drive all the 3D graphics. Over the months leading up to the demo, <a href="http://twitter.com/ccliffe">Charles J. Cliffe</a> had begun the painstaking process of porting features from his C++ engine over to JavaScript.  The simple environment of WebGL and JavaScript allowed for features that even his C++ version did not yet posses to be quickly prototyped.  Many bottlenecks had to be overcome during iterations of the demo, as we wanted to push the limits further than before. The biggest hurdle was visibility and lighting.  Luckily, <a href="http://twitter.com/secretrobotron">Bobby Richter</a> came to the rescue.  Using his experience with Octrees, he was able to work with Charles to produce a visibility and lighting pipeline which provides impressive performance for the task. In contrast, FOTN has no visibility system and was shaded by a single global directional light and ambient surface textures (for window lights, etc.) to simulate the rest.  In No Comply we were able to push the limits with high poly counts and many overlapping point lights and were still able to reach the framerate cap.</p>
<p><a href="http://hacks.mozilla.org/wp-content/uploads/2011/03/nocomply2.png"><img src="http://hacks.mozilla.org/wp-content/uploads/2011/03/nocomply2-500x293.png" alt="" title="nocomply2" width="500" height="293" class="aligncenter size-large wp-image-7739" /></a></p>
<p>Creating a 3D world like the one in this demo requires a lot of original content creation, which in turn requires some sophisticated tools. Instead of developing our own, and in the open-nature of our group, we decided to use existing technology like <a href="http://www.blender.org/">Blender</a>. The community that develops Blender and creates content with it is rich and diverse, and because it&#8217;s an open tool, we could add the features we needed when they weren&#8217;t already present.</p>
<p>Our preference for open technologies also meant that the <a href="https://collada.org/mediawiki/index.php/COLLADA_-_Digital_Asset_and_FX_Exchange_Schema">COLLADA</a> scene format was an obvious choice. Unfortunately, as of version 2.49, Blender exports an Autodesk-inspired format of COLLADA, which isn&#8217;t quite up to the official standard, missing many important bits of information. Fixing this directly in Blender (with a little bit of Python hacking) let CubicVR stay standards-compliant, and let us milk Blender for all of the scene information we could think of using.</p>
<p>The demo&#8217;s 3D modelling, while important, comprises perhaps only half of No Comply&#8217;s original content. An incredible undertaking on the part of <a href="http://twitter.com/thesearethings">Omar Noory</a> provided the textures for the rich environment through which Kraddy rumbles and tumbles. Frequently, spontaneous requests for &#8220;an 8 bit trash can,&#8221; &#8220;a cool sign with our names on it,&#8221; or, &#8220;some beefy bad lookin&#8217; dudes&#8221; were answered almost instantly by Omar&#8217;s gracious and masterful digital pen.  You may have recognized Omar&#8217;s name from his claim to meme-fame with <a href="http://knowyourmeme.com/memes/haters-gonna-hate">&#8220;Haters Gonna Hate&#8221;</a>.</p>
<p>Adding the perfect amount of flare to the graphics pipeline is <a href="http://twitter.com/F1LT3R">Al MacDonald&#8217;s</a> <a href="https://github.com/F1LT3R/burst-core">Burst animation engine</a>. Al not only wrote our sprite animation engine, but also the <a href="https://github.com/F1LT3R/sprite-viking">web-based toolset</a> we used to create the animations.  The 8-bit Kraddy and all of No Comply&#8217;s 8-bit baddies are driven by animation paths prepared with Burst, and engineered with a set of tools that work right inside the browser.</p>
<p><a href="http://hacks.mozilla.org/wp-content/uploads/2011/03/screenshot2.jpg"><img src="http://hacks.mozilla.org/wp-content/uploads/2011/03/screenshot2.jpg" alt="" title="nocomply" width="458" height="230" class="aligncenter size-full wp-image-7743" /></a></p>
<p>In addition to cutting edge graphics with WebGL and &lt;canvas&gt;, we also wanted to explore how far we could push the new <a href="https://wiki.mozilla.org/Audio_Data_API">Firefox 4 Audio API</a> we&#8217;d developed.  The Audio Data API allows us to do many new things with the HTML5 &lt;audio&gt; and &lt;video&gt; tags, such as outputting generated audio and revealing realtime audio data to JavaScript. Libraries like <a href="http://twitter.com/corban">Corban Brook&#8217;s</a> <a href="https://github.com/corbanbrook/dsp.js">DSP.js</a> and and Charles&#8217; <a href="http://sourceforge.net/projects/beatdetektor/">BeatDetektor.js</a> were used to analyze the audio in realtime and trigger various effects and animation sequences. Tracks of audio triggers were also recorded for tighter sequencing of key elements in the song we wanted to emphasize. One of the really new techniques we played with a lot in the demo was controlling GLSL shaders and lighting directly with audio, punching in and out with every beat and clap.  Unlike most treatments of audio on the web, in this demo the song isn&#8217;t a background element, but is woven into the fabric of all the visuals and effects.</p>
<p>Getting  a demo of this scale to work in the browser means figuring out how to make every bit of it work fast, and keep framerates high.  Everything we do in the demo, from loading and parsing massive COLLADA models, to controlling 3D scene graphs, to analyzing real-time audio data, is done with JavaScript.  We think it&#8217;s important to point this out because so many people begin with the assumption that JavaScript isn&#8217;t fast enough for the kind of work we&#8217;re presenting.  The truth is that modern JavaScript, like that in Firefox 4, has been so heavily optimized that we all need to rethink what is and isn&#8217;t possible on the web.</p>
<p>We&#8217;ve taken advantage of a bunch of Firefox 4&#8242;s new performance features, as well as new HTML5 goodies, in order to make this all possible.  For example <a href="https://developer.mozilla.org/en/using_web_workers">Web Workers</a> let us move heavy resource parsing off the main thread, freeing it for audio analysis and 3D effects. While a large portion of each second is consumed by simply pushing information to the video card, it isn&#8217;t necessary for the browser to wait for that to happen. In the background, we can use other threads to load and parse data, so that it&#8217;s ready to draw when the main thread needs it. Of course, a host of problems arise immediately whenever concurrency is involved, but we managed to draw a large performance and overall stability increase by utilizing Web Workers.</p>
<p>Another performance trick was using JavaScript <a href="https://developer.mozilla.org/en/JavaScript_typed_arrays">Typed Arrays</a>, which give us a tremendous speed boost when working with audio and pixel data. When you&#8217;re analyzing slices of audio data hundreds of bytes wide as fast as possible, your Fourier Transform code needs to be blazingly quick. Thanks to Corban&#8217;s highly optimized dsp.js library, this was hardly on our minds.</p>
<p>Next, we spent a lot of time optimizing our JavaScript so that it could take advantage of Firefox&#8217;s <a href="https://developer.mozilla.org/En/SpiderMonkey/Internals/Tracing_JIT">Tracing</a> and Method JIT. Writing code that can be easily byte-compiled by the browser makes sure that anything we write runs as fast as possible. This is a fairly new and surprising concept, especially to those who remember the JavaScript of yesterday.
<p>Part of what appealed to us about writing this demo was that it let those of us who are browser developers, and those of us who are web developers, work together on a single project.  Most of the technology showcased in this demo was made on bleeding edge Firefox nightlies and our development process involved lots of feedback about performance or stability issues in the browser.  <a href="http://twitter.com/humphd">Dave Humphrey</a> focused on the internals of the Audio API, instrumenting and profiling our JavaScript, and helped us work closely with Mozilla&#8217;s JavaScript, graphics, and WebGL engineers.  People like Benoit Jacob and Boris Zbarsky, among others, were indispensable as we worked to fix various bottlenecks.  Part of what makes Mozilla such a successful project is that their engineers are not locked away, unable to work with web developers.  Having engineers at our beck and call was essential to our success with such a demanding schedule, and we were proud to be able to help Mozilla test and improve Firefox 4 along the way.</p>
<p>Beyond the technical aspects of the demo, it also points to the spirit of how these technologies are meant to be used.  We worked as a distributed team during evenings and on weekends, to plan and code and create everything, from the tools we needed to the graphical resources to the demo&#8217;s final code.  Some of our team are browser developers, some web and audio hackers, others are graphic designers or filmmakers, still others storytellers and writers&#8211;everyone had a place around the table, and a role to play.  We think this is part of what makes the web such a powerful platform for creative and collaborative work: there isn&#8217;t one right way to be, no single technology you need to know, and the techniques and tools are democratized and open to anyone willing to pick them up.  <strong>The web that Firefox 4 makes possible is a web ready for artists, developers, filmmakers, and musicians alike</strong>.</p>
<style>
p {text-align: justify}
</style>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2011/03/nocomply/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Talking about HTML5 games development at MIT in Boston</title>
		<link>http://hacks.mozilla.org/2011/01/talking-about-html5-games-development-at-mit-in-boston/</link>
		<comments>http://hacks.mozilla.org/2011/01/talking-about-html5-games-development-at-mit-in-boston/#comments</comments>
		<pubDate>Mon, 17 Jan 2011 12:40:02 +0000</pubDate>
		<dc:creator>Chris Heilmann</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[Challenge]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[competition]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[MIT]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=7060</guid>
		<description><![CDATA[As part of our university outreach programme, a few Mozilla people and volunteers went to Boston last week to give a series of lectures on web technologies for games development. During the week we covered topics like WebGL for 3D development, basics of JavaScript, debugging and performance, canvas development, offline development and local storage and [...]]]></description>
			<content:encoded><![CDATA[<p>As part of our university outreach programme, a few Mozilla people and volunteers went to Boston last week to give a series of lectures on web technologies for games development. </p>
<p>During the week we covered topics like WebGL for 3D development, basics of JavaScript, debugging and performance, canvas development, offline development and local storage and multimedia on the web. We&#8217;ll make these slides available in the comments to this blog post.</p>
<p>The <a href="http://www.slideshare.net/cheilmann/multimedia-on-the-web-html5-video-and-audio">slides of the multimedia talk</a> are available here: </p>
<p><iframe style="border:none;width:550px;height:458px;" src="http://icant.co.uk/slidesharehtml/embed.php?url=http://www.slideshare.net/cheilmann/multimedia-on-the-web-html5-video-and-audio&#038;width=500"></iframe></p>
<p>The topics covered were:</p>
<ul>
<li>Quick history of Multimedia on the web</li>
<li>Annoyances with Flash</li>
<li>HTML5 audio and video</li>
<li>Codecs and conversion</li>
<li>Embedding video and audio</li>
<li>Controlling video</li>
<li>Transforming video</li>
<li>Making realtime changes</li>
<li>Awesome new audio possibilities</li>
</ul>
<p>We showed and explained a few demos like:</p>
<ul>
<li>The <a href="http://www.w3.org/2010/05/video/mediaevents.html">Media events demo page at the W3C web site</a></li>
<li> The <a href="http://isithackday.com/spirit-of-indiana/">Spirit of Indiana demo</a> syncing a Google Maps animation with a video</li>
<li><a href="http://isithackday.com/mit/transforming-video.html">Transforming Video</a> to create a player that allows you to zoom inside a video and rotate it using CSS transformations</li>
<li><a href="http://people.mozilla.com/~prouget/demos/round/index.xhtml">Paul Rouget&#8217;s round video demo</a> showing how to create a play/pause button in SVG, greyscale a video and rotate it using CSS transformations</li>
<li><a href="http://people.mozilla.com/~prouget/demos/mashup/video.xhtml">Paul&#8217;s Video Mashup demo</a> showing how to apply SVG filters like Gaussian Blur, masking and how to apply CSS transforms to a running video</li>
<li><a href="http://introducinghtml5.com/examples/ch05/animate-with-video.html">Remy Sharp&#8217;s round video demo</a> showing how to create a rotating, bouncing circle that contains a video</li>
<li><a href="http://people.mozilla.com/~prouget/demos/green/green.xhtml">Paul Rouget&#8217;s Green demo</a> showing how to simulate a green screen effect with open web technologies.</li>
<li><a href="http://people.mozilla.com/~prouget/demos/DynamicContentInjection/play.xhtml">The dynamic content injection</a> demo showing how to embed content into a video after analysing it for injection hotspots.</li>
<li>The <a href="http://people.mozilla.com/~prouget/demos/tracker/tracker.xhtml">Tracker demo</a> showing how to detect human shapes and movement in a video</li>
<li>The <a href="http://nerget.com/edgeDetection/">edge detection</a> demo shows how to detect edges in a live video using JavaScript</li>
<li>The <a href="http://hacks.mozilla.org/2011/01/html5guitar/">HTML5 Guitar Tab generator</a></li>
<li>The <a href="http://audioscene.org/scene-files/humph/sfxr/">sfxr</a> sound effect library</li>
</ul>
<p>I also provided <a href="http://www.wait-till-i.com/2011/01/16/lecturing-at-mit-about-html5-video-slides-and-lots-of-notes/">extensive notes for the whole talk with code examples</a> on my own blog.</p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2011/01/talking-about-html5-games-development-at-mit-in-boston/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>People of HTML5 &#8211; Remy Sharp</title>
		<link>http://hacks.mozilla.org/2011/01/people-of-html5-remy-sharp/</link>
		<comments>http://hacks.mozilla.org/2011/01/people-of-html5-remy-sharp/#comments</comments>
		<pubDate>Tue, 11 Jan 2011 10:27:25 +0000</pubDate>
		<dc:creator>Chris Heilmann</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[IndexedDB]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Offline]]></category>
		<category><![CDATA[People of HTML5]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Standards]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[Web Developers]]></category>
		<category><![CDATA[chrisheilmann]]></category>
		<category><![CDATA[peopleofhtml5]]></category>
		<category><![CDATA[remysharp]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=7009</guid>
		<description><![CDATA[HTML5 needs spokespeople to work. There are a lot of people out there who took on this role, and here at Mozilla we thought it is a good idea to introduce some of them to you with a series of interviews and short videos. The format is simple &#8211; we send the experts 10 questions [...]]]></description>
			<content:encoded><![CDATA[<p>HTML5 needs spokespeople to work. There are a lot of people out there who took on this role, and here at Mozilla we thought it is a good idea to introduce some of them to you with a series of interviews and short videos. The format is simple &#8211; we send the experts 10 questions to answer and then do a quick video interview to let them introduce themselves and ask for more detail on some of their answers.</p>
<p><a href="http://www.html5today.it/news/people-of-html5-chris-heilmann-intervista-remy-sharp">Leggi la traduzione in italiano</a></p>
<p><a href="http://www.flickr.com/photos/remysharp/5176768276/" title="Remy Sharp by Remy Sharp, on Flickr"><img src="http://farm5.static.flickr.com/4125/5176768276_b1934d74a9_m.jpg" width="159" height="240" alt="Remy Sharp" style="float:left;margin:5px"></a>Today we are featuring <a href="http://remysharp.com">Remy Sharp</a> co-author of <a href="http://introducinghtml5.com/">Introducing HTML5</a> and organiser of the <a href="http://2010.full-frontal.org/">Full Frontal</a> conference in Brighton, England. </p>
<p>Remy is one of those ubiquitous people of HTML5. Whenever something needed fixing, there is probably something on GitHub that Remy wrote that helps you. He is also very English and doesn&#8217;t mince his words much.  </p>
<p>You can find Remy on Twitter as <a href="http://twitter.com/rem">@rem</a>. </p>
<h2 style="clear:both">The video interview</h2>
<p><video controls="true" height="295" width="480"><source src="http://www.archive.org/download/PeopleOfHtml5-RemySharp/remy_512kb.mp4" type="video/mp4"><source src="http://www.archive.org/download/PeopleOfHtml5-RemySharp/remy.webm" type="video/webm"><source src="http://www.archive.org/download/PeopleOfHtml5-RemySharp/remy.ogv" type="video/ogg">Your browser does not support the video tag, <a href="http://www.youtube.com/watch?v=fWwTv_AhFgw">check the video on YouTube</a>.</video></p>
<p><a href="http://www.youtube.com/watch?v=fWwTv_AhFgw">Watch the video on YouTube</a> or Download it from <a href="http://www.archive.org/details/PeopleOfHtml5-RemySharp">Archive.org</a> as <a href="http://www.archive.org/download/PeopleOfHtml5-RemySharp/remy_512kb.mp4">MP4 (98 MB)</a>, <a href="http://www.archive.org/download/PeopleOfHtml5-RemySharp/remy.ogv">OGG (70 MB)</a> or <a href="http://www.archive.org/download/PeopleOfHtml5-RemySharp/remy.webm">WebM (68MB)</a></p>
<h2>Ten questions about HTML5 for Remy Sharp</h2>
<h3>1) Reading &#8220;Introducing HTML5&#8243; it seems to me that you were more of the API &#8211; focused person and Bruce the markup guy. Is that a fair assumption? What is your background and passion?</h3>
<p>That&#8217;s spot on.  Bruce asked me to join the project as the &#8220;JavaScript guy&#8221; &#8211; which is the slogan I wear under my clothes and frequently reveal in a superman &#8216;spinning around&#8217; fashion (often at the surprise of clients).</p>
<p>My background has always been coding &#8211; even from a young age, my dad had me copying out listings from old spectrum magazines only to result in hours of typing and some random error that I could never debug.</p>
<p>As I got older I graduated to coding in C but those were the days the SDKs were 10Mb downloaded over a 14kb modem, and compile in to some really odd environment.  Suffice to say I didn&#8217;t get very far.</p>
<p>Then along came JavaScript.  A programming language that didn&#8217;t require any special development environment.  I could write the code in Notepad on my dodgy Window 95 box, and every machine came with the runtime: the browser.  Score!</p>
<p>From that point on the idea of instant gratification from the browser meant that I was converted &#8211; JavaScript was the way for me.</p>
<p>Since then I&#8217;ve worked on backend environments too (yep, I&#8217;m a Perl guy, sorry!), but always worked and played in the front end in some way or another.  However, since started on my own in 2006, it&#8217;s allowed me to move focus almost entirely on the front end, and specialise in JavaScript.  Basically, work-wise: I&#8217;m a pig in shit <strong>[Ed: for our non-native English readers, he means "happy")]</strong>.</p>
<h3>2) From a programmer&#8217;s point of view, what are the most exciting bits about the HTML5 standard? What would you say is something every aspiring developer should get their head around first?</h3>
<p>For me, the most exciting aspects of HTML5 is the depth of the JavaScript APIs.  It&#8217;s pretty tricky to explain to Joe Bloggs that actually this newly spec&#8217;ed version of HTML isn&#8217;t mostly HTML; it&#8217;s mostly JavaScript.  </p>
<p>I couldn&#8217;t put my finger on one single part of the spec, only because it&#8217;s like saying which is your favourite part of CSS (the :target selector &#8211; okay, so I can, but that&#8217;s not the point!).  What&#8217;s most exciting to me is that HTML5 is saying that the browser is the platform that we can deliver real applications &#8211; take this technology seriously.</p>
<p>If an aspiring developer wanted something quick and impressive, I&#8217;d say play around with the video API &#8211; by no means is this the best API, just an easy one. </p>
<p>If they really wanted to blow people away with something amazing using HTML5, I&#8217;d say learn JavaScript (I&#8217;m assuming they&#8217;re already happy with HTML and CSS). Get a book like JavaScript: The Good Parts and then get JavaScript Patterns and master the language. Maybe, just maybe, then go buy Introducing HTML5, it&#8217;s written by two /really/ good looking (naked) guys: <a href="http://flic.kr/p/8iyQTE">http://flic.kr/p/8iyQTE</a> and <a href="http://flic.kr/p/8iy6Z1">http://flic.kr/p/8iy6Z1</a> <strong>[Ed: maybe NSFW, definitely disturbing]</strong>.</p>
<h3>3) In your book you wrote a nice step-by-step video player for HTML5 video. What do you think works well with the Video APIs and what are still problems that need solving?</h3>
<p>The media API is dirt simple, so it means working with video and audio is a doddle. For me, most of it works really well (so long as you understand the loading process and the events). </p>
<p>Otherwise what&#8217;s really quite neat, is the fact I can capture the video frames and mess with them in a canvas element &#8211; there&#8217;s lots of fun that can be had there (see some of <a href="http://people.mozilla.com/~prouget/demos/">Paul Rouget&#8217;s demos</a> for that!).</p>
<p>What sucks, and sucks hard, is the spec asks vendors, ie. browser makers, *not* to implement full screen mode. It uses security concerns as the reason (which I can understand), but Flash solved this long ago &#8211; so why not follow their lead on this particular problem? If native video won&#8217;t go full screen, it will never be a competitive alternative to Flash for video. </p>
<p>That all said, I do like that the folks behind WebKit went and ignored the spec, and implemented full screen. The specs are just guidelines, and personally, I think browsers should be adding this feature. </p>
<h3>4) Let&#8217;s talk a bit about non-HTML5 standards, like Geolocation. I understand you did some work with that and found that some parts of the spec work well whilst others less so. Can you give us some insight?</h3>
<p>On top of HTML5 specification there&#8217;s a bunch more specs that make the browser really, really exciting. If we focus on the browser being released today (IE9 included) there&#8217;s a massive amount that can be done that we couldn&#8217;t do 10 years ago. </p>
<p>There&#8217;s the &#8220;non-HTML5&#8243; specs that actually were part of HTML5, but split out for good reason (so they can be better managed), like web storage, 2D canvas API and Web Sockets, but there&#8217;s also the /really/ &#8220;nothing-to-do-with-HTML5&#8243; APIs (NTDWH5API!) like querySelector, XHR2 and the Device APIs. I&#8217;m super keen to try all of these out even if they&#8217;re not fully there in all the browsers. </p>
<p>Geolocation is a great example of cherry picking technology. Playing against the idea that the technology isn&#8217;t fully implemented. Something I find myself ranting on and on about when it comes to the question of whether a developer should use HTML5.  Only 50% of Geolocation is implemented in the browsers supporting it, in that they don&#8217;t have altitude, heading or speed &#8211; all of which are part of the spec. Does that stop mainstream apps like Google Maps from using the API? (clue: no).</p>
<p>The guys writting the specs have done a pretty amazing job, and in particular there are few cases where the specs have been retrospectively written.  XHR is one of these and now we&#8217;ve got a stable API being added in new browsers (i.e. IE6 sucks, yes, we all know that).  Which leads us to drag and drop.  The black sheep of the APIs.  In theory a really powerful API that could make our applications rip, but the technical implementation is a shambles.  <a href="http://www.quirksmode.org/blog/archives/2009/09/the_html5_drag.html">PPK (Peter-Paul Koch) tore the spec a bit of a &#8216;new one&#8217;</a>.  It&#8217;s usable, but it&#8217;s confusing, and lacking.</p>
<p>Generally, I&#8217;ve found the &#8220;non-HTML5&#8243; specs to be a bit of mixed bag.  Some are well supported in new browsers, some not at all.  SVG is an oldie and now really viable with the help of JavaScript libraries such as <a href="http://raphaeljs.com">Raphaël.js</a> or <a href="http://code.google.com/p/svgweb/">SVGWeb</a> (a Flash based solution). All in all, there&#8217;s lots of options available in JavaScript API nowadays compared to back in the dark ages. </p>
<h3>5) Let&#8217;s talk Canvas vs. SVG for a bit. Isn&#8217;t Canvas just having another pixel-based rectangle in the page much like Java Applets used to be? SVG, on the other hand is Vector based and thus would be a more natural tool to do something with open standards that we do in Flash now. When would you pick SVG instead of Canvas and vice versa?</h3>
<p>Canvas, in a lot of ways is just like the Flash drawing APIs.  It&#8217;s not accessible and a total black box.  The thing is, in the West, there&#8217;s a lot of businesses, rightly or wrongly, that want their fancy animation thingy to work on iOS.  Since Flash doesn&#8217;t work there, canvas is a superb solution.</p>
<p>However, you must, MUST, decide which technology to use.  Don&#8217;t just use canvas because you saw a <a href="http://blog.nihilogic.dk/2008/05/javascript-super-mario-kart.html">Mario Kart demo</a> using it.  Look at the pros and cons of each.  SVG and the canvas API are not competitive technologies, they&#8217;re specially shaped hammers for specific jobs.</p>
<p>Brad Neuberg did a superb job of summarising the pros and cons of each, and I&#8217;m constantly referring people to it (here&#8217;s the <a href="http://www.youtube.com/watch?v=siOHh0uzcuY#t=17m00s">video</a>).</p>
<p>So it really boils down to:</p>
<ul>
<li>Canvas: pixel manipulation, non-interactive and high animation</li>
<li>SVG: interactive, vector based</li>
</ul>
<p>Choose wisely young padawan!</p>
<h3>6) What about performance? Aren&#8217;t large Canvas solutions very slow, especially on mobile devices? Isn&#8217;t that a problem for gaming? What can be done to work around that?</h3>
<p>Well&#8230;yes and no.  I&#8217;m finishing a project that has a large canvas animation going on, and it&#8217;s not slow on mobile devices (not that it was designed for those).  The reason it&#8217;s not slow is because of the way the canvas animates.  It doesn&#8217;t need to be constantly updating at 60fps.</p>
<p>Performance depends on your application.  Evaluate the environment, the technologies and make a good decision.  I personally don&#8217;t think using a canvas for a really high performance game on a mobile is quite ready.  I don&#8217;t think the devices have the ommph to get the job done &#8211; but there&#8217;s a hidden problem &#8211; the browser in the device isn&#8217;t quite up to it.  Hardware acceleration is going to help, a lot, but today, right now, I don&#8217;t think we&#8217;ll see games like Angry Birds written in JavaScript.  </p>
<p>That said&hellip; I&#8217;ve seriously considered how you could replicate a game like <a href="http://www.adamatomic.com/canabalt/">Canabalt</a> using a mix of canvas, DIVs and CSS.  I think it might be doable ::throws gauntlet::</p>
<p>I think our community could actually learn a lot from the Flash community.  They&#8217;ve been through all of this already.  Trying to make old versions of Flash from years back do things that were pushing the boundaries.  People like Seb Lee-Delisle (<a href="http://twitter.com/seb_ly">@seb_ly</a> / <a href="http://seb.ly">http://seb.ly</a>) are doing an amazing job of teaching both the Flash and JavaScript community.</p>
<h3>7) A feature that used to be HTML5 and is now an own spec is LocalStorage and its derivatives Session Storage or the full-fledged WebSQL and IndexedDB. Another thing is offline storage. There seems to be a huge discussion in developer circles about what to use when and if NoSQL solutions client side are the future or not. What are your thoughts? When can you use what and what are the drawbacks?</h3>
<p>Personally I love seeing server-less applications. Looking at the storage solutions I often find it difficult to see why you wouldn&#8217;t use WebStorage every time. </p>
<p>In a way it acts like (in my limited experience of) NoSQL, in that you lookup a key and get a result. </p>
<p>Equally, I think SQL in the browser is over the top. Like you&#8217;re trying to use the storage method *you* understand and forcing it into the browser. Seems like too much work for too little win.</p>
<p>Offline Apps, API-wise, ie. the application cache is /really/ sexy. Like sexy with chocolate on top sexy. The idea that our applications can run without the web, or switch when it detects it&#8217;s offline is really powerful. The only problem is that the events are screwed. The event to say your app is now offline requires the user to intervene via the browser menu, telling the browser to &#8220;work in offline mode&#8221;. A total failure of experience. What&#8217;s worse is that, as far as I know, there&#8217;s no plan to make offline event fire properly :-(</p>
<p>That all said, cookies are definitely dead for me. I&#8217;ve yet to find a real solution for cookies since I found the Web Storage API &#8211; and there&#8217;s a good decent number of polyfills for Web Storage &#8211; so there&#8217;s really no fear of using the API. </p>
<h3>8) Changing the track a bit, you&#8217;ve built the HTML5shiv to make HTML5elements styleable in IE. This idea sparked quite a lot of other solutions to make IE6 work with the new technologies (or actually simulate them). Where does this end? Do you think it is worth while to write much more code just to have full IE6 support?</h3>
<p>There&#8217;s two things here:</p>
<ol>
<li>Supporting IE6 (clue: don&#8217;t)</li>
<li>Polyfills</li>
</ol>
<p>IE6, seriously, and for the umpteenth time, look at your users.  Seriously.  I know the project manager is going to say they don&#8217;t know what the figures are, in that case: find out!  Then, once you&#8217;ve got the usage stats in hand, you know your audience and you know what technology they support.</p>
<p>If they&#8217;re mostly IE6 users, then adding native video with spinning and dancing canvas effect isn&#8217;t going to work &#8211; not even with shims and polyfills.  IE6 is an old dog that just isn&#8217;t up to doing the mileage he used to be able to do back in his prime.  But enough on this subject &#8211; the old &#8216;do I, or don&#8217;t I developer for IE6&#8242; is long in the tooth.</p>
<p>Polyfills &#8211; that&#8217;s a different matter.  They&#8217;re not there to support IE6, they&#8217;re there to bring browsers up to your expectations as a developer.  However, I&#8217;d ask that you carefully consider them before pulling them in.  The point of these scripts is they plug missing APIs in those older browsers.  &#8220;Old browsers&#8221; doesn&#8217;t particularly mean IE6.  For example, the Web Sockets API has a polyfill by way of Flash.  If native Web Sockets aren&#8217;t there, Flash fills the gap, but the API is exposed in exactly the same manner, meaning that you don&#8217;t have to fork your code.</p>
<p>I don&#8217;t think people should be pulling in scripts just for the hell of it.  You should consider what you&#8217;re trying to achieve and decide whether X technology is the right fit.  If it is, and you know (or expect) your users have browsers that don&#8217;t support X technology &#8211; should you plug it with JavaScript or perhaps should you consider a different technology?</p>
<p>This exact same argument rings true for when someone adds jQuery just to add or remove a class from an element.  It&#8217;s simply not worth it &#8211; but clearly that particular developer didn&#8217;t really understand what they needed to do.  So is education the solution?  I should hope so.</p>
<h3>9) Where would you send people if they want to learn about HTML5? What are tutorials that taught you a lot? Where should interested people hang out?</h3>
<p><a href="http://html5doctor.com">HTML5 Doctor</a> &#8211; fo sho&#8217;.  :)</p>
<p>I tend to also direct people to my <a href="http://html5demos.com">http://html5demos.com</a> simply to encourage viewing source, and hacking away.  </p>
<p>Regarding what tutorials taught me &#8211; if I&#8217;m totally honest, the place I&#8217;ve learnt the most from is actually HTML5Doctor.com. There&#8217;s some pretty good JavaScript / API tutorials coming from the chaps at <a href="http://bocoup.com">http://bocoup.com</a>.  Otherwise, I actually spend a lot of time just snooping through the specifications, looking for bits that I&#8217;ve not seen before and generally poking them with a stick.</p>
<h3>10) You have announced that you are concentrating on building a framework to make Websockets easy to work with. How is that getting on and what do you see Websockets being used for in the future? In other words, why the fascination?</h3>
<p>Concentrating is a strong word ;-) but it is true, I&#8217;ve started working on a product that abstracts Web Sockets to a service. Not the API alone, since it&#8217;s so damn simple, but the server setup: creating sessions, user control flow, waiting for users and more. </p>
<p>The service is called Förbind. Swedish for &#8220;connect&#8221;, ie. to connect your users.  It&#8217;s still early days, but I hope to release alpha access to <a href="http://forbind.net/">forbind.net</a> this month. </p>
<p>I used to work in finance web sites and real-time was the golden egg: to get that data as soon as it was published. So now that it&#8217;s available in a native form in the browser, I&#8217;m all over it!</p>
<p>What&#8217;s more, I love the idea of anonymous users. I created a bunch of demos where the user can contribute to something without ever really revealing themselves, and when the users come, you start to see how creative people are without really trying. Sure, you get a lot of cocks being drawn, but you also see some impressive ideas &#8211; my business 404 page for example allows people to leave a drawing, one of the most impressive is a Super Mario in all his glory. Anonymous users really interest me because as grey as things can seem sometimes, a stranger can easily inspire you.</p>
<p>Do you know anyone I should interview for &#8220;People of HTML5&#8243;? Tell me on Twitter: <a href="http://twitter.com/codepo8">@codepo8</a></p>
<p><script type="text/javascript" src="http://s3.www.universalsubtitles.org/js/mirosubs-widgetizer.js"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2011/01/people-of-html5-remy-sharp/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
<enclosure url="http://www.archive.org/download/PeopleOfHtml5-RemySharp/remy_512kb.mp4" length="0" type="video/mp4" />
<enclosure url="http://www.archive.org/download/PeopleOfHtml5-RemySharp/remy.ogv" length="0" type="video/ogg" />
		</item>
		<item>
		<title>HTML5 Guitar Tab Player with the Firefox 4 Audio Data API</title>
		<link>http://hacks.mozilla.org/2011/01/html5guitar/</link>
		<comments>http://hacks.mozilla.org/2011/01/html5guitar/#comments</comments>
		<pubDate>Fri, 07 Jan 2011 16:55:19 +0000</pubDate>
		<dc:creator>Paul Rouget</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[Canvas]]></category>
		<category><![CDATA[Demo]]></category>
		<category><![CDATA[Firefox 4]]></category>
		<category><![CDATA[HTML5]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=6978</guid>
		<description><![CDATA[Greg Jopa, an Illinois State University grad student studying web development, built a web-based guitar tab player using Firefox’s Audio Data API and Vexflow (HTML5 music notation rendering API). Here is some details from Greg. You can also read more about this experiment on his blog. I created a mashup using the Firefox 4 Audio [...]]]></description>
			<content:encoded><![CDATA[<p><em><a href="http://www.gregjopa.com">Greg Jopa</a>, an Illinois State University grad student studying web development, built a web-based guitar tab player using Firefox’s <a href="https://developer.mozilla.org/en/Introducing_the_Audio_API_Extension">Audio Data API</a> and <a href="http://www.vexflow.com/">Vexflow (HTML5 music notation rendering API)</a>. Here is some details from Greg. You can also read more about this experiment <a href="http://www.gregjopa.com/2010/12/html5-guitar-tab-player-with-firefox-audio-data-api/">on his blog</a>.</em></p>
<p>I created a mashup using the Firefox 4 <a href="https://developer.mozilla.org/en/Introducing_the_Audio_API_Extension">Audio Data API</a>, <a href="http://recordare.com/musicxml">MusicXML</a>, and <a href="http://vexflow.com">Vexflow</a> to create a HTML 5 Guitar Tab Player.</p>
<p><iframe width="500px" height="360px" src="http://www.youtube.com/embed/4MJeurIHf2I" frameborder="0"></iframe> </p>
<p><em>This is a Youtube video. It uses the HTML5 &lt;video&gt; tag if you <a href="http://www.youtube.com/html5">activate it here</a>.</em></p>
<ul>
<li><a href="http://code.gregjopa.com/html5/audio/tabplayer/">View demo</a>.</p>
<li><a href="https://github.com/GregJ/HTML5-Guitar-Tab-Player">Source code</a>.</p>
</ul>
<p>Using JavaScript, this guitar tab player converts the music note data from a <a href="http://recordare.com/musicxml">MusicXML</a> file to frequencies playable by the Audio Data API. This note data is also converted to a format that can be read by Vexflow to display the guitar tab.</p>
<p>I have broken down this functionality into 4 steps. Here’s how the HTML5 Guitar Tab Player works: </p>
<h2>MusicXML</h2>
<p>When a tab (a <a href="http://en.wikipedia.org/wiki/Tablature">tablature</a>) is selected, the jQuery ajax() function loads the MusicXML file, parses through the contents, and appends all the formatted note data to a &lt;script> tag. The format for each note is: <code>playNote(note, octave, duration)</code>.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">playNote<span style="color: #009900;">&#40;</span>notes.<span style="color: #660066;">C</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">4</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The tablature notation information in the MusicXML file is also processed and appended to a &lt;div> tag for Vexflow. </p>
<p>Here is the structure of the nodes I am using from the MusicXML file:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;measure</span> <span style="color: #000066;">number</span>=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;attributes<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;divisions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1024<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/divisions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/attributes<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;note<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pitch<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;step<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>C<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/step<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;octave<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>4<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/octave<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/pitch<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;duration<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1024<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/duration<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;notations<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;technical<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fret<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fret<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/technical<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/notations<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/note<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    the note node repeats for the rest of the notes in the measure…
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/measure<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>And here is the generated source that is produced by the ajax() function.</p>
<p>For the audio:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;script</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;audio&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	function loadAudio(){
	  playNote(notes.C, 4, 1);
	  playNote(notes.C, 4, 1);
	  playNote(notes.G, 4, 1);
	  playNote(notes.G, 4, 1);
	  …
	}
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>For the tab:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;tab&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;vex-tabdiv&quot;</span> <span style="color: #000066;">width</span>=780 <span style="color: #000066;">scale</span>=1.0 <span style="color: #000066;">editor</span>=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
tabstave notation=true
	notes :q 1/2 :q 1/2 :q 3/1 :q 3/1 | :q 5/1
   …
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<h2>Frequency Calculation</h2>
<p>When the Play button is clicked the music data <code>&lt;script id=”audio”></code> tag is evaluated and the note information is converted to frequencies using the following formula (assumes equal temperament):</p>
<p><code>frequency = 440 * 2^(n/12)</code></p>
<p>440 is the frequency for the note A at the 4th octave.</p>
<p><code>n = distance away from A4 (440)</code></p>
<p>I am using an array to store the distance between a certain note and the base note “A”</p>
<p><code>notes = {C:-9, Cs:-8, D:-7, Ds:-6, E:-5, F:-4, Fs:-3, G:-2, Gs:-1, A:0, As:1, B:2};</code></p>
<p>And to incorporate that a note can be played at different octaves I have adapted the above formula to the following:</p>
<p><code>frequency = 440 * 2^((octave-4) * 12 + distance)/12);</code></p>
<h2>Audiodata.js</h2>
<p>I am using the Audiodata.js library in the guitar tab player which makes it easy to play continuous audio using a single array. This library encapsulates the Audio Data API methods. Audiodata.js is available on GitHub here: <a href="https://github.com/notmasteryet/audiodata">https://github.com/notmasteryet/audiodata</a>. The Audiodata.js project contains a score example with “Twinkle, Twinkle, Little Star” which inspired me to build this guitar tab player.</p>
<h2>Vexflow and the Animated Cursor</h2>
<p>Vexflow is an open-source web-based music notation rendering API based on the HTML5 canvas element (<a href="http://www.vexflow.com/">http://www.vexflow.com/</a>). I am using Vexflow to display the tab for each MusicXML file. I have added an additional canvas element on top of the Vexflow canvas to control the red cursor that links the audio to the tablature. The speed of the audio is controlled by the tempo which is measured in beats per minute. By converting this tempo to milliseconds I am able to use it for the redraw speed of the second canvas. Every time this canvas is redrawn the red cursor is moved 5 pixels to the right to highlight which note is currently being played.<br />
Keep in mind that this HTML5 Guitar Tab Player is just a proof of concept and can only play single notes.</p>
<p><strong>If you have recommendations on how to make this tab player better or would like to contribute to this project check out the following post:</strong> <a href="http://www.gregjopa.com/2010/12/html5-guitar-tab-player-with-firefox-audio-data-api/ ">http://www.gregjopa.com/2010/12/html5-guitar-tab-player-with-firefox-audio-data-api/ </a></p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2011/01/html5guitar/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Firefox 4 Beta: Latest Update is Here, with WebGL</title>
		<link>http://hacks.mozilla.org/2010/12/firefox4b8/</link>
		<comments>http://hacks.mozilla.org/2010/12/firefox4b8/#comments</comments>
		<pubDate>Wed, 22 Dec 2010 19:41:09 +0000</pubDate>
		<dc:creator>Paul Rouget</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[Demo]]></category>
		<category><![CDATA[Featured Demo]]></category>
		<category><![CDATA[Firefox 4]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[WebGL]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=6892</guid>
		<description><![CDATA[The new Firefox 4 Beta is here, and comes with WebGL activated by default. You can download this new beta here: http://firefox.com/beta. Flight of the Navigator is a WebGL + Audio API demo developed by a team of Mozilla volunteers. You can see the demo online here (you need a WebGL compatible browser). More information [...]]]></description>
			<content:encoded><![CDATA[<p><strong>The new Firefox 4 Beta is here, and comes with WebGL activated by default.</strong> You can download this new beta here: <a href="http://firefox.com/beta">http://firefox.com/beta</a>.</p>
<p><em>Flight of the Navigator</em> is a WebGL + Audio API demo developed by a team of Mozilla volunteers.</p>
<p>You can see the <a href="http://videos.mozilla.org/serv/mozhacks/flight-of-the-navigator/">demo online here</a> (you need a WebGL compatible browser).</p>
<p>More information about this demo on <a href="http://vocamus.net/dave/?p=1233">David Humphrey&#8217;s blog</a> (one of the developer of this demo) and more <a href="http://blog.vlad1.com/2010/12/21/webgl-in-firefox-4-beta-8/">about WebGL in Firefox Beta8 on Vlad&#8217;s blog</a>.</p>
<p>The screencast:</p>
<p><video controls width="500" preload="auto" poster="http://hacks.mozilla.org/wp-content/uploads/2010/12/fotn.jpg"><br />
	<source src="http://videos-cdn.mozilla.net/serv/firefox4beta/ants/FlightDemo.mp4" type="video/mp4" /><br />
	<source src="http://videos-cdn.mozilla.net/serv/firefox4beta/ants/FlightDemo.theora.ogv" type="video/ogg" /><br />
	<source src="http://videos-cdn.mozilla.net/serv/firefox4beta/ants/FlightDemo.webm" type="video/webm" /><br />
</video></p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2010/12/firefox4b8/feed/</wfw:commentRss>
		<slash:comments>38</slash:comments>
<enclosure url="http://videos-cdn.mozilla.net/serv/firefox4beta/ants/FlightDemo.mp4" length="31660810" type="video/mp4" />
<enclosure url="http://videos-cdn.mozilla.net/serv/firefox4beta/ants/FlightDemo.theora.ogv" length="84597450" type="video/ogg" />
<enclosure url="http://videos-cdn.mozilla.net/serv/firefox4beta/ants/FlightDemo.webm" length="36557464" type="video/webm" />
		</item>
		<item>
		<title>Spirit of Indiana (Jones) &#8211; syncing HTML5 Video with Maps</title>
		<link>http://hacks.mozilla.org/2010/12/spirit-of-indiana-jones-syncing-html5-video-with-maps/</link>
		<comments>http://hacks.mozilla.org/2010/12/spirit-of-indiana-jones-syncing-html5-video-with-maps/#comments</comments>
		<pubDate>Thu, 16 Dec 2010 14:24:16 +0000</pubDate>
		<dc:creator>Chris Heilmann</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Demo]]></category>
		<category><![CDATA[Firefox 3.5]]></category>
		<category><![CDATA[Firefox 3.6]]></category>
		<category><![CDATA[Firefox 4]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[googlemaps]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[indianajones]]></category>
		<category><![CDATA[maps]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=6815</guid>
		<description><![CDATA[I&#8217;ve always been a big fan of the travel/flight sequences in the Indiana Jones movies and judging by the amount of copy attempts on YouTube I am not alone in this. As I don&#8217;t own any video editing software I thought it should be possible to create the same effect with web technologies and Google [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve always been a big fan of the travel/flight sequences in the Indiana Jones movies and judging by the amount of <a href="http://www.youtube.com/results?search_query=indiana+jones+map+animation&#038;aq=f">copy attempts on YouTube</a> I am not alone in this.  As I don&#8217;t own any video editing software I thought it should be possible to create the same effect with web technologies and Google Maps and lo and behold it is:</p>
<p><iframe title="YouTube video player" class="youtube-player" type="text/html" width="480" height="390" src="http://www.youtube.com/embed/KNNzP6fyOyQ?rel=0" frameborder="0"></iframe></p>
<p><a href="http://isithackday.com/spirit-of-indiana/">See the demo online</a></p>
<p>You can <a href="https://github.com/codepo8/HTML5---map-and-video-syncing">download the animation demo</a> for yourself and try it out locally &#8211; all you need is a browser that supports HTML5 video. I know &#8211; the music is not quite the same as in the movies, but at least this one is not copyright infringing and it came from the heart (5 minutes in a meeting room in the Mozilla office). </p>
<p>So how was this done and what are problems that needed solving? Here&#8217;s how and what.</p>
<h2>Step 1: Find the movie and get it to the right format</h2>
<p>That was the easy part. <a href="http://www.archive.org/">Archive.org</a> has a lot of awesome public domain movies available for you and they are already in the formats needed to use in an HTML5 video element. In this case, I took the short <a href="http://www.archive.org/details/CharlesLindbergTakesOff">movie of Charles Lindbergh</a> taking off for <a href="http://en.wikipedia.org/wiki/Charles_Lindbergh">his record breaking flight from New York to fly to Paris in 1927</a>.</p>
<h2>Step 2: Displaying the video</h2>
<p>Using the video <a href="http://isithackday.com/spirit-of-indiana/video.html">is pretty simple</a>:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;stage&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;video<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;source</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;http://www.archive.org/download/</span>
<span style="color: #009900;">CharlesLindbergTakesOff/CharlesLindbergTakesOff_512kb.mp4&quot;</span> </span>
<span style="color: #009900;"><span style="color: #000066;">type</span>=<span style="color: #ff0000;">'video/mp4; codecs=&quot;avc1.42E01E, mp4a.40.2&quot;'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;source</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;http://www.archive.org/download/</span>
<span style="color: #009900;">CharlesLindbergTakesOff/CharlesLindbergTakesOff.ogv&quot;</span></span>
<span style="color: #009900;"> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'video/ogg; codecs=&quot;theora, vorbis&quot;'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span> 
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/video<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>The MP4 format will be used by Webkit based browsers and the Ogg version by Firefox and others. As we want to control the video we omit the <code>controls</code> attribute on the <code>video</code> element &#8211; instead we create a button to play the video with JavaScript:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">window.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'load'</span><span style="color: #339933;">,</span> 
  <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> stage <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'stage'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> v <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'video'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    but <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'button'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    but.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'Click to see Lindbergh<span style="color: #000099; font-weight: bold;">\'</span>s flight'</span><span style="color: #339933;">;</span>
    stage.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>but<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    but.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      v.<span style="color: #660066;">play</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      e.<span style="color: #660066;">preventDefault</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> 
<span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>As the video is markup we can do whatever we please with it &#8211; the power of open technologies. For example as we will do here we can set its opacity in CSS and put in on top of a map.</p>
<h2>Step 3: Create the map path animation</h2>
<p>Talking of which, let&#8217;s get that moving path done. Google Earth has an API to do that, but it needs a special plugin. Google Maps allows you to paint paths on maps (which actually are SVG, another open standard). Put that in a recursive function and you <a href="http://isithackday.com/spirit-of-indiana/map.html">get the desired effect</a>: </p>
<p><a href="http://isithackday.com/spirit-of-indiana/map.html" title="Animated Google Maps path synced with HTML5 video by codepo8, on Flickr"><img src="http://farm6.static.flickr.com/5169/5264317406_20886eefb9.jpg" width="500" height="444" alt="Animated Google Maps path synced with HTML5 video" /></a></p>
<p>In essence, what I did was take the latitude and longitude of the start and end points and calculate as many points in between the two as I need for the duration of the animation. I store the points in an array called <code>pos</code> and then paint a path from the start to the current point and move the map centre to this point on every iteration.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">spirit.<span style="color: #660066;">draw</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> path <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> google.<span style="color: #660066;">maps</span>.<span style="color: #660066;">Polyline</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
        path<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span>startpos<span style="color: #339933;">,</span>pos<span style="color: #009900;">&#91;</span>now<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
        strokeColor<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;#c00&quot;</span><span style="color: #339933;">,</span>
        strokeOpacity<span style="color: #339933;">:</span> .7<span style="color: #339933;">,</span>
        strokeWeight<span style="color: #339933;">:</span> <span style="color: #CC0000;">10</span>
  <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  path.<span style="color: #660066;">setMap</span><span style="color: #009900;">&#40;</span>map<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  map.<span style="color: #660066;">panTo</span><span style="color: #009900;">&#40;</span>pos<span style="color: #009900;">&#91;</span>now<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
  now <span style="color: #339933;">=</span> now <span style="color: #339933;">+</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>now <span style="color: #339933;">&lt;</span> animationend<span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    setTimeout<span style="color: #009900;">&#40;</span>spirit.<span style="color: #660066;">draw</span><span style="color: #339933;">,</span><span style="color: #CC0000;">200</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Check the <a href="https://github.com/codepo8/HTML5---map-and-video-syncing/blob/master/map.js">highly commented source of the map example</a> for the details. Now, we could use this kind of animation and play the video over it &#8211; the problem though is that they may get out of sync. When the movie stalls (as it frequently does on this hotel wireless connection) we don&#8217;t want the animation to keep moving, right?</p>
<h2>Step 4: Syncing video and the map movement</h2>
<p>Instead of having two sources of timing information we have to limit ourselves to one source of truth. This is the time stamp of the currently playing movie. </p>
<p>By the way &#8211; you might have noticed that I wrapped the map code in a <code>tilesloaded</code> event handler. This is another safeguard for keeping things in sync. I found that on slow connections the tile loading can delay the whole interface immensely (because of all the subdomain lookups), so I make the whole interface dependent on the loading of the map and only proceed when the tiles have finished loading. As the <code>tilesloaded</code> event also fires when the map pans we need to use a boolean to stop it from starting the effect several times:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">google.<span style="color: #660066;">maps</span>.<span style="color: #660066;">event</span>.<span style="color: #660066;">addListener</span><span style="color: #009900;">&#40;</span>map<span style="color: #339933;">,</span><span style="color: #3366CC;">'tilesloaded'</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>played <span style="color: #339933;">===</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #006600; font-style: italic;">// [...other code...]</span>
    played <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>You can read the current timestamp of a video with <code>video.currentTime</code> and whilst the movie is playing it constantly fires an event called <code>timeupdate</code>. As the event fires a lot we need to throttle it somehow. The trick here is to only take the full seconds and increase a counter when a new second is reached. You can see the timestamp and the second interval firing in <a href="http://isithackday.com/spirit-of-indiana/video-sync.html">the video syncing demo</a>:</p>
<p><a href="http://isithackday.com/spirit-of-indiana/video-sync.html" title="HTML5 video with timestamp by codepo8, on Flickr"><img src="http://farm6.static.flickr.com/5289/5264312358_59392bd2f9.jpg" width="500" height="491" alt="HTML5 video with timestamp" /></a></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> now <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
v.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'timeupdate'</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>o<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  log.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> v.<span style="color: #660066;">currentTime</span><span style="color: #339933;">;</span> <span style="color: #009966; font-style: italic;">/* logging the real timestamp */</span>
  <span style="color: #003366; font-weight: bold;">var</span> full <span style="color: #339933;">=</span> parseInt<span style="color: #009900;">&#40;</span>v.<span style="color: #660066;">currentTime</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>full <span style="color: #339933;">&gt;=</span> now<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    seqlog.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> now<span style="color: #339933;">;</span>  <span style="color: #009966; font-style: italic;">/* logging the seconds firing */</span>
    now <span style="color: #339933;">=</span> now <span style="color: #339933;">+</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>That way the movie can lag in between and the sequence still stays in sync. Check the <a href="https://github.com/codepo8/HTML5---map-and-video-syncing/blob/master/video-sync.html">source of this demo on Github</a>.</p>
<h2>Putting it all together</h2>
<p>And that was about it &#8211; all I had to do is to set the movie&#8217;s opacity at a certain time stamp, start the sound at another and show and hide the copyright complaint at another. As we rely on the timestamp for the other effects we needed a boolean switch to avoid repeated firing:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">v.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'timeupdate'</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>o<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  full <span style="color: #339933;">=</span> parseInt<span style="color: #009900;">&#40;</span>v.<span style="color: #660066;">currentTime</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>full <span style="color: #339933;">===</span> now<span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    mapelm.<span style="color: #660066;">style</span>.<span style="color: #660066;">opacity</span> <span style="color: #339933;">=</span> .8<span style="color: #339933;">;</span>
    v.<span style="color: #660066;">style</span>.<span style="color: #660066;">opacity</span> <span style="color: #339933;">=</span> .4<span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>full <span style="color: #339933;">===</span> animationstart<span style="color: #339933;">+</span><span style="color: #CC0000;">1</span> <span style="color: #339933;">&amp;&amp;</span> audioplay <span style="color: #339933;">===</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    a.<span style="color: #660066;">play</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    audioplay <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>full <span style="color: #339933;">===</span> animationstart<span style="color: #339933;">+</span><span style="color: #CC0000;">2</span> <span style="color: #339933;">&amp;&amp;</span> hidden <span style="color: #339933;">===</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    drmbedamned.<span style="color: #660066;">style</span>.<span style="color: #660066;">display</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'block'</span><span style="color: #339933;">;</span>
    hidden <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>full <span style="color: #339933;">===</span> animationstart<span style="color: #339933;">+</span><span style="color: #CC0000;">3</span> <span style="color: #339933;">&amp;&amp;</span> hidden <span style="color: #339933;">===</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    drmbedamned.<span style="color: #660066;">style</span>.<span style="color: #660066;">display</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'none'</span><span style="color: #339933;">;</span>
    hidden <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>full <span style="color: #339933;">&gt;=</span> now<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    path <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> google.<span style="color: #660066;">maps</span>.<span style="color: #660066;">Polyline</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
        path<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span>startpos<span style="color: #339933;">,</span>pos<span style="color: #009900;">&#91;</span>full<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
        strokeColor<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;#c00&quot;</span><span style="color: #339933;">,</span>
        strokeOpacity<span style="color: #339933;">:</span> .7<span style="color: #339933;">,</span>
        strokeWeight<span style="color: #339933;">:</span> <span style="color: #CC0000;">10</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    path.<span style="color: #660066;">setMap</span><span style="color: #009900;">&#40;</span>map<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    map.<span style="color: #660066;">panTo</span><span style="color: #009900;">&#40;</span>pos<span style="color: #009900;">&#91;</span>full<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
    now <span style="color: #339933;">=</span> now <span style="color: #339933;">+</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Another event we needed to subscribe to was the movie ending so we can stop the music and start to roll the credits:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">v.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ended'</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>o<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  a.<span style="color: #660066;">pause</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  spirit.<span style="color: #660066;">credslist</span>.<span style="color: #660066;">parentNode</span>.<span style="color: #660066;">style</span>.<span style="color: #660066;">display</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'block'</span><span style="color: #339933;">;</span>
  spirit.<span style="color: #660066;">creds</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>As the theme is too short for the whole animation we need to loop it. This can be done by testing for the <code>ended</code> event and rolling back the time to 0:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">a.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ended'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>o<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  a.<span style="color: #660066;">currentTime</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h2>Summary</h2>
<p>And there you have it &#8211; Indiana Jones style maps using open services and open technologies. A workaround for the copyrighted audio (recorded, edited and converted with the free <a href="http://audacity.sourceforge.net/">Audacity</a> sound editor) and using <a href="http://code.google.com/webfonts/">Google&#8217;s Web Fonts</a> as graphics. </p>
<p>You can now take this and change it for even more awesome:</p>
<ul>
<li>Replace Google Maps with Openstreetmap to avoid going over the limit</li>
<li>Add a slight curve to the path from NYC to Paris to make it more accurate (but then again the time is not accurate either &#8211; it took charles a tad longer)</li>
<li>Use a static map and paint the path with Canvas to speed up and smoothen the animation</li>
</ul>
<p>Why not have a go &#8211; it is free and fun to play.</p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2010/12/spirit-of-indiana-jones-syncing-html5-video-with-maps/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>audio data API &#8211; audio generation demo</title>
		<link>http://hacks.mozilla.org/2010/10/audio-data-api-audio-generation-demo/</link>
		<comments>http://hacks.mozilla.org/2010/10/audio-data-api-audio-generation-demo/#comments</comments>
		<pubDate>Mon, 01 Nov 2010 03:18:55 +0000</pubDate>
		<dc:creator>Gen Kanai</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[Demo]]></category>
		<category><![CDATA[Device APIs]]></category>
		<category><![CDATA[Firefox 4]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=6417</guid>
		<description><![CDATA[At BarCamp Bankgkok 4, 16 year-old programmer, Thai Pangsakulyanont, did an awesome presentation (that I now know he hacked together in 2 hours before the presentation) on the Audio Data API in Firefox 4: audio generation demo. Simply, the demo uses the mouse button for a crash cymbal, mouse actions as an arpeggiator, and the [...]]]></description>
			<content:encoded><![CDATA[<p>At <a href="http://www.barcampbangkok.org/node/721">BarCamp Bankgkok 4</a>, 16 year-old programmer, <a href="http://blog.dt.in.th/">Thai Pangsakulyanont</a>, did an awesome presentation (that I now know he hacked together in 2 hours before the presentation) on the <a href="https://wiki.mozilla.org/Audio_Data_API">Audio Data API</a> in Firefox 4: <a href="http://blog.dt.in.th/2010/10/audiodata-barcampbkk4/">audio generation demo</a>. </p>
<p>Simply, the demo uses the mouse button for a crash cymbal, mouse actions as an arpeggiator, and the accelerometer (<a href="https://developer.mozilla.org/en/Detecting_device_orientation">Orientation events</a>) to apply a low-pass filter. I remember Thai from BarCamp Bangkok 2 where he made a Wiimote demo with Linux (and he was 14 then.)</p>
<p>If you also have a demo and some code to share, please let us know: <a href="http://twitter.com/#!/mozhacks">@mozhacks</a> (twitter account) or leave us a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2010/10/audio-data-api-audio-generation-demo/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HTML5 Video preload attribute supported in Firefox 4, autobuffer attribute removed</title>
		<link>http://hacks.mozilla.org/2010/08/video_preload_attribute/</link>
		<comments>http://hacks.mozilla.org/2010/08/video_preload_attribute/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 14:22:49 +0000</pubDate>
		<dc:creator>Paul Rouget</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[Firefox 4]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Standards]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=5673</guid>
		<description><![CDATA[This is a re-post from Chris Pearce’s blog. To comply with the HTML5 specification, we replaced the autobuffer attribute with the tri-state preload attribute. We encourage you to update your code. See the documention on MDC. Late last week I landed support on Firefox trunk for the HTML5 video &#8216;preload&#8217; attribute. This replaces the &#8216;autobuffer&#8217; [...]]]></description>
			<content:encoded><![CDATA[<p><em>This is a re-post from <a href="http://blog.pearce.org.nz/2010/08/html4-video-preload-attribute-supported.html">Chris Pearce’s blog</a>. To comply with the HTML5 specification, we replaced the <code>autobuffer</code> attribute with the tri-state <code>preload</code> attribute. We encourage you to update your code. See the <a href="https://developer.mozilla.org/En/HTML/Element/Video#Attributes">documention on MDC</a>.</em></p>
<p>Late last week I landed support on Firefox trunk for the <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#attr-media-preload">HTML5 video &#8216;preload&#8217; attribute</a>. This replaces the &#8216;autobuffer&#8217; attribute, which we previously supported. If you were previously using the autobuffer attribute on your HTLM5 videos, you need to update to using the preload attribute as well.</p>
<p>The preload attribute provides a hint to the browser as to how much downloading is sensible for a given media. The preload attribute can have three values:</p>
<ol>
<li>&#8220;<b>none</b>&#8221; &#8211; suggests to the browser that it doesn&#8217;t need to load this media at all until the user plays the resource. The browser will delay any network traffic required to load the media until the users tries to play the resource, or explicitly loads the resource. I suggest using this preload value, along with the poster attribute, when it&#8217;s unlikely that the user will play the resource. This is probably most useful in a mobile environment, where data can be expensive.</li>
<li>&#8220;<b>metadata</b>&#8221; &#8211; suggests to the browser that it isn&#8217;t necessary to load the entire resource in advance. The browser will suspend the load after loading metadata, displaying the first video frame (if there&#8217;s no poster image), and ensuring it can play the media. This is the default behaviour, and prevents excess network traffic when the web developer isn&#8217;t certain the video will definitely be played. If you don&#8217;t specify a preload value, Firefox will automatically do this. This was also the default behaviour in Firefox 3.5 and 3.6 in the absence of the autobuffer attribute. This default behaviour is a suitable compromise between bandwidth saving and user convenience.</li>
<li>&#8220;<b>auto</b>&#8221; &#8211; suggests to the browser that it should load as much of the resource as possible. As long as the browser&#8217;s own media cache isn&#8217;t full, it will keep on downloading. I suggest this is most useful in the &#8220;YouTube&#8221; case, when you&#8217;ve got a media which the user is almost certainly going to watch, and so having the user download the media is not likely to be wasting server bandwidth. This behaviour is the same as using the autobuffer attribute in Firefox 3.5 and 3.6</li>
</ol>
<p>Since the autobuffer attribute is no longer present in Firefox 4, and the preload attribute is not present in Firefox 3.5 and 3.6, <b>if you want a media to download completely, you should include both preload=&#8221;auto&#8221; and autobuffer in the video element</b>, <i>e.g.</i>:</p>
<p><span style="font-family: &quot;Courier New&quot;,Courier,monospace;">&lt;video autobuffer preload=&#8221;auto&#8221; src=&#8221;video.ogg&#8221;&gt;&lt;/video&gt;</span></p>
<p><b>If you want the video to only be downloaded if the user actually plays the video, you should not include either the preload or the autobuffer attribute.</b> The default behaviour in Firefox 3.5, 3.6, and the upcoming Firefox 4 is to only load up to the first frame and then suspend the download.</p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2010/08/video_preload_attribute/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML5 video &#8216;buffered&#8217; property available in Firefox 4</title>
		<link>http://hacks.mozilla.org/2010/08/html5-video-buffered-property-available-in-firefox-4/</link>
		<comments>http://hacks.mozilla.org/2010/08/html5-video-buffered-property-available-in-firefox-4/#comments</comments>
		<pubDate>Thu, 19 Aug 2010 22:00:08 +0000</pubDate>
		<dc:creator>cpearce</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[Firefox 4]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=5634</guid>
		<description><![CDATA[Support for the HTML5 video 'buffered' property has landed in Firefox, we can now accurately determine which time-segments of a video we can play and seek into without needing to pause playback to download more data. ]]></description>
			<content:encoded><![CDATA[<p><em>This is a repost from <a title="Chris Pearce's blog" href="http://blog.pearce.org.nz/2010/08/buffered-attribute-landed-for-html5.html">Chris Pearce&#8217;s blog</a>.</em></p>
<p>Recently I landed support for the <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#dom-media-buffered">HTML5 video &#8216;</a><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#dom-media-buffered">buffered&#8217; </a><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#dom-media-buffered">property</a> in Firefox. This is cool because we can now accurately determine which time-segments of a video we can play and seek into without needing to pause playback to download more data. Previously you could only get the byte position the download had reached, which often doesn&#8217;t map to the time ranges which are playable very well, especially in a variable bit rate video. This also can&#8217;t tell you if there are chunks which we skipped downloading before the downloaded byte position. Once the video controls UI is updated, users will be able to know exactly which segments of their video are downloaded and playable and can be seeked into without pausing playback to download more data.</p>
<p>To see this in action, download a current <a href="http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla-central/">Firefox nightly build </a>, and point your browser at my <a href="http://people.mozilla.com/%7Ecpearce/buffered-demo.html">video &#8216;buffered&#8217; property demo</a>. You&#8217;ll see something like the screenshot below, including an extra progress bar (implemented using canvas) showing the time ranges which are buffered.</p>
<div class="separator" style="clear: both; text-align: center;"><a style="margin-left: 1em; margin-right: 1em;" href="http://2.bp.blogspot.com/_lMYNOr9XEaA/TFtWCewX9TI/AAAAAAAAABk/XdPjAkSqGE8/s1600/buffered-demo.jpg"><img src="http://2.bp.blogspot.com/_lMYNOr9XEaA/TFtWCewX9TI/AAAAAAAAABk/XdPjAkSqGE8/s320/buffered-demo.jpg" border="0" alt="" /></a></div>
<p>I&#8217;ve implemented the &#8216;buffered&#8217; property for the Ogg and WAV backends. <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=570904">Support for the &#8216;buffered&#8217; property for WebM</a> is being worked on by <a href="http://blog.mjg.im/">Matthew Gregan</a>, and is well underway. At the moment we return empty ranges for the &#8216;buffered&#8217; property on video elements playing WebM and raw video.</p>
<p>My checkin just missed the cutoff for Firefox 4 Beta 3, so the first beta release that the video &#8216;buffered&#8217; property will appear in is Firefox 4 Beta 4.</p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2010/08/html5-video-buffered-property-available-in-firefox-4/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Fast JavaScript and Audio: Speech Synthesis in Your Browser</title>
		<link>http://hacks.mozilla.org/2010/05/fast-javascript-and-audio-speech-synthesis-in-your-browser/</link>
		<comments>http://hacks.mozilla.org/2010/05/fast-javascript-and-audio-speech-synthesis-in-your-browser/#comments</comments>
		<pubDate>Wed, 26 May 2010 17:31:27 +0000</pubDate>
		<dc:creator>Christopher Blizzard</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[Demo]]></category>
		<category><![CDATA[Firefox]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=4945</guid>
		<description><![CDATA[If you haven&#8217;t been keeping track of David Humphrey&#8217;s work to bring audio manipulation to Firefox, you&#8217;re missing out. He&#8217;s made an update post with a huge number of demos, requiring some of the most recent advances in JavaScript found in Firefox &#8211; binary arrays, super-fast tracing-based FFT analysis, etc. This was my favorite bit [...]]]></description>
			<content:encoded><![CDATA[<p>If you haven&#8217;t been keeping track of <a href="http://vocamus.net/dave/?p=1092">David Humphrey&#8217;s work to bring audio manipulation to Firefox</a>, you&#8217;re missing out.  He&#8217;s made an update post with a huge number of demos, requiring some of the most recent advances in JavaScript found in Firefox &#8211; binary arrays, super-fast tracing-based FFT analysis, etc.  This was my favorite bit of <a href="http://vocamus.net/dave/?p=1092">his post</a>:</p>
<p><em>I think that my favourite demo by far this time around is one that I’ve been waiting to see since we first began these experiments.  I’ve written in the past that our work could be used to solve many web accessibility problems.  A few weeks ago I mentioned on irc that someone should take a shot at building a text to speech engine in JavaScript, now that we have typed arrays.  Yury quietly went off and built one based on the <a href="http://www.speech.cs.cmu.edu/flite/">flite engine</a>.  When you run this, remember that you’re watching a browser speak with no plugins of any kind. This is all done in JavaScript.</em></p>
<p><object width="400" height="190"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=12039415&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=12039415&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="190"></embed></object>
<p><a href="http://vimeo.com/12039415">Web Audio Data API &#8211; Text to Speech Demo</a> from <a href="http://vimeo.com/user1962563">David Humphrey</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2010/05/fast-javascript-and-audio-speech-synthesis-in-your-browser/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Beyond HTML5: experiments with interactive audio</title>
		<link>http://hacks.mozilla.org/2010/04/beyond-html5-experiments-with-interactive-audio/</link>
		<comments>http://hacks.mozilla.org/2010/04/beyond-html5-experiments-with-interactive-audio/#comments</comments>
		<pubDate>Fri, 30 Apr 2010 18:57:33 +0000</pubDate>
		<dc:creator>Christopher Blizzard</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[Demo]]></category>
		<category><![CDATA[Device APIs]]></category>
		<category><![CDATA[Featured Demo]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Multi-touch]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[WebGL]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=4659</guid>
		<description><![CDATA[This is a re-post of an important post from David Humphrey who has been doing a lot of experiments on top of Mozilla&#8217;s extensible platform and doing experiments with multi-touch, sound, video, WebGL and all sorts of other goodies. It&#8217;s worth going through all of the demos below. You&#8217;ll find some stuff that will amaze [...]]]></description>
			<content:encoded><![CDATA[<p><em>This is a <a href="http://vocamus.net/dave/?p=1074">re-post of an important post from David Humphrey</a> who has been doing a lot of experiments on top of Mozilla&#8217;s extensible platform and doing experiments with multi-touch, sound, video, WebGL and all sorts of other goodies.  It&#8217;s worth going through all of the demos below.  You&#8217;ll find some stuff that will amaze and inspire you.</em></p>
<p><em>David&#8217;s work is important because it&#8217;s showing where the web is going, and where Mozilla is helping to take it.  It&#8217;s not enough that we&#8217;re working on HTML5, which we&#8217;re about finished with, but we&#8217;re trying to figure out what&#8217;s next.  Mozilla&#8217;s platform, Gecko, is a huge part of why we&#8217;re able to experiment and learn as fast as we can.  And that&#8217;s reflected with what&#8217;s possible here.  It&#8217;s a web you can see, touch and interact with in new ways.</em></p>
<p><em>David&#8217;s post follows:</em></p>
<p>I’m working with an ever growing group of web, audio, and Mozilla  developers on <a href="http://vocamus.net/dave/?p=974">a project</a> to expose audio  spectrum data to JavaScript from Firefox’s audio and video elements.  Today we show what we did at www2010.</p>
<p>I&#8217;m in Raleigh, North Carolina, with <a href="https://twitter.com/F1LT3R/">Al MacDonald</a> for the <a href="http://www2010.org/www/">www2010</a> conference.  We&#8217;re here to present our work on exposing audio data in the browser.  Over the past month <a href="https://twitter.com/corban">Corban</a>, <a href="https://twitter.com/ccliffe">Charles</a>, and a bunch of other friends have been working with us to refine the API and get new types of demos ready.  We ended-up with 11 demos, some of which I&#8217;ve shown here before.  Here are the others.</p>
<p>The first was done by <a href="http://twitter.com/jseidelin">Jacob Seidelin</a>, and shows many cool 2D visualizations of audio using our API.  You can see the <a href="http://blog.nihilogic.dk/2010/04/html5-audio-visualizations.html">live version</a> on his site, or check out <a href="http://vimeo.com/11355121">this video</a>:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="300" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=11355121&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="400" height="300" src="http://vimeo.com/moogaloop.swf?clip_id=11355121&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>The second and third demos where done by <a href="https://twitter.com/ccliffe">Charles Cliffe</a>, and show 3D visualizations using WebGL and his <a href="http://www.cubicvr.org/">CubicVR engine</a>.  These also show off his JavaScript beat detection code.  Is JavaScript fast enough to do real-time analysis of audio and synchronized 3D graphics?  Yes, yes it is.  The live versions are <a href="http://cubicvr.org/CubicVR.js/BeatDetektor2HD.html">here</a> and <a href="http://cubicvr.org/CubicVR.js/BeatDetektor1HD.html">here</a>, and here are <a href="http://vimeo.com/11345262">some</a> <a href="http://vimeo.com/11345685">videos</a>:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="300" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=11345262&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="400" height="300" src="http://vimeo.com/moogaloop.swf?clip_id=11345262&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="300" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=11345685&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="400" height="300" src="http://vimeo.com/moogaloop.swf?clip_id=11345685&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>The fourth demo was done by <a href="https://twitter.com/corban">Corban Brook</a> and shows how audio data can be mixed live using script.  Here he mutes the main audio, plays it, passes the data through a low pass filter written in JavaScript, then dumps the modified frames into a second audio element to be played.  It&#8217;s a technique we need to apply more widely, as it holds a lot of potential.  Here&#8217;s the <a href="http://weare.buildingsky.net/processing/dsp.js/examples/filter.html">live version</a>, and here&#8217;s a <a href="http://vimeo.com/11335434">video</a> (check out his updated <a href="http://weare.buildingsky.net/processing/dsp.js/examples/synthesizer.html">JavaScript synthesizer</a>, which we also presented):</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="300" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=11335434&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="400" height="300" src="http://vimeo.com/moogaloop.swf?clip_id=11335434&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>The fifth and sixth demos were done by Al (with the help of many).  When I was last in Boston, for the Processing.js meetup at Bocoup, we met with <a href="http://twitter.com/shepazu">Doug Schepers</a> from the W3C.  He loved our stuff, and was talking to us about ideas that would be cool to build.  He pulled out his iPhone and showed us <a href="http://vimeo.com/2184392">Brian Eno&#8217;s Bloom</a> audio app.  &#8220;It would be cool to do this in the browser.&#8221;  Yeah, it is cool, and here it is, written in a <a href="http://code.bocoup.com/bloop/color/bloop.html">few hundred lines of JavaScript and Processing.js</a> (<a href="http://vimeo.com/11346141">video 1</a>, <a href="http://vimeo.com/11345133">video 2</a>):</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="300" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=11346141&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="400" height="300" src="http://vimeo.com/moogaloop.swf?clip_id=11346141&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="300" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=11345133&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="400" height="300" src="http://vimeo.com/moogaloop.swf?clip_id=11345133&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>This demo also showcases the awesome work of <a href="http://felipe.wordpress.com/">Felipe Gomes</a>, who has a patch to add <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=508906">multi-touch DOM events to Firefox</a>.  The method we&#8217;ve used here can be taken a lot further.  Imagine being able to connect multiple browsers together for collaborative music creation, layering other audio underneath, mixing fragments vs. just oscillators, etc.  We built this one in a week, and the web is capable of a lot more.</p>
<p>One of the main points of our talk was to emphasize that what we&#8217;re talking about here isn&#8217;t just a concept, and it isn&#8217;t some far away future.  This is real code, running in a real browser, and it&#8217;s all being done in HTML5 and JavaScript.  The web is fast enough to do real-time audio processing now, powerful enough and expressive enough to create music.  And the community of digital music and audio hackers, visualizers, etc. are hungry for it.  So hungry that they are seeking us out, downloading our hacked builds and creating gorgeous web audio applications.</p>
<p>We want to keep going, and we need help.  We need help from those within Mozilla, the W3C, and other browsers to get this stuff into shipping browsers.  We need the audio, digital music, accessibility, and web communities to come together in order to help us build js audio libraries and more sample applications.  Yesterday <a href="http://twitter.com/joehewitt/status/13090747143">Joe Hewitt was talking on twitter</a> about how web browser vendors need to experiment more with non-standard APIs.  I couldn&#8217;t agree more, and here&#8217;s a chance for people to put their money where their mouth is.  Let&#8217;s make audio a scriptable part of the open web.</p>
<p>I&#8217;m currently creating new builds of our updated patch for Firefox, and will post links to them here when I&#8217;m done.  You can read more about the technical details of our work <a href="https://wiki.mozilla.org/Audio_Data_API">here</a>, and get involved in the bug <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=490705">here</a>.  You can talk more with me on irc in the <a href="irc://irc.mozilla.org/processing.js">processing.js channel</a> (I&#8217;m <em>humph</em> on moznet), or talk to me on twitter (<a href="http://twitter.com/humphd">@humphd</a>) or by <a href="mailto:david.humphrey@senecac.on.ca">email</a>.  One way or another, get in touch so you can help us push this forward.</p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2010/04/beyond-html5-experiments-with-interactive-audio/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>9elements &#8211; HTML5 Canvas Experiment</title>
		<link>http://hacks.mozilla.org/2009/08/9elements-html5-canvas-experiment/</link>
		<comments>http://hacks.mozilla.org/2009/08/9elements-html5-canvas-experiment/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 08:31:17 +0000</pubDate>
		<dc:creator>Gen Kanai</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[Canvas]]></category>
		<category><![CDATA[Demo]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=1541</guid>
		<description><![CDATA[The developers over at 9elements have done a mesmerizing experiment with Canvas and the audio support in HTML5. HTML5 Canvas and Audio Experiment Please comment on their cool experiment at their blog: HTML5 Canvas Experiment.]]></description>
			<content:encoded><![CDATA[<p>The developers over at <a href="http://9elements.com/en.html">9elements</a> have done a mesmerizing experiment with Canvas and the audio support in HTML5.</p>
<p style="text-align: center;"><strong><a href="http://9elements.com/io/projects/html5/canvas/">HTML5 Canvas and Audio Experiment</a></strong></p>
<p>Please comment on their cool experiment at their blog: <a href="http://9elements.com/io/?p=153">HTML5 Canvas Experiment</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2009/08/9elements-html5-canvas-experiment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>exploring music with the audio tag</title>
		<link>http://hacks.mozilla.org/2009/06/exploring-music-audio/</link>
		<comments>http://hacks.mozilla.org/2009/06/exploring-music-audio/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 00:28:49 +0000</pubDate>
		<dc:creator>Christopher Blizzard</dc:creator>
				<category><![CDATA[35 Days]]></category>
		<category><![CDATA[Audio]]></category>
		<category><![CDATA[Demo]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[Firefox 3.5]]></category>
		<category><![CDATA[SVG]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=1066</guid>
		<description><![CDATA[Today&#8217;s demo comes to us from Samuel Goldszmidt. He&#8217;s a web developer specializing in audio applications at Institut de Recherche et Coordination Acoustique/Musique (IRCAM). IRCAM is a European institute covering science, sound and avant garde electro-acoustical art music. The demo uses XML to describe the various segments of a piece of music &#8211; Florence Baschet&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p><em>Today&#8217;s <a href="http://apm.ircam.fr/page/audio-tag/">demo</a> comes to us from Samuel Goldszmidt.  He&#8217;s a web developer specializing in audio applications at Institut de Recherche et Coordination Acoustique/Musique (<a href="http://www.ircam.fr/ircam.html?&#038;L=1">IRCAM</a>).  IRCAM is a European institute covering science, sound and avant garde electro-acoustical art music.</em></p>
<p>The demo uses XML to describe the various segments of a piece of music &#8211; Florence Baschet&#8217;s <em>StreicherKreis (Circle of Strings)</em>.  The music itself is a combination of stringed instruments and electronic effects.  From the XML, SVG is generated for each section of the music.  You can click on each section to listen to that part of the piece and a description is shown on how that particular section was created.</p>
<p>As far as demos go, this is relatively simple.  But it&#8217;s worth highlighting because it shows how easy it is to build a timeline around a piece of music and add descriptive information.  In this case, it&#8217;s information meant to teach people how a particular effect was created.  But it could be anything, from showing different camera angles of people playing the music to links about different covers of a popular piece.  Opening up media to the web means that we can combine it with text, images and other media.  This is just a small example.</p>
<div align="center" style="font-size: 120%"><a target="_blank" href="http://apm.ircam.fr/page/audio-tag/">View the Demo in Firefox 3.5<br/><img src="http://hacks.mozilla.org/wp-content/uploads/2009/06/ircam.png"/></a></div>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2009/06/exploring-music-audio/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>audio player &#8211; HTML5 style</title>
		<link>http://hacks.mozilla.org/2009/06/audio-player-html5/</link>
		<comments>http://hacks.mozilla.org/2009/06/audio-player-html5/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 01:34:36 +0000</pubDate>
		<dc:creator>Christopher Blizzard</dc:creator>
				<category><![CDATA[35 Days]]></category>
		<category><![CDATA[Audio]]></category>
		<category><![CDATA[Canvas]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Demo]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[SVG]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=555</guid>
		<description><![CDATA[Last week we featured a demo from Alistair MacDonald (@F1LT3R) where he showed how to animate SVG with Canvas and a bunch of free tools. This week he has another demo for us that shows how you can use the new audio element in Firefox 3.5 with some canvas and JS to build a nice-looking [...]]]></description>
			<content:encoded><![CDATA[<p>Last week we featured a demo from <a href="http://hyper-metrix.com/">Alistair MacDonald</a> (<a href="http://twitter.com/F1LT3R">@F1LT3R</a>) where he showed how to <a href="http://hacks.mozilla.org/2009/06/rendering-svg-canvas-burst/">animate SVG with Canvas</a> and a bunch of free tools.  This week he has another demo for us that shows how you can use the new <a href="https://developer.mozilla.org/En/Using_audio_and_video_in_Firefox">audio element in Firefox 3.5</a> with some canvas and JS to build a nice-looking audio player.</p>
<div align="center" style="font-size: 120%">
<a target="_blank" href="http://hyper-metrix.com/misc/jai/"><br />
View the Demo in Firefox 3.5</br><br />
<img src="http://hacks.mozilla.org/wp-content/uploads/2009/06/jai.jpg" alt="jai" title="jai" width="451" height="309" class="aligncenter size-full wp-image-559" /><br />
</a>
</div>
<p>But what&#8217;s really interesting about this demo is not so much that it plays audio &#8211; lots of people have built audio players &#8211; but how it works.  If you look at the source code for the page what you&#8217;ll find looks something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;jai&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;canvas <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;jai-transport&quot;</span> <span style="color: #000066;">width</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;320&quot;</span> <span style="color: #000066;">height</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;20&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span>canvas&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;playlist&quot;</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
      <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;@F1LT3R - Cryogenic Unrest.ogg&quot;</span>&gt;</span>
        F1LT3R - Cryogenic Unrest
      <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
      <span style="color: #009900;">&lt;audio <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;@F1LT3R - Cryogenic Unrest.ogg&quot;</span><span style="color: #66cc66;">/</span>&gt;</span>.
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
      <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;@F1LT3R - Ghosts in HyperSpace.ogg&quot;</span>&gt;</span>
        F1LT3R - Ghosts in HyperSpace
      <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
      <span style="color: #009900;">&lt;audio <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;@F1LT3R - Ghosts in HyperSpace.ogg&quot;</span><span style="color: #66cc66;">/</span>&gt;</span>.       
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>    
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></div></div>

<div style="font-size: 80%">(The actual list has fallbacks and is more compact &#8211; cleaned up here for easier reading.)</div>
<p>That&#8217;s right &#8211; the player above is just a simple HTML unordered list that happens to include audio elements and is styled with CSS.  You&#8217;ll notice that if you right click on one of them that it has all the usual items &#8211; save as, bookmark this link, copy this link location, etc.  You can even poke at it with Firebug.</p>
<p>The JavaScript driver that Al has written will look for a <code>&lt;div&gt;</code> element with the <code>jai</code> ID and then look for any audio elements that are inside it.  It then will draw the playback interface in the canvas at the top of the list.  The playback interface is built with simple JS canvas calls and an SVG-derived font.</p>
<p>Using this driver it&#8217;s super-easy to add an audio player to any web site by just defining a canvas and a list.  Much like what we&#8217;ve seen on a lot of the web with the rise of useful libraries like jQuery, this library can add additional value to easily-defined markup.  Another win for HTML5 and the library model.</p>
<p>Al has a much <a href="http://hyper-metrix.com/misc/jai/">larger write-up on the same page as the demo</a>.  If you haven&#8217;t read through it you should now.</p>
<p>(Also?  Al wrote the music himself.  So awesome.)</p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2009/06/audio-player-html5/feed/</wfw:commentRss>
		<slash:comments>33</slash:comments>
		</item>
		<item>
		<title>open video codecs and quality</title>
		<link>http://hacks.mozilla.org/2009/06/open-video-codecs-and-quality/</link>
		<comments>http://hacks.mozilla.org/2009/06/open-video-codecs-and-quality/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 13:24:53 +0000</pubDate>
		<dc:creator>Christopher Blizzard</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[Firefox 3.5]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=412</guid>
		<description><![CDATA[This is a re-post (with permission) of a post that Greg Maxwell wrote in response to a comment by Chris DiBona from Google on a whatwg mailing list. The codecs being discussed are the same ones we&#8217;ll be including in Firefox 3.5 and are also the same codecs that Mozilla, Wikipedia and others have been [...]]]></description>
			<content:encoded><![CDATA[<p><em>This is a re-post (with permission) of a <a href="http://people.xiph.org/~greg/video/ytcompare/comparison.html">post</a> that Greg Maxwell wrote in response to a comment by Chris DiBona from Google on a <a href="http://lists.whatwg.org/listinfo.cgi/whatwg-whatwg.org">whatwg mailing list</a>.  The codecs being discussed are the same ones we&#8217;ll be including in Firefox 3.5 and are also the same codecs that <a href="http://blog.mozilla.com/blog/2009/01/26/in-support-of-open-video/">Mozilla, Wikipedia and others have been investing in</a>.</em></p>
<p><em>Recent developer nightlies of Google Chrome support these codecs and a future version of Opera will also support them.  Theora and Vorbis also work in Safari if you install the <a href="http://www.xiph.org/quicktime/">Xiph Qt component</a>.  We&#8217;re quickly reaching the point where all modern browsers support these open codecs with full support for the <a href="https://developer.mozilla.org/En/Using_audio_and_video_in_Firefox">video tag</a>.</em></p>
<p><em>You&#8217;ll note that Greg&#8217;s post doesn&#8217;t have the tone of a marketing document &#8211; it&#8217;s not meant to.  Nor is this a comparison against HD-sized, high-bitrate video.  Instead it&#8217;s an attempt to give an honest comparison of how the open codecs fare against commonly-used formats and sizes used on the world&#8217;s largest video site.  I think you&#8217;ll agree with Greg&#8217;s conclusions at the bottom of the document, especially with audio where Vorbis really shines.</em></p>
<p><em>Greg&#8217;s post follows.</em></p>
<p><strong>Purpose</strong></p>
<p>On Jun 13th 2009 Chris DiBona of Google made a <a href="http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2009-June/020380.html">remarkable claim</a> on the WhatWG mailing list:</p>
<blockquote><p>&#8220;If [youtube] were to switch to theora and maintain even a semblance of the current youtube quality it would take up most available bandwidth across the Internet.&#8221; </p></blockquote>
<p>Unfortunately, open video formats have been subjected to FUD so frequently that people are willing to believe bold claims like these without demanding substantiation.</p>
<p>In this comparison I will demonstrate that this claim was unfair and unreasonable. Using a simple test case I show that Theora is competitive and even superior to some of the files that Google is distributing today on YouTube.</p>
<p>Theora isn&#8217;t the most efficient video codec available right now. But it is by no means bad, and it is substantially better than many other widely used options. By conventional criteria Theora is competitive. It also has the substantial advantage of being unencumbered, reasonable in computational complexity, and entirely open source. People are often confused by the correct observation that Theora doesn&#8217;t provide the state of the art in bitrate vs quality, and take that to mean that Theora does poorly when in reality it does quite well. Also, the Theora encoder has improved a lot lately so some older problems no longer apply.</p>
<p>While different files may produce different results, the allegation made on WhatWG was so expansive that I believe a simple comparison can reliably demonstrate its falsehood.</p>
<p>I do not believe Chris intended to deceive anyone, only that he is a victim of the same outdated and/or simply inaccurate information that has fooled many others. Automotive enthusiasts may make a big deal about a 5 horsepower difference between two cars, but these kinds of raw performance differences are not relevant to most car buyers nor are they even the most important criteria to people who race. Likewise, videophiles nitpick the quality of compression formats and this nitpicking is important for the advancement of the art. But I believe that people are mistaking these kinds of small differences for something which is relevant to their own codec selection. </p>
<p><strong>Results</strong></p>
<p>A 499kbit/sec H.264+AAC output and a 327kbit/sec H.263(Sorensen Spark)+MP3 output were available via the download service. The YouTube-encoded files are available on the <a href="http://www.youtube.com/watch?v=72NiIJR9OfM">YouTube site</a>. Because the files on YouTube may change and the web player does not disclose the underlying bitrate, I have made the two encoded files available. </p>
<p><strong>~499kbit/sec comparison</strong></p>
<p><strong>YouTube</strong></p>
<div>
<img src="http://people.xiph.org/~greg/video/ytcompare/bbb_youtube_h264_499kbit_366.png"/>
</div>
<p><a href="http://myrandomnode.dyndns.org:8080/~gmaxwell/ytcompare/bbb_youtube_h264_499kbit.mp4">Download</a> (H.264+AAC; 17MiB) </p>
<p><strong>Ogg/Theora+Vorbis</strong></p>
<div>
<img src="http://people.xiph.org/~greg/video/ytcompare/bbb_theora_486kbit_366.png"/>
</div>
<p><a href="http://people.xiph.org/~greg/video/ytcompare/bbb_theora_486kbit.html">Download / Watch</a> (Ogg/Theora+Vorbis; 17MiB) </p>
<p><strong>~327kbit/sec comparison</strong></p>
<p><strong>YouTube</strong></p>
<div>
<img src="http://people.xiph.org/~greg/video/ytcompare/bbb_youtube_lowquality_327kbit_366.png"/>
</div>
<p><a href="http://myrandomnode.dyndns.org:8080/~gmaxwell/ytcompare/bbb_youtube_lowquality_327kbit.flv">Download</a> (H.263+MP3; 12MiB)</p>
<p><strong>Ogg/Theora+Vorbis</strong></p>
<div>
<img src="http://people.xiph.org/~greg/video/ytcompare/bbb_theora_325kbit_366.png"/>
</div>
<p><a href="http://people.xiph.org/~greg/video/ytcompare/bbb_theora_325kbit.html">Download / Watch</a> (Ogg/Theora+Vorbis; 12MiB) </p>
<p>A slightly lower bitrate was used for the Theora+Vorbis test cases to avoid any question of quality improvement resulting from larger outputs.<br />
<strong>For a fair comparison you must compare the audio as well. Even without audio differences, still image comparisons are a poor proxy for video quality.</strong><br />
I provided this random frame still image comparison only because I expect that people will not bother watching the examples without evidence that the results are interesting. </p>
<p><strong>Methodology</strong></p>
<p>In order to avoid any possible bias in the selection of H.264 encoders and encoding options, and to maximize the relevance for this particular issue, I&#8217;ve used YouTube itself as the H.264 encoder. This is less than ideal because YouTube does not accept lossless input, but it does accept arbitrarily high bitrate inputs.</p>
<p>I utilized the Blender Foundation&#8217;s <a href="http://bigbuckbunny.org/">Big Buck Bunny</a> as my test case because of its clear licensing status, because it&#8217;s a real world test case, and because I have it available in a lossless format. I am not aware of any reason why this particular clip would favor either Theora or H.264.</p>
<p>I chose to use a test case with a soundtrack because most real usage has sound. No one implements HTML5 video without audio, and no one is implementing either of Theora or Vorbis without the other. Vorbis&#8217;s state-of-the-art performance is a contributor to the overall Ogg/Theora+Vorbis solution. </p>
<ul>
<li>Obtain the lossless 640&#215;360 Big Buck Bunny source PNGs and FLACs from <a href="http://media.xiph.org/BBB/">media.xiph.org</a>.
<li>Resample the images to 480&#215;270 using ImageMagick&#8217;s convert utility.
<li>Use gstreamer&#8217;s jpegenc, produce a quality=100 mjpeg + PCM audio stream. The result is around 1.5Gbytes with a bitrate of around 20Mbit/sec.
<li>Truncate the file to fit under the YouTube 1Gbyte limit, resulting in <a href="http://people.xiph.org/~greg/video/ytcompare/input_mjpeg.avi">input_mjpeg.avi</a> (706MiB).
<li>Upload the file to YouTube and wait for it to transcode.
<li>Download the FLV and H.264 files produced by YouTube using one of the many web downloading services. (I used <a href="http://keepvid.com/">keepvid</a>)
<li>Using libtheora 1.1a2 and Vorbis aoTuv 5.7 produce a file of comparable bitrate to the youtube 499kbit/sec from the same file uploaded to YouTube (input_mjpeg.avi).
<li>Resample the file uploaded to YouTube to 400&#215;226.
<li>Using libtheora 1.1a2 and Vorbis aoTuv 5.7 produce a file of comparable bitrate to the youtube 327kbit/sec from the 400&#215;226 downsampled copy of input_mjpeg.avi.
</ul>
<p>I later discovered that YouTube sometimes offers additional sizes. I tried the <a href="http://bitbucket.org/rg3/youtube-dl/wiki/Home">youtube-dl</a> utility and it indicated that these other sizes were not available for my file. Otherwise I would have also included them in this comparison.</p>
<p>A keyframe interval of 250 frames was used for the Theora encoding. The theora 1.1a2 encoder software used is available from <a href="http://theora.org/news/">theora.org</a>. The Vorbis encoder used is available from the <a href="http://www.geocities.jp/aoyoume/aotuv/">aoTuV</a> website. No software modifications were performed. </p>
<p><strong>My conclusions</strong></p>
<p>It can be difficult to compare video at low bitrates, and even YouTube&#8217;s higher bitrate option is not high enough to achieve good quality. The primary challenge is that all files at these rates will have problems, so the reviewer is often forced to decide which of two entirely distinct flaws is worse. Sometimes people come to different conclusions.</p>
<p>That said, I believe that the Theora+Vorbis results are substantially better than the YouTube 327kbit/sec. Several other people have expressed the same view to me, and I expect you&#8217;ll also reach the same conclusion. This is unsurprising since we&#8217;ve been telling people that Theora is better than H.263, especially at lower bitrates, for some time now and YouTube only uses a subset of H.263.</p>
<p>The low bitrate case is also helped by Vorbis&#8217; considerable superiority over MP3. For example, the crickets at the beginning are inaudible in the low rate YouTube clip but sound fine in the Ogg/Theora+Vorbis version.</p>
<p>In the case of the 499kbit/sec H.264 I believe that under careful comparison many people would prefer the H.264 video. However, the difference is not especially great. I expect that most casual users would be unlikely to express a preference or complain about quality if one was substituted for another and I&#8217;ve had several people perform a casual comparison of the files and express indifference. Since Theora+Vorbis is providing such comparable results, I think I can confidently state that reports of the internet&#8217;s impending demise are greatly exaggerated.</p>
<p>Of course, YouTube may be using an inferior processing chain, or encoding options which trade off quality for some other desirable characteristic (like better seeking granularity, encoding speed, or a specific rate control pattern). But even if they are, we can conclude that adopting an an open unencumbered format in addition to or instead of their current offerings would not cause problems on the basis of quality or bitrate.</p>
<p>But please— see and hear for yourself. </p>
<div align="right">&#8211;<a href="mailto:greg@xiph.org">Greg Maxwell</a></div>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2009/06/open-video-codecs-and-quality/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
<enclosure url="http://people.xiph.org/~greg/video/ytcompare/input_mjpeg.avi" length="739987056" type="video/x-msvideo" />
		</item>
	</channel>
</rss>

