Compare two sounds in Android
Hi guys to i am going to share you code for comparing to sounds without using Google Voice.
There is very fine library which allows developers to extract audio features and operate audio data like reading, cutting and trimming easily from an inputstream. It also provides tools for digital signal processing, renders the wavform or spectrogram for research and development purpose.
https://code.google.com/p/musicg/
and here is code to compare wave two sounds
// create a wave objectWave wave = new Wave(path1);Wave wave1 = new Wave(path2);FingerprintSimilarity fingerprintSimilarity = wave .getFingerprintSimilarity(wave1);float score = fingerprintSimilarity.getScore();float similarity = fingerprintSimilarity.getSimilarity();Log.d("Similarsound", "Score : " + score + "\n Similarity : "+ similarity);
I used same code, i have two file wave in res/raw
ReplyDeleteBut dosnt work it display some error: no such file or directory
InputStream in1=getResources().openRawResource(R.raw.bad_battery);
DeleteWave wave = new Wave(in1);
//don't forget that the extension of the file must be in .wav