I've researched this a while, and determined any implementation using only java sound will not work with any reliability on multiple audio cards.
There are a few solutions though. Hopefully one of these helps you.
- Bite the bullet, write some C++ code to allow this functionality on different operating systems.
- Use Java Sound to capture audio from a virtual audio recorder adapter which loops back the system audio output.
- Create a loopback yourself using cables to feed a sound output port into a sound input port.
I recommend option 1 if you're developing this for a professional application as installation will be cleaner.
Go with option 2 if you've a short amount of time, and you expect to spend more time with your users, or your users are tech savvy.
Use option 3 if this is just a hobby, or some one-off project for a client.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…