<?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>Streaming Colour Studios &#187; Sound</title>
	<atom:link href="http://www.streamingcolour.com/blog/category/sound/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.streamingcolour.com/blog</link>
	<description>The trials and joys of indie games development</description>
	<lastBuildDate>Tue, 07 Sep 2010 17:55:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Dapple Update (pun intended)</title>
		<link>http://www.streamingcolour.com/blog/2009/03/27/dapple-update-pun-intended/</link>
		<comments>http://www.streamingcolour.com/blog/2009/03/27/dapple-update-pun-intended/#comments</comments>
		<pubDate>Fri, 27 Mar 2009 13:46:22 +0000</pubDate>
		<dc:creator>OG</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Misc]]></category>
		<category><![CDATA[Sound]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[10MB]]></category>
		<category><![CDATA[AAC]]></category>
		<category><![CDATA[AI]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[audio sessions]]></category>
		<category><![CDATA[Dapple]]></category>
		<category><![CDATA[dapple lite]]></category>
		<category><![CDATA[difficulty]]></category>
		<category><![CDATA[feedback]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[heuristics]]></category>
		<category><![CDATA[IMA 4:1]]></category>
		<category><![CDATA[IMA4]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[opponent]]></category>
		<category><![CDATA[PCM]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[sfx]]></category>
		<category><![CDATA[strategy]]></category>

		<guid isPermaLink="false">http://www.streamingcolour.com/blog/?p=509</guid>
		<description><![CDATA[I haven&#8217;t really been posting much this week because I&#8217;ve been working on Dapple. I thought I&#8217;d provide a little update on what I&#8217;ve been doing. I&#8217;m working on a Dapple Update. Yes, the word update is confusing in this first paragraph. Let me try that again: I&#8217;m working on version 1.1 of Dapple and [...]]]></description>
			<content:encoded><![CDATA[<p>I haven&#8217;t really been posting much this week because I&#8217;ve been working on Dapple. I thought I&#8217;d provide a little update on what I&#8217;ve been doing. I&#8217;m working on a Dapple Update. Yes, the word update is confusing in this first paragraph. Let me try that again: I&#8217;m working on version 1.1 of Dapple and Dapple Lite.</p>
<p>There were a couple of key things I wanted to address with Dapple&#8217;s first update:</p>
<p><strong>1) Reduce app footprint to under 10MB</strong></p>
<p>When an app is over 10MB, users with a cell phone connection aren&#8217;t able to download the app directly. Apps that are over 10MB require a Wi-Fi connection to download. I think this is potentially costing me quite a few downloads, mostly of the Lite version. I want the Lite version to be something that people can download on a whim. If they have to wait until they have Wi-Fi access, they might never download it.</p>
<p>Dapple and Dapple Lite were both about 13.1MB, so I needed to reduce them by nearly a 1/3. When I looked at the sizes of my various directories, it became clear that the music and SFX files were the ones causing the problem. Dapple has about 13-14 minutes of music that plays in the game. That amounts to significant file sizes. There are also 14 SFX files.</p>
<p>I&#8217;m going to get a little bit technical here, so if you don&#8217;t care for this stuff, just skip ahead a bit. The iPhone does have a hardware audio decoder. You can use it to hardware accelerate your MP3, AAC, etc decoding. However, it can only operate on one file at a time. This means if you&#8217;re ever going to play more than one sound at once, you have to use two forms of audio decoding. For Dapple, I use AAC compression for the background music, but all the SFX files need to be in a non-encoded format: Linear PCM. This means that the SFX files are huge, because they&#8217;re basically 16-bit uncompressed audio data.</p>
<p>For v1.0 of Dapple, all the music was encoded as AAC, 128kbps, constant bit rate, so that it sounded really good. I decided I would try to reduce the bit rate as much as possible without sacrificing the audio quality too much. By switching to a variable bit rate, I was able to compress the files much more without too much of a quality reduction. By doing this, I was able to reduce the music file sizes from 8.7MB to 6MB! Almost there already!</p>
<p>That was the easy part, now I needed to deal with my SFX. The iPhone documentation infers that if you&#8217;re not using a hardware decoded format you should be using Linear PCM or IMA 4:1. IMA4 (which I&#8217;ll refer to is as from now on) is a compression format for audio that results in a nearly 4:1 compression (it&#8217;s actually closer to 3.75:1). I converted all of my SFX files to IMA4 and was surprised to discover that none of them played. This is because there&#8217;s no native support for IMA4 on the iPhone. You can use it, but you have to write your own decompression code. I ended up scouring the net looking for information on the IMA4 data format, how the compression works, and how to decompress it. I found several partial resources, none of which were complete enough to just let me implement it. It took me two solid days of some pretty hardcore coding (it was really fun, actually), but I finally got IMA4 working in Dapple. The nice thing about IMA4 is that the file gets decompressed when it&#8217;s loaded into memory, and is then played as Linear PCM. This means there&#8217;s no performance hit, except on file load. (I&#8217;ll link to some of the IMA4 resources I found at the bottom of the post)</p>
<p>IMA4 was a huge win. My SFX files totaled about 2.2MB on disk before compression. After compression, they&#8217;re just over 600KB, with almost no loss in sound quality.</p>
<p>So, after rebuilding and zipping, both Dapple and Dapple Lite sit at about 9.5MB! Hooray! What&#8217;s next?</p>
<p><strong>2) Fix an audio bug</strong></p>
<p>This is the only bug that&#8217;s come up more than once since the game launched. If a user is playing their own iPod music while playing Dapple, then locks their device, their iPod music stops playing. This was a problem in how I was managing audio sessions in the game. This has now been fixed.</p>
<p><strong>3) Add a Feedback Button</strong></p>
<p>I want to make it easier for people to provide me with feedback on the game. I changed the Main Menu around so that the &#8220;Credits&#8221; button now says &#8220;Extras&#8221;. This opens a new menu which has &#8220;Feedback&#8221; and &#8220;Credits&#8221; in it. The feedback button, when clicked, launches the Mail program and lets the user send me an email. Hopefully people will use it to request features, complain about things they don&#8217;t like, etc.</p>
<p><strong>4) Add a computer-controlled opponent for 2 Player Mode</strong></p>
<p>This is a request I&#8217;ve had from a lot of different players, so I decided to try to put it into the first update. As of last night, I can actually play a game against a computer opponent. It&#8217;s pretty cool. However, the computer opponent is really stupid right now.</p>
<p>The way Dapple already works is that when a player starts their turn, the game searches the board and picks a random spot that will make a match. This is stored for when the hint arrow needs to be displayed. I figured I could make use of that code and just make a computer opponent execute a move there on its turn, instead of displaying a hint arrow.</p>
<p>This lead me to an interesting discovery: it works, the computer can play, but the computer opponent sucks at the game. In 10 games I played against the computer last night, I won every single game. What I found interesting about this is that this proves that making random moves in Dapple isn&#8217;t nearly as effective as thinking your plays through. I&#8217;ve had a small number of negative reviews (either on the web, or on the App Store), and the complaint is usually that they feel like playing randomly yields the same results as thinking their moves through. With a random computer opponent pitted against a player who thinks their moves through, the human player will almost always win. To me, this is proof that the game can be learned, that you can get better at it, and that strategy will win over randomness. Up until now, that&#8217;s what I believed, but I couldn&#8217;t prove it&#8230;</p>
<p>So today my goal is to try to encode some of the choices I make when looking for the best play to build a heuristic that the AI opponent can use. Then I&#8217;ll need to tune how much it uses that heuristic for various difficulty levels. Should be fun!</p>
<p>With any luck, I should be able to submit Dapple and Dapple Lite v1.1 by Monday.</p>
<p>Owen</p>
<p><strong>IMA4 Resources:</strong></p>
<ul>
<li><a href="http://www.wooji-juice.com/blog/iphone-openal-ima4-adpcm.html" target="_blank">www.wooji-juice.com</a> &#8211; A good starting point, as this article walks through the high-level steps required to get IMA4 decompression working. However, this article leaves out a lot of steps that are necessary to get things working. It is also not very clear on the differences between mono and stereo audio streams and how that affects the packets.</li>
<li><a href="http://wiki.multimedia.cx/index.php?title=IMA_ADPCM" target="_blank">wiki.multimedia.cx</a> &#8211; Contains useful optimizations that allow you to avoid doing byte-&gt;float conversions to do floating-point math.</li>
<li><a href="http://wiki.multimedia.cx/index.php?title=Apple_QuickTime_IMA_ADPCM" target="_blank">wiki.multimedia.cx</a> &#8211; Has some useful information on byte/nibble structure of the packets</li>
<li><a href="http://www.koders.com/c/fid204031FA1B4CEF78D6FC833D02ACE3E21CCEED90.aspx" target="_blank">www.koders.com</a> &#8211; Actual C code for doing the decoding. This is for quicktime IMA4, so some of the logistics of how you extract chunks of data won&#8217;t work, but the actual math for decoding each nibble into a 16-bit frame should be the same for you.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.streamingcolour.com/blog/2009/03/27/dapple-update-pun-intended/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Breaking my Own Rules</title>
		<link>http://www.streamingcolour.com/blog/2009/01/19/breaking-my-own-rules/</link>
		<comments>http://www.streamingcolour.com/blog/2009/01/19/breaking-my-own-rules/#comments</comments>
		<pubDate>Mon, 19 Jan 2009 14:51:46 +0000</pubDate>
		<dc:creator>OG</dc:creator>
				<category><![CDATA[Art]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Misc]]></category>
		<category><![CDATA[Project Management]]></category>
		<category><![CDATA[Sound]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[2-player mode]]></category>
		<category><![CDATA[7:00]]></category>
		<category><![CDATA[animations]]></category>
		<category><![CDATA[crunch]]></category>
		<category><![CDATA[game over]]></category>
		<category><![CDATA[OT]]></category>
		<category><![CDATA[PM]]></category>
		<category><![CDATA[rules]]></category>
		<category><![CDATA[submission]]></category>
		<category><![CDATA[timed mode]]></category>
		<category><![CDATA[weekends]]></category>
		<category><![CDATA[work-life]]></category>

		<guid isPermaLink="false">http://www.streamingcolour.com/blog/?p=269</guid>
		<description><![CDATA[Back at the end of November I posted about some new rules I had made for my work-life. Basically, I had said that I wasn&#8217;t going to do work, or read work emails after 7:00 PM each night. I had also decided that I wasn&#8217;t going to work on weekends. All of that went out [...]]]></description>
			<content:encoded><![CDATA[<p>Back at the end of November I posted about <a href="http://www.streamingcolour.com/blog/2008/11/28/steps-forward/" target="_blank">some new rules</a> I had made for my work-life. Basically, I had said that I wasn&#8217;t going to do work, or read work emails after 7:00 PM each night. I had also decided that I wasn&#8217;t going to work on weekends. All of that went out the window last week.</p>
<p>As I get closer to submission I&#8217;m working more and more. Last week I did several nights of working late and I worked a half day on Saturday, and a few hours on Sunday. I&#8217;m already paying for it. I haven&#8217;t been sleeping well again. The problem is that when I work late, I can&#8217;t stop thinking about work, even when I&#8217;m supposed to be sleeping. I end up lying awake at night going over things in my head instead of falling asleep. So I&#8217;m not really sure what to do. On the one hand, I need to be putting in this extra time right now, but on the other hand, I do like to get some sleep.</p>
<p>The good news is that by working a bit on the weekend I was able to wrap up the Timed Mode for the game. I managed to put in a bunch of new animations including: a countdown animation when you start a timed game, some beeping sounds when your time&#8217;s running out (that get more frantic as you get closer to &#8220;time&#8217;s up&#8221;), and a new Game Over animation that differentiates between losing because there were no more moves and because you ran out of time.</p>
<p>I&#8217;m quite pleased with how the Timed Mode turned out and I&#8217;m also pleased with how long it took to implement it. It took about 3.5 full days of coding to get it all in and working, with all the new animations, UI, etc.</p>
<p>Yesterday I started planning out the 2-Player mode that I want to add this week. The biggest problem I&#8217;m running into is the screen layout. The screen is pretty tight in single-player modes for displaying critical information, but now I need to display info for 2 players. So yesterday I spent a few hours mucking around in image editing software playing with the layout. I think I&#8217;ve got something that should work. Now I&#8217;ve just got to build it and see.</p>
<p>I&#8217;ve given myself until the end of the week (i.e. Sunday) to implement this new mode. That&#8217;s about as long as I can afford to take and not risk delaying the project significantly. It feels like I should be able to do it. Here&#8217;s hoping I&#8217;m right.</p>
<p>Owen</p>
]]></content:encoded>
			<wfw:commentRss>http://www.streamingcolour.com/blog/2009/01/19/breaking-my-own-rules/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Productive Day</title>
		<link>http://www.streamingcolour.com/blog/2009/01/08/productive-day/</link>
		<comments>http://www.streamingcolour.com/blog/2009/01/08/productive-day/#comments</comments>
		<pubDate>Thu, 08 Jan 2009 21:30:49 +0000</pubDate>
		<dc:creator>OG</dc:creator>
				<category><![CDATA[Art]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Sound]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[blurriness]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[dead code]]></category>
		<category><![CDATA[front end]]></category>
		<category><![CDATA[initialization]]></category>
		<category><![CDATA[multiplier]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[options]]></category>
		<category><![CDATA[polish]]></category>
		<category><![CDATA[sfx]]></category>
		<category><![CDATA[sound fx]]></category>
		<category><![CDATA[textures]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[widgets]]></category>

		<guid isPermaLink="false">http://www.streamingcolour.com/blog/?p=232</guid>
		<description><![CDATA[Since I fixed my audio problems I&#8217;ve been quite productive. I&#8217;ve tackled a lot of small problems over the last day and a half. Here&#8217;s what I&#8217;ve done since yesterday at lunch:

Dropped the final music and sound fx into the game &#8211; the sfx have been balanced against the music levels now.
Created a new interface [...]]]></description>
			<content:encoded><![CDATA[<p>Since I fixed my audio problems I&#8217;ve been quite productive. I&#8217;ve tackled a lot of small problems over the last day and a half. Here&#8217;s what I&#8217;ve done since yesterday at lunch:</p>
<ul>
<li>Dropped the final music and sound fx into the game &#8211; the sfx have been balanced against the music levels now.</li>
<li>Created a new interface for playing sound fx so that I can play them from anywhere in the game.</li>
<li>Added sound fx to all the front-end menus and widgets.</li>
<li>Implemented a tips system for first-time players that brings up information as events trigger in the game.</li>
<li>Added an option to the Options menu that allows users to reset the tips.</li>
<li>Went through all of the textures in the game and ensured that their widths and heights were all an even number of pixels &#8211; I had noticed some blurriness in a bunch of textures, which turned out to be because of the way the UV mapping is done on textures with odd widths/heights.</li>
<li>Updated the multiplier animation to use the nice font and tuned the animation to be more smooth.</li>
<li>Removed a bunch of dead code that wasn&#8217;t being used anymore.</li>
<li>Fixed a bug in the board initialization code when launching the game at harder difficulties.</li>
</ul>
<p>It feels good to get lots of little things done. It&#8217;s all these little things that make a real difference to the feel of the game.</p>
<p>Owen</p>
]]></content:encoded>
			<wfw:commentRss>http://www.streamingcolour.com/blog/2009/01/08/productive-day/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Audio Woes Become Audio Woos!</title>
		<link>http://www.streamingcolour.com/blog/2009/01/07/audio-woes-become-audio-woos/</link>
		<comments>http://www.streamingcolour.com/blog/2009/01/07/audio-woes-become-audio-woos/#comments</comments>
		<pubDate>Wed, 07 Jan 2009 17:15:13 +0000</pubDate>
		<dc:creator>OG</dc:creator>
				<category><![CDATA[Sound]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[ipod]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[session]]></category>
		<category><![CDATA[sfx]]></category>
		<category><![CDATA[sound effects]]></category>
		<category><![CDATA[sound fx]]></category>
		<category><![CDATA[user music]]></category>

		<guid isPermaLink="false">http://www.streamingcolour.com/blog/?p=228</guid>
		<description><![CDATA[Sweet merciful crap, I&#8217;ve finally got my audio working properly! It took me 3 days of trying things before finally figuring it out. Even after I simplified things (as Bemmu had suggested in the comments to an earlier post), I still ran into a bunch of problems that would have prevented me from shipping the [...]]]></description>
			<content:encoded><![CDATA[<p>Sweet merciful crap, I&#8217;ve finally got my audio working properly! It took me 3 days of trying things before finally figuring it out. Even after I simplified things (as Bemmu had suggested in the comments to an earlier post), I still ran into a bunch of problems that would have prevented me from shipping the game. I&#8217;ve finally fixed it all, and in its simplified form I think things work much more intuitively, so that&#8217;s a bonus.</p>
<p>Now the audio for the game works like this:</p>
<ul>
<li>If the user is playing iPod music when the game launches, it plays the game&#8217;s sound fx, but uses the iPod music.</li>
<li>If the user is not playing iPod music when the game launches, it plays the custom game music along with the game&#8217;s sound fx.</li>
<li>If the user brings up the iPod music controls mid-game and starts playing their own music, the game will stop playing its music and let them play theirs instead.</li>
<li>If the user brings up the iPod music controls mid-game and stops playing their own music, the game will start playing the custom game music again.</li>
</ul>
<p>If you have an iPhone developer account and want to see the details (including code snippets) of what happened and how I fixed it, you can see the thread on the forums here: <a href="https://devforums.apple.com/thread/5954" target="_blank">Audio Session Problems</a> (devforums.apple.com &#8211; Note: You must have an iPhone developer login to access this page).</p>
<p>I&#8217;m very pleased with how well this works. I think it makes the game feel much more polished, as it puts control into the users&#8217; hands and lets them play how they want to play.</p>
<p>Next up this afternoon: adding sfx to the front-end menus.</p>
<p>Owen</p>
]]></content:encoded>
			<wfw:commentRss>http://www.streamingcolour.com/blog/2009/01/07/audio-woes-become-audio-woos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How Much Hair Pulled Out is too Much?</title>
		<link>http://www.streamingcolour.com/blog/2009/01/06/how-much-hair-pulled-out-is-too-much/</link>
		<comments>http://www.streamingcolour.com/blog/2009/01/06/how-much-hair-pulled-out-is-too-much/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 16:04:11 +0000</pubDate>
		<dc:creator>OG</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[Sound]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[crashes]]></category>
		<category><![CDATA[frustration]]></category>
		<category><![CDATA[iPod Touch]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[rolando]]></category>
		<category><![CDATA[sessions]]></category>
		<category><![CDATA[stable]]></category>
		<category><![CDATA[user music]]></category>

		<guid isPermaLink="false">http://www.streamingcolour.com/blog/?p=223</guid>
		<description><![CDATA[My audio issues are becoming increasing frustrating. This morning I decided I would try to simplify things. I had seen other apps handle the music thing like this: if the user is playing their own music when the game starts, let their music keep playing; if the user isn&#8217;t playing music when the game starts, [...]]]></description>
			<content:encoded><![CDATA[<p>My audio issues are becoming increasing frustrating. This morning I decided I would try to simplify things. I had seen other apps handle the music thing like this: if the user is playing their own music when the game starts, let their music keep playing; if the user isn&#8217;t playing music when the game starts, play the game&#8217;s music. I figured this would be easier to implement (and it should be).</p>
<p>I got curious about how other games handle things like this: start the game with no music playing, then attempt to start music via the quick music pop-up (double-tap the home button to bring it up anywhere on your iPhone/iPod touch) once the game is running (this causes my game to hang right now). I started going through other games on my iPod touch and tried combinations of starting with and without music. I ended up with all sorts of problems: games freezing, music refusing to play, the <em>iPod&#8217;s music player</em> jumping around between albums even though it&#8217;s not set on random, games playing music the first time I boot them, but then refusing to play music and refusing to accept touch events the next time I boot them.</p>
<p>For example, I booted Rolando while my own music was playing. The game kept playing my music and allowed me to play fine. I quit the game and stopped my music. When I reentered Rolando, no music played (including game music) and touch events had a 5-10 second delay on them rendering the game unplayable. It seems unlikely that this is a problem with the game as I experienced similar behaviour with other games. This is what I like to call &#8220;Good Times&#8221;.</p>
<p>In short: I&#8217;m not sure my iPod touch is stable anymore. I&#8217;m wondering if some of the bugs I was seeing are problems with the iPod? Or perhaps my bugs caused problems with the iPod? I&#8217;m tempted to do a hardware restore and see if things become more stable. Rebooting the device doesn&#8217;t seem to be helping much.</p>
<p>In non-audio related news, Gamasutra has a feature article up today about iPhone game development in 2009:</p>
<ul>
<li><a href="http://www.gamasutra.com/view/feature/3897/ilang_syne_a_guide_to_iphone_game_.php"><span class="title">iLang Syne: A Guide To iPhone Game Development In 2009</span></a><span class="title"> </span>(www.gamasutra.com) &#8211; The author looks back at 2008 and the emergence of iPhone gaming, then talks about where we&#8217;re at right now, and then talks about what 2009 might look like for iPhone game development.</li>
</ul>
<p>Now if you&#8217;ll excuse me, I&#8217;ve got an iPod touch to wipe out.</p>
<p>Owen</p>
]]></content:encoded>
			<wfw:commentRss>http://www.streamingcolour.com/blog/2009/01/06/how-much-hair-pulled-out-is-too-much/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Audio Problems</title>
		<link>http://www.streamingcolour.com/blog/2009/01/05/audio-problems/</link>
		<comments>http://www.streamingcolour.com/blog/2009/01/05/audio-problems/#comments</comments>
		<pubDate>Mon, 05 Jan 2009 21:27:06 +0000</pubDate>
		<dc:creator>OG</dc:creator>
				<category><![CDATA[Sound]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[audio sessions]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[crash]]></category>
		<category><![CDATA[engine]]></category>
		<category><![CDATA[interrupts]]></category>
		<category><![CDATA[sessions]]></category>

		<guid isPermaLink="false">http://www.streamingcolour.com/blog/?p=219</guid>
		<description><![CDATA[If there is a God of programming, I think it is a vengeful God. I think I&#8217;m being punished for saying that I was a pretty good programmer the other day&#8230;
I&#8217;ve spent the last few days trying to getting Audio Sessions working with the game. Audio Sessions are the iPhone&#8217;s way of handling audio priorities. [...]]]></description>
			<content:encoded><![CDATA[<p>If there is a God of programming, I think it is a vengeful God. I think I&#8217;m being punished for saying that I was a pretty good programmer the other day&#8230;</p>
<p>I&#8217;ve spent the last few days trying to getting Audio Sessions working with the game. Audio Sessions are the iPhone&#8217;s way of handling audio priorities. Basically, your iPhone app has little control over audio priorities on the device; you set up an session inside your app and tell the iPhone how you want it to treat your audio: should your audio stop the user&#8217;s music from playing when it launches, or should it mix with whatever other audio is playing, for example.</p>
<p>I followed through some example code and I thought I had things working, but it&#8217;s not working at all. I&#8217;m trying to do something a little more complicated than is standard: I&#8217;m trying to let the user decide whether the game&#8217;s music plays, or whether they want to hear their own music. They&#8217;ll be able to flip a &#8220;switch&#8221; in the game to change modes. From reading the docs, it looked like this should be straightforward. However, I&#8217;ve run into several problems:</p>
<ul>
<li>I don&#8217;t get the audio interrupt calls I&#8217;ve registered for &#8211; this makes it hard to know when audio states have changed.</li>
<li>Changing the session category isn&#8217;t working &#8211; if I switch from a category where my music takes priority to one where the user&#8217;s music is supposed to have priority, their music doesn&#8217;t play.</li>
<li>Changing categories is causing serious crashes &#8211; I don&#8217;t know why this is happening, but if I change categories and play/stop/play user music in a certain order, I can lock up the iPod touch I&#8217;m using. It won&#8217;t even let me shut it down unless I hold the &#8220;off&#8221; button down for 60-120 seconds, eventually it kind of shuts down in stages and reboots, but then the audio system is all screwed up until I do a second manual shutdown of the iPod. Not good. The real kicker here is that the debugger disconnects from the device as soon as it locks up, so I haven&#8217;t been able to tell what&#8217;s going on. Awesome.</li>
</ul>
<p>So today has been a rather frustrating day so far.</p>
<p>I&#8217;m starting to wonder if it&#8217;s worth re-writing my whole audio engine to use the new audio system that was introduced in OS 2.2. The downside of that is that my game would require users to be upgraded to OS 2.2 and I can&#8217;t find any data on what percentage of users that is. For now I&#8217;ll go back and re-read the audio session documentation, I think.</p>
<p>Owen</p>
]]></content:encoded>
			<wfw:commentRss>http://www.streamingcolour.com/blog/2009/01/05/audio-problems/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>I&#8217;m Baaaack</title>
		<link>http://www.streamingcolour.com/blog/2009/01/02/im-baaaack/</link>
		<comments>http://www.streamingcolour.com/blog/2009/01/02/im-baaaack/#comments</comments>
		<pubDate>Fri, 02 Jan 2009 15:24:05 +0000</pubDate>
		<dc:creator>OG</dc:creator>
				<category><![CDATA[Art]]></category>
		<category><![CDATA[Business]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Misc]]></category>
		<category><![CDATA[Sound]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[2008]]></category>
		<category><![CDATA[2009]]></category>
		<category><![CDATA[a look back]]></category>
		<category><![CDATA[budget]]></category>
		<category><![CDATA[Concept]]></category>
		<category><![CDATA[expensive]]></category>
		<category><![CDATA[gameplay]]></category>
		<category><![CDATA[Happy New Year]]></category>
		<category><![CDATA[have fun]]></category>
		<category><![CDATA[Ideas]]></category>
		<category><![CDATA[implementation]]></category>
		<category><![CDATA[indie development]]></category>
		<category><![CDATA[lessons learned]]></category>
		<category><![CDATA[life space]]></category>
		<category><![CDATA[limitations]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[work space]]></category>

		<guid isPermaLink="false">http://www.streamingcolour.com/blog/?p=214</guid>
		<description><![CDATA[Happy New Year, everyone! I hope that 2009 holds good things in store for you.
I&#8217;m back at work today after being off for over a week. The break has been great. I had expected to work quite a bit over the holidays, but I didn&#8217;t end up doing any work. I think it was good [...]]]></description>
			<content:encoded><![CDATA[<p>Happy New Year, everyone! I hope that 2009 holds good things in store for you.</p>
<p>I&#8217;m back at work today after being off for over a week. The break has been great. I had expected to work quite a bit over the holidays, but I didn&#8217;t end up doing any work. I think it was good for me to get away from the game for a while and hopefully I&#8217;ll be able to come back to it fresh. The next month is going to be extremely busy and tiring, so I&#8217;m glad I took the time to relax a bit before the big crunch.</p>
<p>Seeing as how we&#8217;ve entered into 2009 (that sounds like we&#8217;re living in the future, doesn&#8217;t it?) I thought now would be a good time to go over some of the lessons I&#8217;ve learned so far about indie development:</p>
<ul>
<li><strong>If at all possible, separate your &#8220;work space&#8221; from your &#8220;life space&#8221;.</strong> I&#8217;ve been working from home for 6 months now and I love it. However, my wife and I live in a tiny (under 600 sq feet) apartment so my office is in the same room as the living room and dining area (the whole room is only 12 x 12 feet). While this didn&#8217;t bother me at first, the longer I work here the more I find it difficult to separate work from not-work. When I&#8217;m on the couch watching TV, my computer is almost right next to me and I often end up thinking about work when I should be relaxing. When we can afford to move into a bigger place, my main requirement will be that I have a separate room for my office.</li>
<li><strong>The idea is easy, the implementation is not.</strong> This is not a new lesson for me, this is something you learn very quickly when you start working in the industry. However, when you&#8217;re doing everything on your own, it becomes even more apparent. I spent nearly the first two months of the project just prototyping. I had what I knew to be a great idea for a game, but it took me two months of trying different implementations to find something that was really fun to play. I&#8217;ll admit it: that surprised me. I was convinced that the original idea I had would be fun, but it wasn&#8217;t. The game I have now uses the same core mechanic (mixing paint colours), but the game is totally different from what it started as.</li>
<li><strong>Game development is expensive.</strong> Don&#8217;t let anyone tell you that it&#8217;s not. Granted, start-up costs for a business like this are significantly lower than a business that requires retail space, inventory, employees, etc, but it still costs money. However, I did have hardware and software costs, contractors to pay, etc. I also realise that my budget is minuscule compared to a 10-30 million dollar blockbuster title. However, it&#8217;s my money that I&#8217;m putting up for this. Maybe I should have looked for investors at the start, I don&#8217;t know the answer to that. I like that I have complete control over the product I&#8217;m developing. For better or for worse, the game is mine. When the game is released I&#8217;ll provide some budget numbers (don&#8217;t expect a detailed breakdown, it&#8217;ll be very high level), but for now it&#8217;ll have to wait.</li>
<li><strong>Ideas generate ideas.</strong> Several months ago I posted an entry stating that every day I was going to try to write down an idea for a gameplay concept, a game mechanic, an environment. The idea was to build up a massive document of ideas that I could draw from. This worked really well for a few weeks. Forcing myself to come up with ideas grew new ideas. It was a great cycle to get into. However, as the game development gathered momentum, I stopped writing in the ideas document. Without forcing myself to come up with new ideas, fewer ideas were being formed. I had an idea this morning that I wrote in the book and noticed that my last entry was Oct 30th. I need to get back into the habit of doing this. It will be very important as I finish Dapple and get ready to move on to my next game.</li>
<li><strong>Don&#8217;t try to do it all yourself.</strong> This is really about knowing your limitations. I&#8217;m not trying to be egotistical, but I&#8217;m a pretty damn good programmer. I&#8217;ve been doing it a long time and I feel like I know what I&#8217;m doing. I&#8217;m confident in my abilities to solve problems of a programming nature and that I can learn the things that I need to learn. However, I&#8217;m not a professional artist. I&#8217;m not a musician. I&#8217;m not a sound designer. I think a lot of indie developers are tempted to do it all themselves. It&#8217;s that attitude of &#8220;I know how to use Photoshop; I took an online course,&#8221; or &#8220;I took an art class in high school that I was pretty good at&#8221; that gets people into trouble. When I started I was tempted to do the artwork for my game myself because, yes, I am fairly proficient with Photoshop, and yes, I did take a lot of art courses in high school and university. However, I realised that by doing so, I wasn&#8217;t playing to my strengths. I realised that my time would be better spent programming and paying someone <em>whose job it is</em> to create art, to create the artwork for my game. I think this was the correct decision. I&#8217;m extremely happy with the artwork, sound design and music I got from the people I worked with. While it cost me money instead of just time, I think I&#8217;ve got a much high quality game with a lot more polish out of it.</li>
<li><strong>Have fun!</strong> It seems like an odd one to have to state, but at the heart of things, I&#8217;m doing this because I love doing it. There are times where it feels overwhelming, like it&#8217;s not worth it, that it&#8217;s just too much work and too much risk. Those are the times where you need to step away from the development and remember why you started doing this in the first place: I&#8217;m doing this because I love making games and I want to make the best game I possibly can. What&#8217;s better than that?</li>
</ul>
<p>Happy 2009 everyone!</p>
<p>Owen</p>
]]></content:encoded>
			<wfw:commentRss>http://www.streamingcolour.com/blog/2009/01/02/im-baaaack/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Keep On Keepin&#8217; On</title>
		<link>http://www.streamingcolour.com/blog/2008/12/18/keep-on-keepin-on/</link>
		<comments>http://www.streamingcolour.com/blog/2008/12/18/keep-on-keepin-on/#comments</comments>
		<pubDate>Thu, 18 Dec 2008 16:18:52 +0000</pubDate>
		<dc:creator>OG</dc:creator>
				<category><![CDATA[Art]]></category>
		<category><![CDATA[Marketing]]></category>
		<category><![CDATA[Misc]]></category>
		<category><![CDATA[Sound]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[artist]]></category>
		<category><![CDATA[artwork]]></category>
		<category><![CDATA[emails]]></category>
		<category><![CDATA[high scores]]></category>
		<category><![CDATA[memory leaks]]></category>
		<category><![CDATA[polish]]></category>
		<category><![CDATA[press release]]></category>
		<category><![CDATA[save game]]></category>
		<category><![CDATA[save system]]></category>
		<category><![CDATA[truncation]]></category>

		<guid isPermaLink="false">http://www.streamingcolour.com/blog/?p=192</guid>
		<description><![CDATA[My goodness, two days since my last post! I&#8217;ve been busy.
As I somewhat expected, I didn&#8217;t get any responses from the press release-type emails I sent out. I think I need a different campaign. I think I need to contact editors directly with personal emails, instead of generic ones. I&#8217;m going to hold off until [...]]]></description>
			<content:encoded><![CDATA[<p>My goodness, two days since my last post! I&#8217;ve been busy.</p>
<p>As I somewhat expected, I didn&#8217;t get any responses from the press release-type emails I sent out. I think I need a different campaign. I think I need to contact editors directly with personal emails, instead of generic ones. I&#8217;m going to hold off until I have a version of the game that I can send them as a preview though. I don&#8217;t want the press playing the game I&#8217;ve got just yet. It needs more polish before I let reviewers have a peak at it.</p>
<p>Yesterday I got two big things done: I implemented the save system for the game and I implemented the High Scores screen. The save game system was surprisingly easy to set up. I had already set up a user data save system for the game options, so it was mostly a matter of determining how to store the game state and when/where to read and write it. The cool result of it is that the game now saves your state if you leave the game and you can resume it the next time you boot it up. That was pretty cool the first time it worked.</p>
<p>The High Scores screen seems less exciting, but it was probably the most complicated screen in my front-end, so it feels good to have that done now. I had been putting it off, but now it&#8217;s done and it looks great. However, I did have to make one design decision which may annoy some people: I had to limit the user&#8217;s high score name to 8 characters. That&#8217;s all that will fit on the high score screen. It was either that or truncate the name in the score screen at run-time, but I figured it was better to let the user see that their name is being truncated while they&#8217;re still able to change it.</p>
<p>Oh, and some bad news about my audio memory leak from last week: it hasn&#8217;t gone away. Apparently it went away in the one test case I had used. When I put the full music tracks back into the game, the memory leak appeared again. As far as I can tell, the leak is occurring in an OS level call, so I&#8217;m not really sure what to do about it next. I&#8217;m going to put it on the back-burner for now while I continue with feature implementation. It&#8217;ll have to get fixed during bug fixing time.</p>
<p>Another big step forward for the game this week: my artist delivered the last of the artwork to me. Now it&#8217;s all up to me to get it into the game. Very exciting stuff!</p>
<p>Owen</p>
]]></content:encoded>
			<wfw:commentRss>http://www.streamingcolour.com/blog/2008/12/18/keep-on-keepin-on/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Now With 100% Fewer Memory Leaks!</title>
		<link>http://www.streamingcolour.com/blog/2008/12/11/now-with-100-fewer-memory-leaks/</link>
		<comments>http://www.streamingcolour.com/blog/2008/12/11/now-with-100-fewer-memory-leaks/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 21:58:07 +0000</pubDate>
		<dc:creator>OG</dc:creator>
				<category><![CDATA[Sound]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[2.0]]></category>
		<category><![CDATA[2.2]]></category>
		<category><![CDATA[DTrace]]></category>
		<category><![CDATA[Extended Detail]]></category>
		<category><![CDATA[Instruments]]></category>
		<category><![CDATA[memory leaks]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[queue]]></category>
		<category><![CDATA[sdk]]></category>
		<category><![CDATA[SoundEngine]]></category>
		<category><![CDATA[stack trace]]></category>

		<guid isPermaLink="false">http://www.streamingcolour.com/blog/?p=181</guid>
		<description><![CDATA[This post is probably only of interest to other programmers, but hey, don&#8217;t let me stop you from reading&#8230;
I got back into the code today and I was trying to get multiple music tracks to queue up one after the other using the SoundEngine code. I was having some problems and so I went onto [...]]]></description>
			<content:encoded><![CDATA[<p>This post is probably only of interest to other programmers, but hey, don&#8217;t let me stop you from reading&#8230;</p>
<p>I got back into the code today and I was trying to get multiple music tracks to queue up one after the other using the SoundEngine code. I was having some problems and so I went onto the developer forums and discovered that a lot of people have had problems with SoundEngine. Apparently it had a lot of memory leaks and other problems. Some of the leaks have fixes on the forums. However, what was most shocking was to discover that Apple has pulled all of the example SoundEngine code off the developer site. They&#8217;re basically telling people not to use it anymore.</p>
<p>With the latest public update to the SDK there are preferred ways to do audio. The problem is, they only work on devices running the 2.2 SDK. I want my game to run on anyone&#8217;s iPhone or iPod Touch, so I&#8217;m trying to support 2.0.</p>
<p>I managed to track down a bug in the SoundEngine code that was preventing more than one music track from playing and then decided it was time to boot up Instruments (Apple&#8217;s cool performance analyzer) to have a look for memory leaks. There were quite a few, all of them coming out of the fix I&#8217;d just put in place for the audio system. Ugh.</p>
<p>I spent the afternoon tracking stuff down and I&#8217;ve finally fixed all the leaks in the game (for now). I can also queue up multiple music tracks. Hooray!</p>
<p>I did want to post a couple of things I learned today about tracking down leaks with Instruments:</p>
<ul>
<li>You need to launch your iPhone app directly from Instruments (you can&#8217;t track leaks in an already running iPhone process).</li>
<li>Once you find leaks, go to &#8220;View&#8221; -&gt; &#8220;Extended Detail&#8221;. I can&#8217;t tell you how important this is! I spent an hour chatting with a friend online trying to find a way to get a full stack trace for the leaked memory allocation. It turns out it&#8217;s all in that little hidden window! When you open the Extended Detail window and click on a memory address that leaked, it will show you a full stack trace that lead to the leak.</li>
<li>Double-clicking on a function in the Extended Detail stack trace will open the source code to the exact line in XCode!</li>
<li>You can&#8217;t create custom DTrace instruments for use with an iPhone, they appear to only work with Mac OS X processes.</li>
</ul>
<p>Now that I know a bit more about how to use it, I&#8217;m quite impressed with Instruments. It seems to be a very powerful tool.</p>
<p>Owen</p>
]]></content:encoded>
			<wfw:commentRss>http://www.streamingcolour.com/blog/2008/12/11/now-with-100-fewer-memory-leaks/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Good (Audio) News</title>
		<link>http://www.streamingcolour.com/blog/2008/12/08/good-audio-news/</link>
		<comments>http://www.streamingcolour.com/blog/2008/12/08/good-audio-news/#comments</comments>
		<pubDate>Mon, 08 Dec 2008 21:39:28 +0000</pubDate>
		<dc:creator>OG</dc:creator>
				<category><![CDATA[Sound]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[AAC]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[Audio Queue Services]]></category>
		<category><![CDATA[compression]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[OpenAL]]></category>
		<category><![CDATA[sound fx]]></category>

		<guid isPermaLink="false">http://www.streamingcolour.com/blog/?p=164</guid>
		<description><![CDATA[There&#8217;s a lesson here: read the docs, read more docs, read the forums, go back to the docs, read different docs, find a link to a doc you hadn&#8217;t read before and read it. It turns out that I can indeed compress my music tracks using something reasonable, like AAC.
Here&#8217;s what the confusion was:
I&#8217;m using [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a lesson here: read the docs, read more docs, read the forums, go back to the docs, read different docs, find a link to a doc you hadn&#8217;t read before and read it. It turns out that I <em>can</em> indeed compress my music tracks using something reasonable, like AAC.</p>
<p>Here&#8217;s what the confusion was:</p>
<p>I&#8217;m using the SoundEngine code that comes with one of Apple&#8217;s example projects. They provide you with a way to play background music along with sound FX. I <em>thought</em> that the whole system was using OpenAL for the audio layer, but it turns out that it&#8217;s actually using two systems. It uses OpenAL for the sound FX and it uses something called the Audio Queue Services for the background music track.</p>
<p>If you read through the iPhone documentation on OpenAL it tells you that you may only use PCM or IMA4 for the audio format. I thought this applied to the background music (which it does NOT). The problem I thought I had is that IMA4, while it is compression, doesn&#8217;t compress a whole lot. However, if you use Audio Queue Services you get two advantages: 1) you can stream audio off disk 2) you get access to a whole bunch of hardware decoders.</p>
<p>There are limitations: you can only have one hardware decoded track running at once. Which is why the music uses Audio Queue Services but the sound FX do not.</p>
<p>So, the end result is that I&#8217;ve compressed the audio tracks using AAC and even at a good sampling rate the tracks are about 1MB each. That&#8217;s much more reasonable. So it looks like things are back on track audio-wise. Now I just have to deal with all the other stuff that&#8217;s going on&#8230;</p>
<p>Owen</p>
]]></content:encoded>
			<wfw:commentRss>http://www.streamingcolour.com/blog/2008/12/08/good-audio-news/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
