AL lib:(EE)UpdateDeviceParams:设置 44100hz 失败,取而代之的是 48000hz

AL lib: (EE) UpdateDeviceParams: Failed to set 44100hz, got 48000hz instead

我正在编码以使用 lwjgl 3 在 java 中管理 OpenAL,当我使用此行创建 ALContext 时:

ALContext alContext = ALContext.create();

当我执行控制台时打印出这条建议

AL lib: (EE) UpdateDeviceParams: Failed to set 44100hz, got 48000hz instead

知道哪里出了问题吗?

顺便说一句,使用 lwjgl 3 编码变得非常困难,我唯一找到某种指南的地方是这里 lwjgl github

在我的 ASUS 台式机上,我的 Realtek HD Audio Manager 将默认音频格式设置为 24Bits 44800 Hz,因此我打开的 AL 应用程序无法请求 44100 Hz 设备。将该默认格式更改为 44100 将有助于解决问题。

我希望它能有所帮助,因为我确实花了很多时间才弄明白!

在我的 Linux 机器上(Ubuntu 服务器 18.04),我也看到了这样的错误:

AL lib: (EE) UpdateDeviceParams: Failed to set 44100hz, got 48000hz instead

我可以通过修改名为 /etc/openal/alsoft.conf

的文件来消除这个错误

在这个文件中 [general] 部分下有这个条目:

## frequency:
#  Sets the output frequency. If left unspecified it will try to detect a
#  default from the system, otherwise it will default to 44100.
#frequency =

我将 #frequency = line 更改为:frequency = 48000 现在我不再收到此错误。