public void next(int frames,boolean broadcast) throws IOException {
  if (mInputStream != null) {
    byte[] buffer=new byte[mBytesPerFrame * frames];
    int samplesRead=mInputStream.read(buffer);
    mFrameCounter+=samplesRead;
    broadcast(mFrameCounter);
    if (broadcast && mListener != null) {
      if (samplesRead < buffer.length) {
        if (samplesRead == -1) {
          throw new IOException("End of recording");
        }
        buffer=Arrays.copyOf(buffer,samplesRead);
      }
      float[] samples=ConversionUtils.convertFromSigned16BitSamples(buffer);
      mListener.receive(new RealBuffer(samples));
    }
  }
}

public void next ( int frames , boolean broadcast ) throws IOException { if ( mInputStream != null ) { byte [ ] buffer = new byte [ mBytesPerFrame * frames ] ; int samplesRead = mInputStream . read ( buffer ) ; mFrameCounter += samplesRead ; broadcast ( mFrameCounter ) ; if ( broadcast && mListener != null ) { if ( samplesRead < buffer . length ) { if ( samplesRead == - 1 ) { throw new IOException ( "End of recording" ) ; } buffer = Arrays . copyOf ( buffer , samplesRead ) ; } float [ ] samples = ConversionUtils . convertFromSigned16BitSamples ( buffer ) ; mListener . receive ( new RealBuffer ( samples ) ) ; } } }
reads the number of frames and optionally sends the buffer to the listener
