Output sound to multiple channels of the sound card

江枫思渺然 提交于 2019-12-10 10:14:05

问题


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?


回答1:


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 :)




回答2:


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.)




回答3:


You can use Jack (Jack Audio Connection Kit) to route sound to your soundcard. It is a little complicated, it doesn't work with pulseaudio, but you can make it work.

JnaJack provides an interface from Java to the Jack API via JNA. It's really quite easy.

I wrote it up in more detail here.



来源:https://stackoverflow.com/questions/4963629/output-sound-to-multiple-channels-of-the-sound-card

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!