将声音输出到声卡的多个通道
我正在尝试用 Java 构建一个程序,该程序能够将声音输出到声卡上的不同输出线。
Java 中怎么可能做到这一点?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我不确定您在处理声音方面有什么背景(它可能比我的大),但我认为您拥有的是要定向到多个端口的多条线路? http://download.oracle.com /javase/7/docs/api/javax/sound/sampled/package-summary.html - 这可能是一个 API,我对此不太了解(我见过一个程序使用了一些东西就像 VoIP 一样)。
顺便说一句,如果您在 Windows 上工作,我相信有关您的声卡的一些信息存储在注册表中,您可能必须从程序更新注册表才能访问它(不确定)。
我希望我能有所帮助:)
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 :)
查看 Java 声音程序员指南。
为了让它工作,我必须重新配置我的声卡,将其端口公开为单独的“输出”;否则,声卡将根据是否插入耳机自动路由声音。(在 Windows 上。)
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.)
您可以使用 Jack(Jack 音频连接套件)将声音路由到声卡。它有点复杂,它不适用于pulseaudio,但你可以让它工作。
JnaJack 通过 JNA 提供从 Java 到 Jack API 的接口。这真的很容易。
我在这里更详细地写了它 。
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.