WinHue icon indicating copy to clipboard operation
WinHue copied to clipboard

Clap on / Clap off

Open trevor-clarke opened this issue 9 years ago • 9 comments

Just a simple clap on clap off feature ... would be helpful if you werent at your keyboard for whatever reason.

trevor-clarke avatar Nov 09 '16 02:11 trevor-clarke

Hmmm i have to look into this because I have no clue how to implement this...

Hyrules avatar Nov 09 '16 21:11 Hyrules

I have found a way to do this. I will try to implement it in the next version as a tool.

Hyrules avatar Nov 10 '16 13:11 Hyrules

I played around with this and it's not as easy at is seems. I might not have it in the next version. I will try but no promises. Interfacing the microphone is easy. Analyzing the samples and finding the clap is another thing. I have a piece of code that does it but it's rather weak. One clap can end in 8 or 9 trigger of a clap depending on the sample. I'm not an audio expert.

Hyrules avatar Nov 11 '16 23:11 Hyrules

Sounds good!

trevor-clarke avatar Nov 12 '16 18:11 trevor-clarke

@Hyrules Why not just make it so you can only toggle it once every few seconds? That would solve the multiple triggering problem.

trevor-clarke avatar Nov 14 '16 02:11 trevor-clarke

you can use this method: https://github.com/tom-s/clap-detector/blob/master/index.js its using the silence detection of SOX, see the manual: http://sox.sourceforge.net/sox.html silence [−l] above-periods [duration threshold[d|%] [below-periods duration threshold[d|%]] Removes silence from the beginning, middle, or end of the audio. ‘Silence’ is determined by a specified threshold.

pleg avatar Oct 08 '17 18:10 pleg

Both links gives a 404...

Hyrules avatar Oct 08 '17 19:10 Hyrules

links fixed

pleg avatar Oct 08 '17 19:10 pleg

Maybe you can use the Microsoft Speech API for this? (Just a suggestion, it might not have anything to do with it)

riahc3 avatar Feb 10 '19 23:02 riahc3