title: How to show MIC input visualization while audio recording Android
body: <p>i am looking for a way to show MIC input level voice strength.
  i Am using Android AudioRecord to record voice input.</p>
  
  <p>i am following this tutorial for reference</p>
  
  <p><a href="http://developer.samsung.com/android/technical-docs/Displaying-Sound-Volume-in-Real-Time-While-Recording" rel="nofollow">http://developer.samsung.com/android/technical-docs/Displaying-Sound-Volume-in-Real-Time-While-Recording</a></p>
  
  <p>i have implemented this also as</p>
  
  <pre><code>while (isRecording) {
              read = recorder.read(data, 0, bufferSize);
  
              if (AudioRecord.ERROR_INVALID_OPERATION != read) {
                  try {
                      os.write(data);                 
  
  
                       int amplitude = (data[0] &amp; 0xff) &lt;&lt; 8 | data[1];
                        amplitude = Math.abs(amplitude);
                        pbVisulaizer.setProgress(amplitude);
  
                  } catch (Exception e) {
                      e.printStackTrace();
                  }
              }
          }
  </code></pre>
  
  <p>but the amplitude changing is too frequent i am also looking for a maximum progress of progress bar according to recording quality. any suggestions.</p>