DSPRelated.com
Forums

Comparing audio (wav) files

Started by aten October 4, 2003
I'm writing a program that has a section that requires the comparison
of two wav files. The sound files will be really small.  I'm
interested in sounds like a hand clap, or wood hitting wood, or wood
striking tin. Little sounds. My section of the program would read two
sound files into memory, apply some sonic algorithm on both. The
output of that algorithm should be stored in some data structure. Then
a comparison of the output would be made and would return some value
to determine how closely one sound resembles the other, or at least if they
matched.  This program can be written in Java or C++. Are there in
classes available that will allow me to implement what's describe
above easily?  I'm more concerned about the algorithm to extract
frequency data, or whatever data is needed from the wav file to
compare it to another. I'm trying to avoid re-inventing the wheel
here, so if there is some package available that allows for this I
would greatly appreciate any info on where to get it..
aten wrote:
> > I'm writing a program that has a section that requires the comparison > of two wav files. The sound files will be really small. I'm > interested in sounds like a hand clap, or wood hitting wood, or wood > striking tin. Little sounds. My section of the program would read two > sound files into memory, apply some sonic algorithm on both. The > output of that algorithm should be stored in some data structure. Then > a comparison of the output would be made and would return some value > to determine how closely one sound resembles the other, or at least if they > matched. This program can be written in Java or C++. Are there in > classes available that will allow me to implement what's describe > above easily? I'm more concerned about the algorithm to extract > frequency data, or whatever data is needed from the wav file to > compare it to another. I'm trying to avoid re-inventing the wheel > here, so if there is some package available that allows for this I > would greatly appreciate any info on where to get it..
For reading sound files in C or C++ have a look at libsndfile: http://www.zip.com.au/~erikd/libsndfile/ Erik -- +-----------------------------------------------------------+ Erik de Castro Lopo nospam@mega-nerd.com (Yes it's valid) +-----------------------------------------------------------+ "Minimum-phase filters distort the phase response and therefor the shapes of edges, but they are prompt. Linear-phase filters retain pulse shapes, but make you wait to see them." -- Jerry Avins in comp.dsp
look at http://xenia.media.mit.edu/~mkc/thesis/

it talks about signal representation methods capable of characterizing 
the everyday sounds like what you describe eg. footsteps, hammering, 
smashing and spilling. etc.

good luck
sdj

aten wrote:
> I'm writing a program that has a section that requires the comparison > of two wav files. The sound files will be really small. I'm > interested in sounds like a hand clap, or wood hitting wood, or wood > striking tin. Little sounds. My section of the program would read two > sound files into memory, apply some sonic algorithm on both. The > output of that algorithm should be stored in some data structure. Then > a comparison of the output would be made and would return some value > to determine how closely one sound resembles the other, or at least if they > matched. This program can be written in Java or C++. Are there in > classes available that will allow me to implement what's describe > above easily? I'm more concerned about the algorithm to extract > frequency data, or whatever data is needed from the wav file to > compare it to another. I'm trying to avoid re-inventing the wheel > here, so if there is some package available that allows for this I > would greatly appreciate any info on where to get it..
You could get some ideas from BS 1387 objective quality measurements:

Look for eaqual project on the net or

https://sourceforge.net/projects/peaqb/

Good luck !

___________________________

"aten" <atentaten@my-deja.com> a &#4294967295;crit dans le message de news:
b14a64c0.0310041019.492f3394@posting.google.com...
> I'm writing a program that has a section that requires the comparison > of two wav files. The sound files will be really small. I'm > interested in sounds like a hand clap, or wood hitting wood, or wood > striking tin. Little sounds. My section of the program would read two > sound files into memory, apply some sonic algorithm on both. The > output of that algorithm should be stored in some data structure. Then > a comparison of the output would be made and would return some value > to determine how closely one sound resembles the other, or at least if
they
> matched. This program can be written in Java or C++. Are there in > classes available that will allow me to implement what's describe > above easily? I'm more concerned about the algorithm to extract > frequency data, or whatever data is needed from the wav file to > compare it to another. I'm trying to avoid re-inventing the wheel > here, so if there is some package available that allows for this I > would greatly appreciate any info on where to get it..