C++获取本地音频设备列表
#include "stdafx.h"#include <windows.h>#include <mmsystem.h>#include <iostream>using namespace std;#pragma comment(lib, "Winmm.lib")int _tmain(int argc, _TCHAR* argv[]){...
·
#include "stdafx.h"
#include <windows.h>
#include <mmsystem.h>
#include <iostream>
using namespace std;
#pragma comment(lib, "Winmm.lib")
int _tmain(int argc, _TCHAR* argv[])
{
int nSoundCardCount = waveOutGetNumDevs();
QString frequencyName;
for (int i = 0; i < nSoundCardCount; i++)
{
WAVEOUTCAPS woc;
waveOutGetDevCaps(i, &woc, sizeof(woc));
frequencyName = QString::fromWCharArray(woc.szPname);
}
return 0;
}
更多推荐
所有评论(0)