Java Sound per se cannot do such signal processing. But you can get the raw audio data in realtime from the microphones, process it yourself, then pass on to Sphinx4.
For accessing 2 microphones, query the available mixers in AudioSystem
, then choose the 2 mixers corresponding to the two microphones. From each mixer, get a SourceDataLine
and use it to capture the audio data.
You can process the data in real time, just make sure to use a suitable buffer size on the SourceDataLine
. A buffer size corresponding to 20ms should work on most systems.
Most hardware should work fine. There are "direct" SourceDataLine
's on Windows and Linux available. Your mileage on OS X will vary (depending onJava implementation).
www.jsresources.org has a number of programming examples.