none
How to use WASPAI Capture in Metro style apps

    Question

  • Since the WASAPI is surpported in Metro style apps, I tried it:

    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 );

    WAVEFORMATEX *pDeviceFormat = NULL;

    pAudioClient->GetMixFormat( &pDeviceFormat );

    All of above are success !

    HRESULT hr = pAudioClient->Initialize( AUDCLNT_SHAREMODE_SHARED, AUDCLNT_STREAMFLAGS_EVENTCALLBACK, 0, 0,  pDeviceFormat  , NULL);

    BUT,   ***  IAudioClient::Initialize ***    failed!!!!     the Error code is ( E_ACCESSDENIED 0x80070005 ).

    BUT, if I check the "Microphone" in Package.appxmanifest -- Capabilities , the Error is 0x8000FFFF.

    Help me please !

    dimanche 25 décembre 2011 10:11

Réponses

Toutes les réponses