问题
I am new to direct show development. I am learning things about direct show. I am trying to write a method which plays some audio files. It works fine for many .mp3 files, but for some of my mp3 file the method RenderFile() of interface IGraphBuilder throws following exception
COMException occured : "Pins cannot connect due to not supporting the same transport."
My best guess is that I am missing some codec to play those files. Can anyone suggest what I am doing wrong. Is there any way to select a filter which can play those files. I am able to play those files with Windows Media Player, so I believe that I have required codecs installed.
Any help will be of great value.
Thanks in Advance.
回答1:
This is a well known problem with MP3 files and standard DirectShow fitler reading them. The problem is that if a file has a big section with ID3 tags, the filter might give up skipping them to audio data and this makes the whole playback fail.
These files will still play fine if you open them starting with WM ASF Reader Filter. This assumes you build, or at least start building, the graph manually to override default building behavior.
来源:https://stackoverflow.com/questions/10412073/failure-to-play-mp3-file-with-com-exception-in-igraphbuilder-renderfile