Warning! This Library Is Deprecated!
Please Please don't use this library anymore. It was a good run, though. We had some laughs and it was easy for the iPhone to hear them.
This code has been deprecated in favor of Apple's built-in solution,
available since iOS 3.0:
Mobile Orchard published a nice tutorial.
Voice activation. Sounds cool, doesn’t it? And all the cool people are using it! Nintendo was on to something with their DS and its microphone: Wario's little games were no match for a little heavy breathing. With the iPhone, Smule is using it up a storm! And iSteam? Yes! These guys get it: people love doing stuff with their mouths! If there’s some kind of reward involved, well then, now you’re talking. Blowing out candles, kissing, outright yelling up a scene—these are the things of life, right?
Apple’s been a pretty good parent: keeping the sandbox clean, inviting us to use the cam’, the accelerwhometer, the GPS, all without making us do too many chores. C’mon, Apple, what do you have for the mic’? We wanna be cool kids!
What’s this? Audio Queue Services? Looks heavy. Lots in here. We just want to make a birthday cake app’ with a birthday cake and a bunch of trick candles. Maybe a library buddy that shushes you if you’re disrespectful around the ardent readers. Or a game with a swarm of bees and you get to puff smoke at them! Oh! And maybe something with our friend Phillip and you get to finally put him in his place. Take that, Phillip!
…So, in a line or two of code I can figure out where in the universe my
iPhone is and make sure I’m not holding it upside-down again, but I
can’t figure out how loud I’m talking? Well, the pleasantly-prefixed
SCListener may be
able to help.
SCListener is a simple little singleton with the bare bones
of iPhone microphone impedimenta. Getting the levels is a mere matter of
asking. Here’s a quick tour to get you started:
available on GitHub:
Now run along and throw your microphoney app’ into the ring. I’m just wrapping up a voice-activated flashlight, myself.
What? The flashlight vogue is over? Please. No one should ever get tired of flashlights.