How to play sequentially several audio files with DirectShow ?
- From: "Mark Morrisson" <mark4@xxxxxxxxxxxxxxx>
- Date: Sat, 10 Jun 2006 23:28:35 +0200
Hi everyone,
I want to play A.mp3 then B.mp3. After initializing an instance of
DirectShow, here is the way I load a file :
HRESULT hr;
WCHAR wFile[MAX_PATH];
int nLen = MultiByteToWideChar(CP_ACP, 0, fileName, -1, NULL, NULL);
MultiByteToWideChar(CP_ACP, 0, fileName, -1, wFile, nLen);
if FAILED(hr = m_pigb->RenderFile(wFile, NULL))
throw DXException("RenderFile", hr);
with fileName being 'A.mp3' then 'B.mp3'. Once the first file has been
loaded, I play it with m_pimc->Run(); where m_pimc is a pointer to
IMediaControl interface. The file is playing fine. Then, after a certain
amount of seconds, I call m_pimc->Stop(); and I load the B.mp3 file with the
code above. Then I call m_pimc->Run(); again but it's still the first file
that is played (i.e. A.mp3) and not B.mp3 ! Isn't it possible to render
several files with the same graph filter ?
Thanks in advance,
Mark
.
- Follow-Ups:
- Re: How to play sequentially several audio files with DirectShow ?
- From: Chris P. [MVP]
- Re: How to play sequentially several audio files with DirectShow ?
- Prev by Date: Re: Getting Started with DirectX Audio
- Next by Date: Re: Getting Started with DirectX Audio
- Previous by thread: RE: corrupt heap in graphedt.exe with source filter.
- Next by thread: Re: How to play sequentially several audio files with DirectShow ?
- Index(es):
Relevant Pages
|