ramya Guest
|
Posted: Wed Feb 14, 2007 5:43 pm Post subject: play an mp3 using DShow |
|
|
Hi all,
Im trying to play an mp3 file using DirectShow on PocketPc emulator.
But the RenderFile func returns a 0x80040218 err code(class not
registered).
i tried to manually add the following filters instead of using
RenderFile() :
res = pGraph->AddSourceFilter(L"\
\Cuppy_Cake_Song.mp3",_T("Source"),&pSource);
res = CoCreateInstance(CLSID_MPEG1Splitter, NULL,
CLSCTX_INPROC_SERVER,IID_IBaseFilter, (void**)&pBase);
res = pGraph->AddFilter(pBase,_T("MPEG-1 Stream Splitter"));
IPin *pSourceOut = GetOutPin(pSource, 0);
IPin *pGrabIn = GetInPin(pBase, 0);
res = pGraph->Connect(pSourceOut, pGrabIn);
res = CoCreateInstance(CLSID_MPEGLayer3Decoder, NULL, CLSCTX_INPROC,
IID_IBaseFilter, (void**)&pAD);
res = pGraph->AddFilter(pAD,_T("MPEG Audio decoder"));
IPin *pPSource = GetOutPin(pBase, 0);
IPin *pGrab = GetInPin(pAD, 0);
res = pGraph->Connect(pPSource, pGrab);
res = CoCreateInstance(CLSID_DSoundRender, NULL,
CLSCTX_INPROC,IID_IBaseFilter, (void**)&pAR);
res = pGraph->AddFilter(pAR,_T("Audio Renderer"));
pPSource = GetOutPin(pAD, 0);
pGrab = GetInPin(pAR, 0);
res = pGraph->Connect(pPSource, pGrab);
But the first CoCreateInstance(i.e for CLSID_MPEG1Splitter) returns
the same 0x80040218 err code. I hav checked in the RegEdit n this
CLSID is present there.i dont kno how to proceed. plz help. any other
way to play an mp3 file is welcome too. Thanks in advance |
|