WPF MediaElement,更改音轨
我正在使用 WPF 和 MediaElement 编写媒体播放器。 我正在播放一个有多个音轨的视频。但他们都在同时玩:(
我如何只玩其中一个?有可能吗?
I'm writing a Media Player using WPF and the MediaElement.
I was playing a video i have that has several audio tracks. But they are both playing at the same time :(
How do i just play one of them ? is it at all possible ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为这个问题出在您使用的音频和视频 DirectShow 编解码器中。您可以在 Windows Media Player 中正确播放视频吗?如果不是,请重新安装相应的编解码器。
几个月前,我已经完全原型化了切换音轨的要求,以便在我们的多语言软件中显示视频帮助。
我的经验显示了一些替代方案:
通过 WinForms 主机使用 WMP 控件,然后更改语言,例如:
var control = ((IWMPControls3)wmpControl.Ctlcontrols);
控制.currentAudioLanguage = 9; // english
您可以在此处找到 LCID 的完整列表。
要列出视频中的所有音轨,您可以使用以下方法:
我希望这可以帮助您选择解决方案。
I think this problem is in the audio and video DirectShow codecs you use. Can you play the video correct in the Windows Media Player? If no, please re-install the appropriated codecs.
Some months ago I have completely prototyped the requirements to switch audio tracks in order to show the video-help in our multi-language software.
My experience shows some alternatives:
Use the WMP-control via WinForms host, and then change the language like:
var control = ((IWMPControls3)wmpControl.Ctlcontrols);
control.currentAudioLanguage = 9; // english
The Complete list of the LCID you can find here.
To list all audio tracks in the video you can use something like:
I hope this helps you to choose your solution.
对于 WPF MediaElement 来说这是不可能的。如果您有一些 DirectShow 专业知识,您可以尝试我的 WPF MediaKit 并修改 MediaUriElement/Player 或创建你自己的。
It is not possible with the WPF MediaElement. If you have some DirectShow know-how, you can try my WPF MediaKit and either modify the MediaUriElement/Player or create your own.