Audio capture in metro applications

I need to perform low-level audio capture in my Windows 8 Metro-style app.

I think I need to use the IAudioClient interface, but how to get this interface?

Microsoft says: "The client receives a reference to the IAudioClient interface for the audio endpoint device using one of the methods described in the IMMDevice interface."

http://msdn.microsoft.com/en-us/library/windows/desktop/dd370865(v=vs.85).aspx

but the IMMDevice interface is not supported for Metro style applications.

How to get IAudioClient interface?

+4
source share
2 answers

I got a response 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 links to it in the MSDN library; the only hits in his search are on the forums ...

+1
source

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

0
source

Source: https://habr.com/ru/post/1403553/


All Articles