If OpenAL can do it, then so can JOAL. While I’ve never used this feature myself, there are OpenAL functions which look like they’re related to capturing the sound going to the device. Whether it’s the raw waveform or the post-processed data, I’m not sure. The commands are:
- alcCaptureOpenDevice
- alcCaptureCloseDevice
- alcCaptureStart
- alcCaptureStop
- alcCaptureSamples
There’s a bit of info in the OpenAL 1.1 spec document about how to use it. To summarize:
- create a capture buffer using alcCaptureOpenDevice (here you can specify a format and device)
- start audio capture using alcCaptureStart
- when the app thinks there’s enough data in the buffer (you can query it), get it using alcCaptureSamples
- (you can pause capturing as an optimization, using alcCaptureStop)
- disconnect from the capture device with alcCaptureCloseDevice