<?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>FatBasturd &#187; iPhone</title>
	<atom:link href="http://www.fatbasturd.co.uk/tag/iphone/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fatbasturd.co.uk</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 20 Aug 2009 10:58:22 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>iPhone App Development Tips &#8211; Playing multiple sounds using AVAudioPlayer</title>
		<link>http://www.fatbasturd.co.uk/playing-multiple-sounds-using-avaudioplayer/</link>
		<comments>http://www.fatbasturd.co.uk/playing-multiple-sounds-using-avaudioplayer/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 08:54:38 +0000</pubDate>
		<dc:creator>FatBasturd</dc:creator>
				<category><![CDATA[Gaming, Gadgets & Technology]]></category>
		<category><![CDATA[iPhone App Development]]></category>
		<category><![CDATA[Apple Mac]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPhone Development]]></category>

		<guid isPermaLink="false">http://www.fatbasturd.co.uk/?p=176</guid>
		<description><![CDATA[During my journey through App development for the iPhone I will be posting some code that initially gave me a headache and I either managed to solve myself or my good friend Hardy from Catamount Software helped me with.
The first block of code is something that i was struggling with for my latest app called iAnnoyance [...]]]></description>
			<content:encoded><![CDATA[<p>During my journey through App development for the iPhone I will be posting some code that initially gave me a headache and I either managed to solve myself or my good friend Hardy from Catamount Software helped me with.</p>
<p>The first block of code is something that i was struggling with for my latest app called iAnnoyance which is an annoying sounds app. The result i wanted was to have multiple sounds ready to play (.mp3) but each one if triggered must be stopped upon triggering another. In laymens terms &#8220;I wanted to stop one sound when another was playing&#8221;.</p>
<p>The avenue I decided to go up was the AVAudioPlayer route which I chose for the functionality such as looping and play, stop, pause functions.</p>
<p>So rather than create a seperate player for each sound it was decided that the app could use a single player that would watch the button presses and work out which sound needed to be loaded on the fly. This was achieved using the following code in my MainViewController.m</p>
<pre>-(void)playSound:(NSString*)soundName
{
	if (self.currentSound.isPlaying)
	{
		[self.currentSound stop];
	}

	if (![self.lastSoundPlayed isEqual:soundName])
	{
		NSString *soundPath = [[NSBundle mainBundle]
                   pathForResource:soundName ofType:@"mp3"];
		AVAudioPlayer *player =  [[AVAudioPlayer alloc]
                  initWithContentsOfURL:[NSURL fileURLWithPath:soundPath] error:NULL];
		[player setDelegate:self];
		[player prepareToPlay];
		[player play];

		self.currentSound = player;
		[player release];

		self.lastSoundPlayed = soundName;
	}
}</pre>
<p>Each button would then look like so:-<span id="more-176"></span></p>
<pre>-(IBAction)cryBaby:(id)sender{

	[self playSound:@"Cry"];

}

-(IBAction)snoringMan:(id)sender{

	[self playSound:@"Snore"];

}</pre>
<p>Then make sure you release the sounds and free up memory at the end of the file using the following:-</p>
<pre>[currentSound release];
[lastSoundPlayed release];</pre>
<p>currentSound &amp; lastSoundPlayed were also added to the top of the file using the following:-</p>
<pre>@synthesize currentSound;
@synthesize lastSoundPlayed;</pre>
<p>My MainViewController.h would then have the following added:-</p>
<pre>#import &lt;AVFoundation/AVAudioPlayer.h&gt;</pre>
<p>And the following:-</p>
<pre>@interface MainViewController : UIViewController &lt;AVAudioPlayerDelegate&gt; {
                        AVAudioPlayer *currentSound;
                        NSString *lastSoundPlayed;
                        }
@property (retain) AVAudioPlayer *currentSound;
@property (retain) NSString *lastSoundPlayed;</pre>
<p>Using this code you can set up your buttons to listen for your button presses and stop or start a sound respectively. Hopefully this will help you in your App development and as usual, if you have any questions feel free to post them below.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fatbasturd.co.uk/playing-multiple-sounds-using-avaudioplayer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Are you using the iPhone to its maximum ability?</title>
		<link>http://www.fatbasturd.co.uk/are-you-using-the-iphone-to-its-maximum-ability/</link>
		<comments>http://www.fatbasturd.co.uk/are-you-using-the-iphone-to-its-maximum-ability/#comments</comments>
		<pubDate>Fri, 28 Nov 2008 12:02:17 +0000</pubDate>
		<dc:creator>FatBasturd</dc:creator>
				<category><![CDATA[Gaming, Gadgets & Technology]]></category>
		<category><![CDATA[Life, strife & general shite]]></category>
		<category><![CDATA[Playtime]]></category>
		<category><![CDATA[3g]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[cycorder]]></category>
		<category><![CDATA[cydia]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[ipod]]></category>
		<category><![CDATA[jailbreak]]></category>
		<category><![CDATA[Labyrinth]]></category>
		<category><![CDATA[Poo]]></category>
		<category><![CDATA[quickpwn]]></category>
		<category><![CDATA[schofield]]></category>
		<category><![CDATA[swirly MMS]]></category>

		<guid isPermaLink="false">http://www.fatbasturd.co.uk/?p=21</guid>
		<description><![CDATA[
OK, Before i start, I love my iPhone 3G but&#8230;&#8230;.. It is somewhat lacking of certain features found on even bargain bin mobile phones. Why apple have decided to leave these features out is a bit of a dark area but as we have such a great community of developers we have certain ways around [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.fatbasturd.co.uk/are-you-using-the-iphone-to-its-maximum-ability/"><img class="size-full wp-image-22" title="jail" src="http://www.fatbasturd.co.uk/wp-content/uploads/2008/11/jail.jpg" alt="How to Jailbreak your iPhone" /></a></p>
<address><span style="color: #8da5da;">OK, Before i start, I love my iPhone 3G but&#8230;&#8230;.. It is somewhat lacking of certain features found on even bargain bin mobile phones. Why apple have decided to leave these features out is a bit of a dark area but as we have such a great community of developers we have certain ways around them.<span style="color: #8da5da;"> Some of these methods are not supported by Apple but I paid for my iPhone and I will do what I wish with it. I am going to explain certain methods to you so you can unlock the true potential of this glorious gadget. </p>
<p></span></span></address>
<h4>Michael Schofield In Disguise</h4>
<p>The most popular method of getting the best out of your iPhone is to Jailbreak it. The simplest method of Jailbreaking your device is by using a popular program called <a title="Quickpwn" href="http://www.quickpwn.com/" target="_blank">Quickpwn</a>. <a title="Quickpwn" href="http://www.quickpwn.com/" target="_blank">Quickpwn</a> allows you to run software on your iPhone that is not supported by apple but this doesn&#8217;t mean that it will break your new toy! Instead it opens up a world of new opportunities left out by Apple such as Video Recording, MMS and custom ringtones to name but a few.</p>
<p>To Jailbreak your iPhone do the following:<span id="more-21"></span></p>
<ol>
<li><a title="Quickpwn" href="http://www.quickpwn.com/" target="_blank">Download the latest Quickpwn</a></li>
<li>Connect your iPhone to your PC or Laptop</li>
<li>Run Quickpwn and follow the on screen instructions. Thats all there is to it..(Honestly)</li>
</ol>
<h4>Record Video On Your iPhone</h4>
<p>One of the main features Apple failed to include was Video Recording. The reason for this is unknown to me but the good news is a clever guy called <a title="Saurik is the man" href="http://www.saurik.com/" target="_blank">Saurik</a> has been able to create a program that does just that! The program is called Cycorder and can be installed direct from your iPhone upon Jailbreaking using the pre-installed program Cydia.</p>
<h4>Send Cheaper SMS Direct From Your iPhone</h4>
<p>I have been using a program called BiteSMS on my iPhone that allows you to send text messages direct from the same interface as your normal text method. Not only does it allow you to send them but it gives you them cheaper aswell. In some cases you can save 50% on every text message you send!</p>
<p>You buy credits and they automatically get added to to your phone and away you go. It tracks the amount you have sent too so you know when it is time to get more credits. They also support PayPal for credit purchases.</p>
<h4>MMS Can Now Be Sent From Your iPhone</h4>
<p>Another feature Apple have left out is Multi Media Messaging. The reason? Who knows?</p>
<p>The good news is that there is a program called <a title="Swiiiiiiiiiirly" href="http://www.swirlyspace.com/" target="_blank">SwirlyMMS</a> which allows you to send them direct from your iPhone. This application can be installed through Installer which automatically gets added when Jailbreaking your iPhone.</p>
<h4>iPoo with my iPhone</h4>
<p>It&#8217;s true, i literally poo with my iPhone. Every visit to the toilet for some heavy pushing involves loading up <a title="Poo time has never been better" href="http://labyrinth.codify.se/" target="_blank">Labyrinth</a>. <a title="Poo time has never been better" href="http://labyrinth.codify.se/" target="_blank">Labyrinth</a> is a maze game that uses a great amount of the iPhone&#8217;s accelerometer to allow you to tilt your phone in various directions which in turn guides a metal ball around a maze filled with Extreme Peril (holes to me and you). Trust me, if you have an iPhone and you also poo you need to combine the two.</p>
<p>If you have tried this method of poo &amp; play and struggled then it may be that i can help you so please do feel free to request assistance. Who knows? it could simply be how you are sitting!!</p>
<p>There are other benefits to Jailbreaking your iPhone such as being able to use your iPhone as your laptops connection to the internet but that is another post&#8217;s worth <img src='http://www.fatbasturd.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><strong>Please add some comments below this post and i hope this post helped some of you out.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.fatbasturd.co.uk/are-you-using-the-iphone-to-its-maximum-ability/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
