public byte[] analyzeWavData(InputStream i){
  try {
    int headSize=44, metaDataSize=48;
    byte[] data=IOUtils.toByteArray(i);
    if (data.length < headSize) {
      throw new IOException("Wrong Wav header");
    }
    if (this.sampleRate == 0 && data.length > 28) {
      this.sampleRate=readInt(data,24);
    }
    int destPos=headSize + metaDataSize;
    int rawLength=data.length - destPos;
    byte[] d=new byte[rawLength];
    System.arraycopy(data,destPos,d,0,rawLength);
    return d;
  }
 catch (  IOException e) {
    Log.e(TAG,"Error while formatting header");
  }
  return new byte[0];
}

public byte [ ] analyzeWavData ( InputStream i ) { try { int headSize = 44 , metaDataSize = 48 ; byte [ ] data = IOUtils . toByteArray ( i ) ; if ( data . length < headSize ) { throw new IOException ( "Wrong Wav header" ) ; } if ( this . sampleRate == 0 && data . length > 28 ) { this . sampleRate = readInt ( data , 24 ) ; } int destPos = headSize + metaDataSize ; int rawLength = data . length - destPos ; byte [ ] d = new byte [ rawLength ] ; System . arraycopy ( data , destPos , d , 0 , rawLength ) ; return d ; } catch ( IOException e ) { Log . e ( TAG , "Error while formatting header" ) ; } return new byte [ 0 ] ; }
analyze sample rate and return the pcm data
