views:

192

answers:

0

I am trying to analyze the microphone input through Java so you can graphically display where the sound is coming from around the computer. I have audio capture code working well (from: http://www.developer.com/java/other/article.php/1565671#Complete%20Program%20Listings) and have tried to implement:

(FloatControl) targetDataLine.getControl(FloatControl.Type.BALANCE);

But that is not supported and I'm not sure it's the right way to read distinct stereo channels either. I'd appreciate some help doing the following:

  1. While recording from device microphone..
  2. Continuously display: System.out.println(MicrophoneLeftPeakValue); System.out.println(MicrophoneRightPeakValue);

The values "MicrophoneLeftPeakValue and MicrophoneRightPeakValue, of course, would be set based on the distinct right and left channel activity of the audio coming in from the microphone.

Any examples would be appreciated, or even confirmation that this is possible.