简体   繁体   English

音频设备输入名称被截断

[英]Audio device input name truncated

I'm trying to get the audio input device name with the code bellow: 我正在尝试使用以下代码获取音频输入设备的名称:

WAVEINCAPS woc;
unsigned long iNumDevs = waveInGetNumDevs(); 
for (unsigned long i = 0; i < iNumDevs; i++) 
{ 
    if (!waveInGetDevCaps(i, &woc, sizeof(WAVEINCAPS))) 
    {
        devices.push_back(woc.szPname);
    } 
}

When i look in devices , there are all input devices names, but all names are truncated in 32 characters. 当我查看devices ,所有输入的设备名称都被删除,但是所有名称都被截断为32个字符。

How can I get the complete name? 如何获得全名?

The szPname member of the WAVEINCAPS structure is limited to MAXPNAMELEN characters, which is defined as 32. WAVEINCAPS结构的szPname成员限制为MAXPNAMELEN字符,该字符定义为32。

You could try enumerating using another technology that might not have this limitation, for example using DirectSound . 您可以尝试使用可能没有此限制的另一种技术进行枚举,例如使用DirectSound

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM