Failure to play MP3 file with COM exception in IGraphBuilder.RenderFile

前提是你 提交于 2019-12-02 06:11:11

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!