java - 为什么无法重新打开 TargetDataLine?

标签 java audio

如果我在关闭并停止 TargetDataLine 后尝试使用另一个音频输入设备再次打开它,那么它只会产生噪音而不是信号。为什么?

这是我正在谈论的代码:https://gist.github.com/flextexmex/e2fad97b7e1af93d6c98

最佳答案

这可能不相关,但有一个关于 TargetDataLine 的常见问题解答。 http://www.jsresources.org/faq_audio.html#multiple_tdl

Why is in not possible to open more than one TargetDataLine at the same time? Well, because it's a bug. The above is true for the Sun JDK up to version >1.4.2 on Solaris and Windows, and up to 1.4.1 on Linux. Beginning with version >1.5.0 for Solaris and Windows and version 1.4.2 for Linux there are the new >"Direct Audio Device" mixer that don't have this limitation.

更新到 1.50 是否解决了您的问题?

关于java - 为什么无法重新打开 TargetDataLine?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26829443/

相关文章:

java - Jitsi - 在通话期间播放 WAV 文件 - 如果可能,与音频混合

javascript - 不同按钮上的音频播放/暂停单击 Jquery

java - 数组中变量之间的距离

java - 将 Spring 应用程序(JAR)打包到 Spring Boot 应用程序中

matlab - MATLAB中的最佳提取

html - (webrtc)setRemoteDescription对启动器不起作用

iphone - 最适合 iPhone OpenGL-ES 游戏的声音/音频框架是什么?

java - 使用 java 套接字通过网络发送屏幕截图

java - 我如何要求用户在第一次启动时选择一个设置?

java - 无法在模拟器上从 developer.android.com 启动蓝牙聊天示例应用程序