Not exactly, but it's not that much more involved
Originally Posted by CommonTater
That's pretty much the entire crux of my crusty old AudioPlayer. In fact, I had to write extra code to filter OUT videos.
void PlayAnyMediaFormatYouHaveCodecsFor(LPCWSTR file)
HRESULT coinitHr = CoInitialize();
IGraphBuilder* pGraph = NULL;
HRESULT hr = CoCreateInstance(CLSID_GraphBuilder, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pGraph));
hr = pGraph->RenderFile(file, NULL);
To the OP, DirectShow is pretty much the easiest way to do it. The SDK linked to above contains some fully fledged samples in the Samples\Multimedia\DirectShow directory. The modern replacement for it is called Media Foundation, but that doesn't exist on anything before Vista so depending on your/your target platform you may have a choice.