OpenAL 和 Vista:设备始终是“通用软件”
我正在编写游戏的音频部分,并且正在使用 OpenAL。我想使用一些扩展,但测试总是失败:
TRACE: AudioManager - Sound device: 'Generic Software'
TRACE: AudioManager - Enabling OpenAL extensions...
TRACE: AudioManager - Compressor support: NO
TRACE: AudioManager - Reverb support: YES
TRACE: AudioManager - Chorus support: NO
TRACE: AudioManager - Distortion support: NO
TRACE: AudioManager - Echo support: NO
TRACE: AudioManager - Flanger support: NO
TRACE: AudioManager - Frequency shifter support: NO
TRACE: AudioManager - Vocal morpher support: NO
TRACE: AudioManager - Pitch shifter support: NO
TRACE: AudioManager - Ring modulator support: NO
TRACE: AudioManager - AutoWAH support: NO
TRACE: AudioManager - Equalizer support: NO
TRACE: AudioManager - EAX Reverb support: YES
这是因为我只得到了通用软件驱动程序,它只支持混响和EAX混响。不仅在我的机器上,在其他机器上也是如此。
以下是我检测 OpenAL 要使用的驱动程序的方法:
ALchar device[256];
ZeroMemory(device, 256);
if (alcIsExtensionPresent(NULL, "ALC_ENUMERATE_ALL_EXT"))
{
strcpy_s(device, 256, alcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER));
}
else if (alcIsExtensionPresent(NULL, "ALC_ENUMERATION_EXT"))
{
strcpy_s(device, 256, alcGetString(NULL, ALC_DEVICE_SPECIFIER));
}
TRACE_AUDIOMANAGER("Sound device: '%s'", device);
g_System = alcOpenDevice(device);
根据规范,设备说明符应返回两个驱动程序:“通用硬件”和“通用软件”,并以 NULL 终止符分隔。
我的声卡是“NVIDIA High Definition Audio”设备,它使用 nvhda32v.sys 驱动程序(版本 1.0.0.63,于 2009 年 11 月 11 日更新)。
为什么 OpenAL 没有检测到我的硬件?
I'm writing the audio part of a game, and I'm using OpenAL. I want to use some extensions, but the tests always fail:
TRACE: AudioManager - Sound device: 'Generic Software'
TRACE: AudioManager - Enabling OpenAL extensions...
TRACE: AudioManager - Compressor support: NO
TRACE: AudioManager - Reverb support: YES
TRACE: AudioManager - Chorus support: NO
TRACE: AudioManager - Distortion support: NO
TRACE: AudioManager - Echo support: NO
TRACE: AudioManager - Flanger support: NO
TRACE: AudioManager - Frequency shifter support: NO
TRACE: AudioManager - Vocal morpher support: NO
TRACE: AudioManager - Pitch shifter support: NO
TRACE: AudioManager - Ring modulator support: NO
TRACE: AudioManager - AutoWAH support: NO
TRACE: AudioManager - Equalizer support: NO
TRACE: AudioManager - EAX Reverb support: YES
This is because I only get the Generic Software driver, which only supports reverb and EAX reverb. And not just on my machine, but others as well.
Here's how I detect the drivers for OpenAL to use:
ALchar device[256];
ZeroMemory(device, 256);
if (alcIsExtensionPresent(NULL, "ALC_ENUMERATE_ALL_EXT"))
{
strcpy_s(device, 256, alcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER));
}
else if (alcIsExtensionPresent(NULL, "ALC_ENUMERATION_EXT"))
{
strcpy_s(device, 256, alcGetString(NULL, ALC_DEVICE_SPECIFIER));
}
TRACE_AUDIOMANAGER("Sound device: '%s'", device);
g_System = alcOpenDevice(device);
According to the specification, the device specifier should return two drivers: 'Generic Hardware' and 'Generic Software', separated by a NULL terminator.
My sound card is an "NVIDIA High Definition Audio" device which is using the nvhda32v.sys driver (version 1.0.0.63, updated on 11-11-2009).
Why doesn't OpenAL detect my hardware?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
OpenAL 应始终返回默认音频设备,除非您使用的是 Creative 声卡。这些扩展都是特定于 Creative 的。这与期望在 NVIDIA 显卡上获得英特尔特定的 OpenGL 扩展相同。
作为记录,以下是设置 OpenAL 的方法:
OpenAL should always return the default audio device, unless you are using a Creative audio card. The extensions are all Creative-specific. It's the same as expecting to get Intel-specific OpenGL extension on an NVIDIA videocard.
For the record, here's how you set up OpenAL:
您确定要检查下一个字符串吗?因为
alcGetString(NULL, ALC_DEVICE_SPECIFIER)
返回字符串数组,请尝试如下操作:are you sure you check the next string, because
alcGetString(NULL, ALC_DEVICE_SPECIFIER)
returns string array, try like this:对于那些仍在寻找获取所有设备的方法的人//除了输出 - 仍然是通用的,适用于输入良好//
public:int* CHECK_DEVICES_IN(int MAX_DEVICES)
{ int 设备=0;
字符*设备[MAX_DEVICES];
int 检查=0;
while(设备<=MAX_DEVICES&&检查
}
检查++;
}
返回装置;
/*
返回的整数=0;
同时(返回
for those who are still looking for a way to get all devices //except output - stil generic, works for input well//
public:int* CHECK_DEVICES_IN(int MAX_DEVICES)
{ int devices=0;
char* device[MAX_DEVICES];
int checked=0;
while(devices<=MAX_DEVICES&&checked
}
checked++;
}
return devices;
/*
int returned=0;
while(returned
Vista 上没有“通用硬件”设备: http://connect.creativelabs.com/openal/OpenAL%20Wiki/OpenAL%C2%AE%20and%20Windows%20Vista %E2%84%A2.aspx
干杯!
There is no "Generic Hardware" device on Vista: http://connect.creativelabs.com/openal/OpenAL%20Wiki/OpenAL%C2%AE%20and%20Windows%20Vista%E2%84%A2.aspx
Cheers!