Thursday, August 5, 2010

New App: Needle In A Table View



You know the old saying "It's like trying to find a needle in a haystack"? Wouldn't it be cool if that was somehow turned into an iPhone app? Well, IT IS!

The SDK didn't have any haystacks, so we've used a table view instead.

NIATV (as we impatient people call it) might seem easy at first, but the more needles you find the more hay you have to search through.

And as a bonus, NIATV is dressed down with a simple 8-bit look.

Sunday, June 6, 2010

Quick & Easy iPhone Audio

I spent a lot of time trying to find out how to record audio on the iPhone for 'SoundPad!' only to find that it was actually really easy. So, I'm going to show you guys how to record and play really quickly.

Firstly, make sure you import the 'AVFoundation' framework into your project.
Also, add '#import ' and '#import ' to the top of your file.

In your header file, define an NSMutableDictionary for your record settings.

Now, in the appropriate method, insert the following code:

self.recordSettings = [NSMutableDictionary dictionary];
[recordSettings setValue:[NSNumber numberWithInt:kAudioFormatAppleIMA4]
forKey:AVFormatIDKey];
[recordSettings setValue:[NSNumber numberWithFloat:44100.0] forKey:AVSampleRateKey];
[recordSettings setValue:[NSNumber numberWithInt:1] forKey:AVNumberOfChannelsKey];

NSError *error = nil;
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord
error:&error];
[[AVAudioSession sharedInstance] setActive:YES error:&error];

This is not incredibly complex, but too complex for this post. Explanations of this are easily found in Apple's documentation.

Place the following code in a 'record' method:

NSError *error = nil;
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask, YES);
NSString *filePath = [paths objectAtIndex:0] stringByAppendingPathComponent: [NSString
stringWithFormat: @"Recording.caf",]];
NSURL *fileUrl = [NSURL fileURLWithPath:filePath];
AVAudioRecorder *recorder = [[AVAudioRecorder alloc] initWithContentsOfURL:fileUrl
error:&error];
[recorder record];

You can also call:

[player setDelegate:delegate];

To allow 'delegate' to respond to certain events (e.g: When the recorder stops recording).

Place the following code in a 'play' method:

NSError *error = nil;
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask, YES);
NSString *filePath = [paths objectAtIndex:0] stringByAppendingPathComponent: [NSString
stringWithFormat: @"Recording.caf",]];
NSURL *fileUrl = [NSURL fileURLWithPath:filePath];
AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithContentsOfURL:fileUrl
error:&error];
[player play];

AVAudioPlayer also responds to 'setDelegate:', and as extra options, you can call:

[player setVolume:num]; //Sets players volume to 'num.' Default value is 1.
[player setNumberOfLoops:num] //Makes player loop 'num' times. Default value is 0. A
//negative value will make player loop for infinity.

Link the 'play' and 'record' methods up to a couple of IBActions and you've got yourself a pretty cool recorder. A lot of this is pretty self explanatory, and the stuff that isn't is easily found in Apple's Docs. There's a little more to this class to do with metering and stuff, but all the core funcionality is shown here.

Well, I hope you liked this quick tutorial and don't forget to come back soon. Bye!

P.S. For those who want to know straight where to go to adjust format of audio and stuff like that, that's what 'recordSettings' is.

P.P.S. I've just seen the preview of this post and I apologise for the poor formatting. If you guys find it IMPOSSIBLE to decode, tell me and I'll upload a simple UIViewController class that uses the above technique.

href="http://digg.com/submit?url=http%3A//dylanelliottiphone.blogspot.com/2010/06/quick-easy-iphone-audio.html">

Saturday, May 15, 2010

UPDATE! UPDATE! UPDATE!!!

Yes, it's that time already; SoundPad! and SoundPad! Lite are being updated. Nothing HUUUUUUUGE, just some housekeeping and stuff like that. What's that you say? Dylan, why would you tell us about something that's not even cool? Well, it is cool... kind of. I've also include a couple of small easter eggs. How do you find them? Do what every iPhone user does; TAP! Tap the pads, play wonderful sounds, and stop only when you can tap no more.

And, as a special extra super fun bonus, SoundPad! (the full version) will be free for a limited time after the update comes out. YAAAAAAAAAAAY!

Thursday, May 13, 2010

SoundPad! Lite is also GOOOOO!!!!!

That's right! Now all you cheap skates can experience the soundpady goodness! You can record! You can play! You can TAAAAAPP! So, like I always say, enjoy.

iTunes Link: http://itunes.apple.com/us/app/soundpad-lite/id371359476?mt=8

Saturday, May 8, 2010

SoundPad is GO!

You heard it folks, SoundPad is out and it's now the number one app in every app store around the world. Just kidding! No, it's not, it's only sold 26 copies, but with your help, it could be!
Also, SoundPad Lite was submitted two days ago, so that should be out soon. Stay tuned!

App Store Link: http://itunes.apple.com/au/app/soundpad/id370071058?mt=8

Saturday, May 1, 2010

SoundPad Lite is also coming!

Want SoundPad?
Got an iPhone?
Got no more money?

Then SoundPad Lite may be the thing for you!

SoundPad Lite is just like the regular SoundPad, but with only one pad!

Record and play single sounds like the Law and Order "DUN-DUN!" noise or Nelson Muntz's "Ha-ha!" call.

And! If you want to purchase the FULL version of SoundPad, a banner has been placed conveniently, at the top of the screen. Tap it to be taken to the App Store with Flash like speed! Then you can unleash maximum sound power!

Tuesday, April 27, 2010

SoundPad is coming!

Simple, Sexy, Sampling.

Introducing SoundPad; the next generation in mobile sampling technology. SoundPad allows you to record sounds to 12 buttons and then play them with latency that's out of this world!

Example uses:
-Bust mad phat beats anytime, anywhere.
-Spice up your life by adding sound effects to everything.
-Whatever else you can think of!

SoundPad requires only 2 simple steps:
1. Record
2. Play

That's it! No complicated technobuzzery to be seen or heard.

SoundPad will be dropping soon (around two weeks). So stay tuned!

Edit: SoundPad! is live! Here's the iTunes link: http://itunes.apple.com/au/app/soundpad/id370071058?mt=8