I am trying to write a program that interfaces with Windows Core Audio and WASAPI. I am having difficulty with the following couple lines.
CComHeapPtr<WCHAR> name;
hr = pAudioSessionControl->GetDisplayName(&name);
if (FAILED(hr)) {
LOG(L"IAudioSessionControl::GetDisplayName() failed: hr = 0x%08x", hr);
return -__LINE__; }
_tprintf(_T("Session Index %d, \"%s\"\n"), i, CString(name));
Outputs:
Session Index 0, "@%SystemRoot%\System32\AudioSrv.Dll,-202"
Session Index 1, ""
Session Index 2, ""
Session Index 3, ""
Press any key to continue . . .
This is with 3 programs all active and making noise. It seems i can see the system sounds program but nothing else.
Thanks for the help.