当其他应用程序播放音乐时 JLayer 中的音乐停止
我在 Clojure 中编写了几百行应用程序,它使用 JLayer Java 音频库,在后台运行 mp3。这工作正常,但一旦我在后台运行任何其他音乐、YouTube 等(我正在运行 Arch Linux),我的应用程序中的声音就会完全停止。
我浪费了过去的两个小时,尝试了很多方法来解决这个问题,所以任何建议都是值得赞赏的。
I have written a few hundred line app in Clojure that uses the JLayer Java library for audio where I run mp3s in the background. This works fine but as soon as I run any other music, YouTube etc in the background (I'm running Arch Linux) the sounds in my app completely stop.
I have wasted the last two hours and tried dozens of things to fix this so any advice is appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
既然您已经声明您使用的是 Linux,那么问题可能出在您的 ALSA 驱动程序上。
检查这篇文章是否 将帮助您解决问题。
Since you have stated that you're on Linux, the problem could be on your ALSA driver.
Check whether this article will help you fix the problem.
虽然我个人没有 Java 声音编码经验,但据我了解,在 Linux 声音服务和 Java 声音接口方面,存在一些不匹配的假设和/或不完整的 API。将两者混合在一起,你就会得到你所遇到的结果。在使用 FreeTTS 时,我遇到了类似的、可能相同的问题:
FreeTTS、Java、Linux:“线路不可用:格式为...”的解决方法
Though I have no personal coding experience with sound in Java, it is my understanding that there are some mismatched assumptions and/or incomplete APIs when it comes to Linux sound services and also with Java sound interfaces. Mix the two together and you get what you've run into. While playing with FreeTTS, I rand into similar, possibly same problem:
FreeTTS, Java, Linux: Workaround for "LINE UNAVAILABLE: Format is ..."
我以前曾遇到过 PulseAudio 和 Jack 争夺声卡控制权的问题。
你考虑过吗?你能检查一下这两个应用程序是否以这种方式互相争斗吗?
I've had problems with PulseAudio and Jack fighting for control of sound card before.
Have you considered that? Can you check whether the two apps are fighting each other in that way?