Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Matching two audio files

I want to record a dog bark, save the file and compare with several files containing different types of bark (warning bark, crying bark, etc..).

How could i do that comparison in order to get a match? What is the process to follow in this type of apps?

Thank you for the tips.

like image 337
pindleskin Avatar asked Jul 28 '12 22:07

pindleskin


2 Answers

There is no simple answer to your problem. However, for starters, you might look into how audio fingerprinting works. This paper is an excellent start written by the creators of shazam:

http://www.ee.columbia.edu/~dpwe/papers/Wang03-shazam.pdf

I'm not sure how well that approach would work for dog barking, but there are some concepts there that might prove useful.

Another thing to look into is how the FFT works. Here's a tutorial with code that I wrote for pitch tracking, which is one way to use the FFT. You are looking more at how the tone and pitch interact with the formant structure of a given dog. So parameters you'll want to derive might include fundamental pitch (which, alone, might be enough to distinguish whining from other kinds of barks), and ratio of fundamental pitch to higher harmonics, which would help identify how agressive the bark is (I'm guessing a bit here):

http://blog.bjornroche.com/2012/07/frequency-detection-using-fft-aka-pitch.html

Finally, you might want to do some research into basic speech recognition and speech processing, as there will be some overlap. Wikipedia will probably be enough to get you started.

EDIT: oh, also, once you've identified some parameters to use for comparison, you'll need a way to compare your multiple parameters to your database of sounds with multiple parameters. I don't think the techniques in the shazam article will work. One thing you could try is Logistic Regression. There are other options, but this is probably the simplest.

like image 156
Bjorn Roche Avatar answered Sep 29 '22 20:09

Bjorn Roche


I'd check out Google's open source lib musicg API: http://code.google.com/p/musicg/

It's Java so it works in Android and it gives similarity metrics for two audio files.

But it's compatible only with .wav files.

like image 32
Karim Varela Avatar answered Sep 29 '22 19:09

Karim Varela