title: Simple Wav comparison in Java
body: <p>I seem to be having a huge problem with something that seems very trivial. </p>
  
  <p><strong>Goal</strong>: Try to compare two Wav files and see if one(small file) is part of the other(large file).</p>
  
  <p><strong>Test</strong>: First, I took a 1 minute long piece of audio and exported 30 seconds of it to another file. I first tried to simply read in the byte[] data and look at it via logs, and there's absolutely no correlation even though they are both from the same source file? I then tried using libraries such as WavFile, and MusicG but I simply can't see any correlation between the two "fingerprints" or even the raw byte[] data that comes out of the two files?</p>
  
  <p><strong>Question</strong>: <strong><em>What is the simplest way to analyze these two Wav files for similarities?</em></strong> I have read around that if they're from the same source audio file they should be byte-byte identical. Thus take sample of each and they should be the same? That's NOT what is happening?</p>
  
  <p>Now I have already searched quite a bit for this problem but almost all answers are only 25-50% complete so I feel like I'm missing a huge segment somewhere.</p>
  
  <p>Thank you for any solutions that you may offer!</p>
  
  <p><strong>[EDIT]</strong> The source audio file is just a 1 minutes Wav file... which I extracted the first 30 seconds from to create the smaller file. Then I compare the short(30 seconds) to the long(1 minute). I exported both from Audacity at 1141kbps, 16bit, Wav. This was to try to avoid formatting issues... I Thought</p>
  
  <p>For code look at this UNANSWERED question: <a href="https://stackoverflow.com/questions/11604518/wav-comparison-same-file">Wav comparison, same file</a></p>