Comparing audio files in c/c++

Post questions regarding programming in C/C++ in Linux/Unix.

Moderators: Darobat, RecursiveS, Dante Shamest, Bugdude, Wizard

Comparing audio files in c/c++

Postby daitkarsachin » Wed Apr 06, 2011 1:43 am

Hi all,
I am new to this forum and this is my first post. Actually i am doing my college project which needs comparing two audio files( created by my Java program in *.wav format) using c/c++.

I did lot of google search but not able to find out perfect solutions. Is there any way to compare audio files using c/c++ and get percentage of their equality ?

Thanks
Sachin
daitkarsachin
 
Posts: 2
Joined: Wed Apr 06, 2011 12:06 am

Re: Comparing audio files in c/c++

Postby ventsyv » Wed Apr 06, 2011 1:51 pm

Not really. You can just compare the binary data but a better approach is to "load" both files in memory and compare the sound curves.
User avatar
ventsyv
 
Posts: 2810
Joined: Mon Sep 22, 2003 5:25 pm
Location: MD USA

Re: Comparing audio files in c/c++

Postby daitkarsachin » Thu Apr 07, 2011 12:22 am

Thank you ventsyv for your valuable reply.

I will findout how to get sound curves for given audio files. Basically i am interested in getting equality percentage of two audio files.

Thanks & Regards
Sachin
daitkarsachin
 
Posts: 2
Joined: Wed Apr 06, 2011 12:06 am

Re: Comparing audio files in c/c++

Postby ventsyv » Thu Apr 07, 2011 11:16 am

Wave files sample the "sound" at given frequency and record the data (pitch, frequency etc). The more often you sample, the better the quality. You have check the wav file format to see what each of those "snapshots" contains, then, start comparing the first "snapshot" of file 1 to first "snapshot" of file 2 and so forth. Get the % difference between samples and average. Something like that should do the trick.
User avatar
ventsyv
 
Posts: 2810
Joined: Mon Sep 22, 2003 5:25 pm
Location: MD USA


Return to Unix/Linux

Who is online

Users browsing this forum: No registered users and 1 guest