PDA

View Full Version : WANTED: 'Clapper' type software! (Coding challenge!)




peanutismint
Nov 15, 2007, 08:28 AM
NOTE: This is nothing to do with 'movie clappers'.

I've had one of those crazy ideas (yet again) for a piece of software but have no idea how to implement it.

The premise is simple. I finish watching a movie on my Macbook or iMac from my bed late at night, but my Apple Remote is way out of reach, and I'm a lazy bones. Not to worry, I have just enough energy left to clap, which my Mac's built-in microphone hears, and proceeds to stand-by/shut down my system.

I'm thinking a user-definable number/pattern of claps, with the ability to configure the noise threshold to not be set off by other sounds, as well as perhaps an option to define what action to take when the claps are detected. This could even possibly be broadened to include 'magic phrases' as I believe already exist in Apple's voice-recognition software.

This idea, whilst just another great thing that most modern Macs should be capable of, is born out of both gimmicky fun, and also the fact that, watching movies through VLC, my iRemote's 'hold play to sleep system' function doesn't work for some reason.... Another reason for this is that, when 'sleeped' to standby, my Macbook always seems to wake up after an undisclosed amount of time. At least this way I could shut down my system from bed, no longer 'sleeping' it only to have it wake up and make that disk-initialisey noise about 25 minutes later and wake me up just as I'm falling asleep!


'Clap off - with iClapper' Slogan writes itself!


Any clever coders fancy giving this a try?! OR does something like this already exist?



iShater
Nov 15, 2007, 10:10 AM
You should be able to use Speakable Items in OSX to make it exit the application, and I believe it has a shutdown feature.

peanutismint
Nov 15, 2007, 10:46 AM
Yeah, I tried that; works quite well, however there's no 'clapping' function that I believe could be quite useful! :-)

Any ideas?

MongoTheGeek
Nov 15, 2007, 02:11 PM
Yeah, I tried that; works quite well, however there's no 'clapping' function that I believe could be quite useful! :-)

Any ideas?

Its not to hard. You just watch the audio levels and any time you have a spike in input volume (1 ms of maxed volume with negligible sound on either side) wait 200-600ms for another spike (throw out less than 200ms because its far to fast to clap). Not exactly trivial, but not entirely complicated either.

Just get a clapper though.

Consultant
Nov 15, 2007, 03:43 PM
What about designing a software that claps when you think about clapping? =p

Or just go buy another remote and put it next to your bed.

peanutismint
Nov 16, 2007, 08:00 PM
Its not to hard. You just watch the audio levels and any time you have a spike in input volume (1 ms of maxed volume with negligible sound on either side) wait 200-600ms for another spike (throw out less than 200ms because its far to fast to clap). Not exactly trivial, but not entirely complicated either.

Just get a clapper though.

Hahah, that all sounds perfect, except that I don't know the first thing about coding, hence why I'm hoping somebody else will go ahead and do all the hard work for me!! :-D

What about designing a software that claps when you think about clapping? =p

Or just go buy another remote and put it next to your bed.

That's iClapper V2.0 - then iClapper V3.0, it becomes self-aware.... No seriously, it's not really the remote being far away that's the problem, it's that the remote can't sleep the system whilst VLC is running in full screen, and neither can it 'shut down' the system, to prevent it from being woken up by whatever it is that's doing it...

mvd7793
Feb 11, 2008, 07:24 PM
Sorry about reviving topic, but...

Click here! (http://pclapper.com)

Go pc's! Go pc's! Go pc's!

iTeen
Feb 11, 2008, 11:22 PM
Sorry about reviving topic, but...

Click here! (http://pclapper.com)

Go pc's! Go pc's! Go pc's!

sry for not thinking before i post.
its is a MAC forum so unless you want to stir up something i would keep the useless comments out.
Thanks!

peanutismint
Feb 12, 2008, 12:39 AM
Sorry about reviving topic, but...

Click here! (http://pclapper.com)

Go pc's! Go pc's! Go pc's!

Lol... I can't believe I ever switched to Mac. This single app has changed the way I think about modern computing...it's like the rug has been pulled out from under my electronic world...I'm so confused..... ;)

Lol thanks mdv7793, maybe I can use it for my BootCamp partition?! :D

kainjow
Feb 12, 2008, 05:31 AM
Sorry about reviving topic, but...

Click here! (http://pclapper.com)

Go pc's! Go pc's! Go pc's!

That does us no good, unless you open source it ;)

mvd7793
Feb 12, 2008, 06:03 AM
IT isn't my app, and I was thinking if you wanted to, you could boot camp it.

peanutismint
Feb 12, 2008, 07:21 AM
Thinks: 'note to self - never say 'PC' on MacRumors forums' :-)

Apparently it's a swear!! Hahah well *I* thank you for your suggestion! If only to install on my friends PCs while they're not looking and then clap things at random! :D

PCapone
Feb 12, 2008, 08:31 AM
What's up guys? I'm the guy that made the pclapper. Just wanted to ask if anyone was up to the task of "macifying" it? It is pretty windows specific in that it references the winmm.dll for microphone input. If you guys can get the mic input and hook it up to my clap detection (extremely simple, just looks for a difference of more than X in the mic and waits y milliseconds before listening for another spike), I'ld be happy to put the mac version up on the site. I'm not sure about open sourcing yet, but I would give the code out on the honor system to someone :)

richifie
Sep 5, 2012, 07:32 AM
But more recently, the Internet is full of small apps for this purpose.

MacTheClapperhttp://www.paranoid-media.de/blog/?p=36.
Allows you to run your own AppleScripts when it detects a double clap.

It's my favourite so far and the most useful because you could use it to sleep the computer, shut down, open and close applications, or even enter text.

~Rich

peanutismint
Sep 5, 2012, 10:26 AM
But more recently, the Internet is full of small apps for this purpose.

MacTheClapperhttp://www.paranoid-media.de/blog/?p=36.
Allows you to run your own AppleScripts when it detects a double clap.

It's my favourite so far and the most useful because you could use it to sleep the computer, shut down, open and close applications, or even enter text.

~Rich

Wow, great find Rich! Installing now....