capturing sound from a microphone in java

I am trying to capture sound from a microphone in java using this class http://www.jsresources.org/examples/SimpleAudioRecorder.java.html but first of all after recording it the file cannot be open using windows media player. It gets open by a VLC media player but it doesn't show the length of the audio file. it says 6:45 where the recorded sound has only 3 sec.