title: How to calculate the decibel of audio signal and record the audio in java?
body: <pre><code>public TargetDataLine targetDataLine;
  private static AudioFormat getAudioFormat() 
  {
          return new AudioFormat(16000, 16, 2, true, false);
  }
  AudioFormat a = getAudioFormat();
  DataLine.Info info = new DataLine.Info(TargetDataLine.class, a);
  targetDataLine = (TargetDataLine) AudioSystem.getLine(info);
  targetDataLine.open(a);
  targetDataLine.start();
  AudioInputStream ais = new AudioInputStream(targetDataLine); 
  AudioSystem.write(ais, AudioFileFormat.Type.WAVE, new File("record.wav"));
  </code></pre>
  
  <ol>
  <li>How can i calculate the decibel of audio at the same time?</li>
  <li>How can i calculate the decibel of existing wav file?</li>
  </ol>