audio capture in metro apps

坚强是说给别人听的谎言 提交于 2019-12-05 18:19:59

I got an answer from the MSDN forums:

Platform::String^ id = Windows::Media::Devices::MediaDevice::GetDefaultAudioCaptureId(Windows::Media::Devices::AudioDeviceRole::Console );
Microsoft::WRL::ComPtr<IAudioClient> pAudioClient = NULL;
ActivateAudioInterface( id->Data(), __uuidof( IAudioClient ), (void**)&pAudioClient );

This ActivateAudioInterface() is mysterious to me—there are no references to it at all in the MSDN Library; the only hits on searches for it are in the forums...

Actually, you should use ActivateAudioInterfaceAsync instead of ActivateAudioInterface. See http://msdn.microsoft.com/en-us/library/windows/desktop/jj128298(v=vs.85).aspx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!