<?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>indiegamr &#187; audio</title>
	<atom:link href="http://indiegamr.com/category/audio/feed/" rel="self" type="application/rss+xml" />
	<link>http://indiegamr.com</link>
	<description>apps, indie &#38; beyond</description>
	<lastBuildDate>Sun, 30 Mar 2014 14:51:19 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.0.38</generator>
	<item>
		<title>SoundJS 0.5.2 Audio Plugin for CocoonJS 1.4.7</title>
		<link>http://indiegamr.com/soundjs-0-5-2-audio-plugin-for-cocoonjs-1-4-7/</link>
		<comments>http://indiegamr.com/soundjs-0-5-2-audio-plugin-for-cocoonjs-1-4-7/#comments</comments>
		<pubDate>Sun, 30 Mar 2014 14:45:36 +0000</pubDate>
		<dc:creator><![CDATA[olsn]]></dc:creator>
				<category><![CDATA[audio]]></category>
		<category><![CDATA[CocoonJS]]></category>
		<category><![CDATA[EaselJS]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[mobile]]></category>

		<guid isPermaLink="false">http://indiegamr.com/?p=739</guid>
		<description><![CDATA[I just updated the CocoonJSAudioPlugin.js to work with SoundJS 0.5.2 and CocoonJS 1.4.7 Download: CocoonJSAudioPlugin How to use: Just put the CocoonPlugin as the first entry to register and you can use everything else of the SoundJS-library just as is in &#8230; <a href="http://indiegamr.com/soundjs-0-5-2-audio-plugin-for-cocoonjs-1-4-7/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I just updated the CocoonJSAudioPlugin.js to work with SoundJS 0.5.2 and CocoonJS 1.4.7</p>
<p><strong>Download: <a href='http://indiegamr.com/wp-content/uploads/CocoonJSAudioPlugin_0.5.2.js'>CocoonJSAudioPlugin</a></strong></p>
<p><strong>How to use:</strong> Just put the CocoonPlugin as the first entry to register and you can use everything else of the SoundJS-library just as is in CocoonJS now.</p><pre class="crayon-plain-tag">createjs.Sound.registerPlugins([createjs.CocoonJSAudioPlugin]);</pre><p></p>
<hr />
<strong>Playing the same sound multiple times parallel/overlapping:</strong> You will have to set the maximum number of parallel sounds in the register-method:<br />
<pre class="crayon-plain-tag">//this will allow me to play 3 parallel instances of jump.ogg
  createjs.Sound.registerSound('jump.ogg','jump', 3);</pre></p>
]]></content:encoded>
			<wfw:commentRss>http://indiegamr.com/soundjs-0-5-2-audio-plugin-for-cocoonjs-1-4-7/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>The state of Audio in HTML5 Games</title>
		<link>http://indiegamr.com/the-state-of-audio-in-html5-games/</link>
		<comments>http://indiegamr.com/the-state-of-audio-in-html5-games/#comments</comments>
		<pubDate>Fri, 26 Apr 2013 10:46:00 +0000</pubDate>
		<dc:creator><![CDATA[olsn]]></dc:creator>
				<category><![CDATA[audio]]></category>
		<category><![CDATA[gaming]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[mobile]]></category>

		<guid isPermaLink="false">http://indiegamr.com/?p=649</guid>
		<description><![CDATA[HTML5 Gaming for desktop and mobile is a very trendy topic these days. The performance of canvas applications is getting better and better each day and technologies like CocoonJS or Ejecta even enable a close to native performance for canvas &#8230; <a href="http://indiegamr.com/the-state-of-audio-in-html5-games/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p style="text-align: left;">HTML5 Gaming for desktop and mobile is a very trendy topic these days. The performance of canvas applications is getting better and better each day and technologies like <a href="http://ludei.com/tech/cocoonjs">CocoonJS</a> or <a href="http://impactjs.com/ejecta">Ejecta</a> even enable a close to native performance for canvas applications on mobile devices. &#8211; But what about audio? Is it really that easy to implement sound with your html app?<br />
This article features some interesting points that I collected while researching for my eBook ‘<a href="http://indiegamr.com/zerotoappstore/">From Zero to the Appstore’</a>.</p>
<h2>Audio != Audio</h2>
<p style="text-align: left;">While most browsers and devices already do support audio in general, that doesn’t mean you can just play any audio file in any modern browser. The following table briefly lists the support for Audio-codecs.</p>
<p><span id="more-649"></span></p>
<table style="font-size: 70%;" width="70%" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top"><strong>Browser</strong></td>
<td valign="top"><strong>Codec Support</strong></td>
</tr>
<tr>
<td valign="top"><strong>Chrome</strong></td>
<td valign="top">Ogg, MP3, WAV</td>
</tr>
<tr>
<td valign="top"><strong>Firefox</strong></td>
<td valign="top">Ogg, WAV</td>
</tr>
<tr>
<td valign="top"><strong>Internet Explorer (9+)</strong></td>
<td valign="top">MP3, AAC</td>
</tr>
<tr>
<td valign="top"><strong>Opera</strong></td>
<td valign="top">Ogg, WAV</td>
</tr>
<tr>
<td valign="top"><strong>Safari</strong></td>
<td valign="top">MP3, AAC, WAV</td>
</tr>
<tr>
<td valign="top"><strong> </strong></td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top"><strong>Android</strong></td>
<td valign="top">Depending on the Device</td>
</tr>
<tr>
<td valign="top"><strong>Blackberry</strong></td>
<td valign="top">MP3, AAC</td>
</tr>
<tr>
<td valign="top"><strong>Mobile Safari (iPhone, iPad, iPod Touch)</strong></td>
<td valign="top">MP3, AAC</td>
</tr>
<tr>
<td valign="top"><strong>Opera Mobile</strong></td>
<td valign="top">Depending on the Device</td>
</tr>
</tbody>
</table>
<p style="text-align: left;">As you can see there is no single codec and format that is supported by all browsers and devices. In addition to this not every device does support the <strong><a href="http://caniuse.com/#feat=audio-api">WebAudio-API</a></strong> and some devices only allow audio-playback upon a user-interaction or only allow playing one sound at a time. So what should you do? Setup an audio file for any codec and then check the browser’s support before loading and playing the file? While this would be currently the only way to do it right, this not only sounds like a lot of work, but also is. What about browsers that don’t support the audio-element at all? – Implementing a flash fallback is no easy task as well.</p>
<hr />
<p><span style="color: #000000; font-weight: bold;">SoundJS</span></p>
<p style="text-align: left;">One possible solution is <strong><a href="http://www.createjs.com/#!/SoundJS">SoundJS</a></strong> – SoundJS is a JavaScript framework that will take care of all the compatibility issues with audio on different devices and even adds the ability of a flash-fallback should the browser support no audio. You would still have to provide different files for each sound to ensure that a soundfile is available for each device depending on the codec support but besides this, playing a sound with SoundJS can be done with 2 lines of JavaScript:</p>
<p></p><pre class="crayon-plain-tag">var src = ‘mySound.m4a|mySound.ogg’;
createjs.Sound.registerSound(src);
//…after the sound was loaded, it can be played by:
createjs.Sound.play(src);</pre><p></p>
<p style="text-align: left;">What I also like about SoundJS is that it features a plugin-system, so you can write your custom playback-plugin for individual needs, for example I used it to write a CocoonJS-plugin for it.</p>
<hr />
<p><span style="color: #000000; font-weight: bold;">howler.js</span></p>
<p style="text-align: left;">Another solution is <strong><a href="https://github.com/goldfire/howler.js/">howler.js</a></strong>, it is also released under the MIT license, so you can use it free in any of you projects it works very similar to SoundJS. One advantage over SoundJS is that it is very lightweight with only 9kb and offers pretty much the same functionality as SoundJS – with one exception though: howler.js features no flash-fallback, but if you are targeting mobile platforms, this should be no problem.</p>
<p></p><pre class="crayon-plain-tag">var sound = new Howl({
  urls: ['mySound.m4a','mySound.ogg']
}).play();</pre><p>Another thing I like about howler is the support of sound-sprites:</p><pre class="crayon-plain-tag">var sound = new Howl({
  urls: ['sounds.mp3', 'sounds.ogg'],
  sprite: {
    blast: [0, 1000],
    laser: [2000, 3000],
    winner: [4000, 7500]
  }
});

// shoot the laser!
sound.play('laser');</pre><p>&nbsp;</p>
<hr />
<p style="text-align: left;"><span style="color: #000000; font-weight: bold;">SoundManager 2</span><br />
A third option is <strong><a href="http://www.schillmania.com/projects/soundmanager2/">SoundManager 2</a></strong>, (<strong><a href="https://github.com/scottschiller/soundmanager2/">github</a></strong>), just like SoundJS it features a flash fallback if HTML5 audio is not supported. SoundManager2 is used by popular site like SoundCloud, last.fm or the Nyan Cat site. The focus of SoundManager2 is more on implementing audio-players on web-sites as it also features UIs for audio playback. Sounds are played like this:</p>
<p></p><pre class="crayon-plain-tag">// create "mySound"...
soundManager.createSound({
  id: 'mySound',
  url: '/path/to/an.mp3'
});

// ...and play it
soundManager.play('mySound');</pre><p>&nbsp;</p>
<hr />
<p><span style="color: #000000; font-weight: bold;">Comparison</span></p>
<p style="text-align: left;">As you can see, all three frameworks have their pros and cons, you should check out their sites and see what features you need for your project. The following table is just a very brief overview on the differences:</p>
<table style="font-size: 70%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="160"><strong>Feature/Player</strong></td>
<td width="160">
<p align="center"><strong>SoundJS</strong></p>
</td>
<td width="160">
<p align="center"><strong>howler.js</strong></p>
</td>
<td width="160">
<p align="center"><strong>SoundManager 2</strong></p>
</td>
</tr>
<tr>
<td width="160"><strong>Automatic playback of the correct codec/format</strong></td>
<td width="160">
<p align="center">Yes</p>
</td>
<td width="160">
<p align="center">Yes</p>
</td>
<td width="160">
<p align="center">Yes</p>
</td>
</tr>
<tr>
<td width="160"><strong>Flash fallback</strong></td>
<td width="160">
<p align="center">Yes</p>
</td>
<td width="160">
<p align="center">no</p>
</td>
<td width="160">
<p align="center">Yes</p>
</td>
</tr>
<tr>
<td width="160"><strong>Size (no gzip)</strong></td>
<td width="160">
<p align="center">25kb</p>
</td>
<td width="160">
<p align="center">9kb</p>
</td>
<td width="160">
<p align="center">34kb</p>
</td>
</tr>
<tr>
<td width="160"><strong>Sound Sprites</strong></td>
<td width="160">
<p align="center">No (can play with offset)</p>
</td>
<td width="160">
<p align="center">Yes</p>
</td>
<td width="160">
<p align="center">No (can play and stop at offset)</p>
</td>
</tr>
<tr>
<td width="160"><strong>License</strong></td>
<td width="160">
<p align="center">MIT</p>
</td>
<td width="160">
<p align="center">MIT</p>
</td>
<td width="160">
<p align="center">BSD</p>
</td>
</tr>
<tr>
<td width="160"><strong>Best used for*</strong></td>
<td width="160">
<p align="center">All-rounder, probably best used in combination with the CreateJS suite</p>
</td>
<td width="160">
<p align="center">games/mobile apps</p>
</td>
<td width="160">
<p align="center">Websites, mobile sites as an audio player</p>
</td>
</tr>
</tbody>
</table>
<p>*this doesn’t mean that you cannot use it for other cases, it’s just my personal evaluation</p>
<hr />
<p><span style="color: #000000; font-weight: bold;">A last word: Beware of MP3!</span></p>
<p style="text-align: left;">What a lot of people probably don’t know: <span style="text-decoration: underline;"><strong>MP3 is not free!</strong></span><br />
Implementing mp3 into your app/game is no problem, but what you should know is that if your game is ‘distributed’ (technically that includes 1 user playing the game in his browser) more than 5000 times, you have to pay an <a href="http://www.mp3licensing.com/royalty/games.html"><strong>mp3 codec royalty of $2500</strong></a>. But not only because of the licensing I would suggest you to use Ogg Vorbis(.ogg) or AAC(.m4a, MP4), OGG and AAC do have a better sound-quality while encoded with a smaller file-size than their MP3-counterpart.</p>
<p style="text-align: left;">If you want to learn more about the workflow of implementing audio into your html5- (mobile-) app/game and additional information on creating and publishing an HTML5 game, you should checkout my book at: <a href="http://indiegamr.com/zerotoappstore/">http://indiegamr.com/zerotoappstore/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://indiegamr.com/the-state-of-audio-in-html5-games/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
