一个关于DirectShow的问题!
void main(){ HRESULT hr = CoInitialize(NULL); if (FAILED(hr)) { // Add error-handling code here. (Omitted for clarity.) } IGraphBuilder *pGraph; hr = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (void **)&pGraph); IMediaControl *pControl; IMediaEvent *pEvent; IMpegAudioDecoder *pDecoder; IBaseFilter *pFilter; pFilter=NULL; hr = pGraph->QueryInterface(IID_IMediaControl, (void **)&pControl); hr = pGraph->QueryInterface(IID_IMediaEvent, (void **)&pEvent); hr = pGraph->AddFilter(pFilter,L"Source"); hr = pFilter->QueryInterface(IID_IMpegAudioDecoder,(void **)&pDecoder);//注意:这行报错。 hr = pDecoder->put_DualMode(AM_MPEG_AUDIO_DUAL_RIGHT); hr = pGraph->RenderFile(L"C:\\123.dat", NULL); hr = pControl->Run(); }