Hi all,
I'm using DirectShow to play mp3 files using the default graph builder on my XP system:
...
myGraphBuilder->RenderFile (filename, NULL);
...
myMediaControl->Run();
This works fine for almost all mp3 files I have tried (hundreds), except for a handful of mp3s, which all came from the same source. What happens is that everything initializes without error and the file appears to play, but without any sound. When I do a:
myMediaSeeking->GetPositions(...);
it returns correct positions based on how long the file's been playing – but no sound.
If I seek to a random position and play, then I DO hear the audio just fine. It's just when it's played from the start position and allowed to play that I don't get any sound.
I've examined the waveforms of the files in a sound editor and the only thing that I can see that's different about these files is that they have a long lead-in of total silence – from about 300 ms to over a 1 sec. I've found that I can make the files play correctly, with audio, if I seek to not less than about 200ms before the start of the actual audible sound samples.
Other players like WMP et al, all seem to be able to play these files without problem.
Does anyone know what I need to do in DShow to make these files play correctly from the start? Is there perhaps some buffer size that needs to be made bigger or something else? Any help would be greatly appreciated.
Thanks.