Re: How to play sequentially several audio files with DirectShow ?
- From: "Chris P. [MVP]" <msdn@xxxxxxxxxxxx>
- Date: Sat, 10 Jun 2006 21:25:29 -0400
On Sat, 10 Jun 2006 23:28:35 +0200, Mark Morrisson wrote:
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 ?
It's possible but you have to remove the existing filters from the graph.
If you know that the next file is going to be of the same type you could
locate and remove the source filter and insert the new source filter.
Basically though if you're using the RenderFile() technique it's easiest to
destroy the old graph completely and create a new one.
--
http://www.chrisnet.net/code.htm
http://www.avdevforum.com/AV
.
- Follow-Ups:
- Re: How to play sequentially several audio files with DirectShow ?
- From: Mark Morrisson
- Re: How to play sequentially several audio files with DirectShow ?
- References:
- How to play sequentially several audio files with DirectShow ?
- From: Mark Morrisson
- How to play sequentially several audio files with DirectShow ?
- Prev by Date: Re: Getting Started with DirectX Audio
- Next by Date: directSound.SetNotificationPositions accuracy
- Previous by thread: How to play sequentially several audio files with DirectShow ?
- Next by thread: Re: How to play sequentially several audio files with DirectShow ?
- Index(es):
Relevant Pages
|