title: Process microphone data in real time in java
body: <p>I'm using this instructions for get a signal audio of a microphone:</p>
  
  <pre><code>while(!stopCapture){
  
              int cnt = targetDataLine.read(tempBuffer, 0, tempBuffer.length);
              if(cnt &gt; 0){
                byteArrayOutputStream.write(tempBuffer, 0, cnt);            
              }
            }
            byteArrayOutputStream.close();
            byte audio[] = byteArrayOutputStream.toByteArray();
            InputStream input = new ByteArrayInputStream(audio);
            AudioInputStream ais = new AudioInputStream(input, audioFormat, audio.length / audioFormat.getFrameSize());
  </code></pre>
  
  <p>But these instructions wait the entire signal before elaborate it.
  I need elaborate it in real time...is possible?</p>
  
  <p>How can i do it?</p>
  
  <p>thanks</p>