如何控制Windows 7中的麦克风增强?

我试图在C / C ++应用程序中使用MIXER API来控制Windows 7中的麦克风增强(电平/(非)静音),但是我没有得到相同的控件。 可以使用WASAPI来完成吗? 有人可以build议任何其他API来控制Windows 7中的麦克风增强?

这是我迄今写的…

const IID IID_IDeviceTopology = __uuidof(IDeviceTopology); const IID IID_IPart = __uuidof(IPart); const IID IID_IAudioAutoGainControl = __uuidof(IAudioAutoGainControl); HRESULT hr = S_OK; CoInitialize(NULL); IMMDeviceEnumerator *deviceEnumerator = NULL; hr = CoCreateInstance(__uuidof(MMDeviceEnumerator), NULL, CLSCTX_INPROC_SERVER, __uuidof(IMMDeviceEnumerator), (LPVOID *)&deviceEnumerator); IMMDevice *pEndptDev = NULL; hr = deviceEnumerator->GetDefaultAudioEndpoint(eCapture, eConsole, &pEndptDev); deviceEnumerator->Release(); deviceEnumerator = NULL; IDeviceTopology *pDevTopoEndpt = NULL; IConnector *pConnEndpt = NULL; IConnector *pConnHWDev = NULL; IPart *pPartConn = NULL; IAudioAutoGainControl *pAGC = NULL; IControlInterface *pControl = NULL; UINT pCount = 0; LPCGUID pIID = ; // Get the endpoint device's IDeviceTopology interface. hr = pEndptDev->Activate(IID_IDeviceTopology, CLSCTX_ALL, NULL, (void**)&pDevTopoEndpt); // The device topology for an endpoint device always // contains just one connector (connector number 0). hr = pDevTopoEndpt->GetConnector(0, &pConnEndpt); // Use the connector in the endpoint device to get the // connector in the adapter device. hr = pConnEndpt->GetConnectedTo(&pConnHWDev); // Query the connector in the adapter device for // its IPart interface. hr = pConnHWDev->QueryInterface(IID_IPart, (void**)&pPartConn); // Use the connector's IPart interface to get the // IDeviceTopology interface for the adapter device. hr = pPartConn->Activate(CLSCTX_ALL, IID_IAudioAutoGainControl, (void**)&pAGC); hr = pPartConn->GetControlInterfaceCount(&pCount); hr = pPartConn->GetControlInterface(pCount - 1, &pControl); hr = pControl->GetIID((GUID *)pIID); //BOOL bEnabled = false; hr = pAGC->SetEnabled(true, pIID); 

Solutions Collecting From Web of "如何控制Windows 7中的麦克风增强?"