Hello,
Welcome to Microsoft Q&A!
RPC_E_CHANGED_MODE indicates A previous call to CoInitializeEx specified the concurrency model for this thread as multithread apartment (MTA). This could also indicate that a change from neutral-threaded apartment to single-threaded apartment has occurred.
Edit:
According to ActivateAudioInterfaceAsync ,
For many implementations, an application must call this function from the main UI thread to activate a COM interface in the WASAPI family so that the system can show a dialog to the user. Except
- Calling ActivateAudioInterfaceAsync with a deviceInterfacePath that specifies an audio render device and an riid that specifies the IAudioClient interface.
- Calling ActivateAudioInterfaceAsync with a deviceInterfacePath that specifies an audio render device and an riid that specifies the IAudioEndpointVolume interface.
- Calling ActivateAudioInterfaceAsync from a session 0 service.
and
On versions of Windows previous to Windows 10, ActivateAudioInterfaceAsync must be called on a thread in a COM Single-Threaded Apartment (STA), when opening a device for audio capture.
Thank you.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.