How to play sequentially several audio files with DirectShow ?



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


.



Relevant Pages

  • Re: ASM Cassette Images in TRS-80 Emulator
    ... David Keil's TRS-80 Model III/4/4P emulator. ... One of the progress asterisks changes to a C, and the load prematurely stops. ... Picking apart the *.CAS file that I was trying to load had initially suggested that the filename was "SPWAR" There is other data in the file, of course, but that plaintext seemed like a good guess. ...
    (comp.sys.tandy)
  • Re: Strange Failure Mode in FreeBSD 4.11
    ... # filename - will load the rules in the given filename ... I'm sure that if you put your custom rules in a shell file that you can use rc or cron to load those rules at boot time; you'd just need to be careful with rule numbering, maybe use ipfw sets for rule ordering, etc. ... Greg Barniskis, Computer Systems Integrator ...
    (freebsd-questions)
  • Re: Save/load values of text entry
    ... # not the fonction behind it. ... # set filex {file exist $filename} ... An entry widget is similar ...
    (comp.lang.tcl)
  • Re: Assembly.Load() exception
    ... You did not specify the filename or you forgot to put the extention on the ... TestModule needs to have an extention. ... > This is throwing the following exception: ... > Could not load file or assembly ...
    (microsoft.public.dotnet.languages.csharp)
  • [DSPack]Rendering a 2nd video doesnt work on user pc, but fine on dev. pc
    ... The following code is designed to load a video. ... It works on the development pc but only the first time on the user pc. ... Folder + Filename are correct. ... StopPos:= ClipDuration; ...
    (borland.public.delphi.thirdpartytools.general)