I am trying to build a program in Java, which would be able to output sound to different output lines on my sound card.
How is it possible to do in Java?
I'm not sure what background you have in working with sound (it might be bigger than mine) but what I think you have is a number of lines that you want to direct to a number of ports? http://download.oracle.com/javase/7/docs/api/javax/sound/sampled/package-summary.html - This might be an API for this, which I don't know much about (I've seen a program using something like that with VoIP). By the way if yr working on Windows, I believe that some information about your soundcard is stored in the registry, and you might have to update the registry from the program to gain access to it (not sure).
I hope I helped somehow :)
Check out the Java sound programmer's guide.
To get this to work I had to reconfigure my sound card to expose its ports as separate "outs"; otherwise the sound card would route the sound automatically depending on whether a pair of headphones were plugged in. (On Windows.)
来源:https://stackoverflow.com/questions/4963629/output-sound-to-multiple-channels-of-the-sound-card