Can somebody please provide a very simple program to find the default audio device on the machine? I have tried researching this issue elsewhere, and I would find leads (such as GetDefaultAudioEndpoint()), but I have yet to find a single example of how to apply this to my own code. Every time I look at something elsewhere online, I run into linker errors and all kinds of stuff that is too cryptic for somebody who's completely new to programming something like this to really work with. One program I came up with, but which failed, is as follows:
That generates a run-time error having to do with atlbase.h.
//using namespace std;
pMMDeviceEnumerator->GetDefaultAudioEndpoint(eCapture, eMultimedia, 0);
//cout << hr;
If somebody could please show me a few changes I could make to that program OR a completely different, yet really simple program to find the default audio device, it would be appreciated. I'm really walking into unfamiliar territory with trying to implement this sort of functionality or getting into this sort of API, so please explain anything that's not trivial. Thanks!