I want to compare two audio file for example mp3 and wav. I use musicg to compare by fingerprints.
Wave record1 = new Wave(music1.toString());
Wave record2 = new Wave(music2.toString());
FingerprintSimilarity Similarity=record1.getFingerprintSimilarity(record2);
System.out.println(Similarity.getSimilarity());
musicg work only on wav so I convert mp3 to wav using JAVE
File temp = new File("temp.wav");
AudioAttributes audio = new AudioAttributes();
audio.setCodec("pcm_s16le");
audio.setBitRate(new Integer(128000));
audio.setChannels(new Integer(2));
audio.setSamplingRate(new Integer(44100));
EncodingAttributes attrs = new EncodingAttributes();
attrs.setFormat("wav");
attrs.setAudioAttributes(audio);
Encoder encoder = new Encoder();
encoder.encode(source, temp, attrs);
And now the problem, when I try compare two wav that I don't convert fingerprints work perfect but when I compare two different audio that I have to convert it's always return that both audio are same. Wave
create record1
the same spectrogram as record2
when I give to it two different audio.
Re: Comparing two supposedly identical tracks. Import them both into Audacity. Apply the "Invert" effect to one of the tracks. Select both tracks, then from the "Tracks menu > Mix and Render". If the tracks were identical, the result will be silence.
Go to file name in project then press control then select Compare File and select another file you wish to compare. Seperate window will open up showing differences by colour contrast. Welcome to SO !
File temp = new File("temp.wav");
both Waves are backed by the same file. :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With