3

I'm looking for a relatively simple way (some examples or libraries with a good API maybe?) to compare two sounds with Java (with tolerance of course). The sources are some sound files with hand-clap noises. The sound I want to compare them with is a live recording via a microphone. The microphone starts a 3 second recording every time it recognizes a louder sound and compares it with the source files.

Purpose: I'm running a Raspberry Pi with a microphone and if I clap my hands I want to toggle the lights in my apartment.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
user2655665
  • 247
  • 1
  • 4
  • 11
  • possible duplicate of [Detect silence when recording](http://stackoverflow.com/questions/5800649/detect-silence-when-recording) – Andrew Thompson Nov 29 '13 at 17:07
  • You could do a FFT and look for a signature set of frequencies. Most likely you want to find the minimum number frequencies which detect a clap correctly to minimise CPU usage. – Peter Lawrey Nov 29 '13 at 17:10

1 Answers1

0

You could profile the sound you produce when you clap your hands (like frequencies, intensity in each frequency, and so on) and then filter the recorded sound to see if it is similar.

Think of it like a DTMF filter from phones, but (probably) with more than two frequencies happening at the same time.

woliveirajr
  • 9,433
  • 1
  • 39
  • 49