安卓:在VideoView多个音轨? [英] Android : multiple audio tracks in a VideoView?

查看:638
本文介绍了安卓:在VideoView多个音轨?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有,必须仔细阅读在VideoView在Android活动有一定的MP4的视频文件。这些视频包括几个音轨,每一个对应于用户的语言(如:英语,法语,日语......)。
我已经得到了意想不到的麻烦找到任何帮助或文档提供这样的功能。我目前能够加载视频和与MediaController发挥它在一个VideoView,但不改变音轨。版

我不知道在Android SDK提供任何简单的方法来做到这一点,这让我非常如何解决我的问题毫无头绪。我想每一个中提取音频轨道,加载,我想进入这取决于语言的MediaPlayer的音频,然后进行音频和视频一起玩。但我担心,一些同步问题可能出现和$ P $从这样pvent我。

如果您有任何线索,任何建议,帮助我开始接触这个问题,你更受欢迎。

I've got some .MP4 video files that must be read in a VideoView in an Android activity. These videos include several audio tracks, with each one corresponding to a user language (eg. : English, French, Japanese...).
I've got unexpected trouble finding any help or documentation to provide such a feature. I'm currently able to load the video and play it in a VideoView with a MediaController, but not to change audio tracks.

I'm not sure the Android SDK provides any easy way to do this, which leaves me quite clueless on how to solve my problem. I was thinking of extracting every audio track, loading the audio that I want into a MediaPlayer depending on the language, then make audio and video play together. But I fear that some sync issues could arise and prevent me from doing this.

If you have any clue, any advice to help me getting started with this problem, you're more than welcome.

推荐答案

没有测试自己还,但似乎的 Vitamio 库中有多个音轨的支持(在其他有趣的功能)。这是API兼容 VideoView 从Android的类。

Haven't tested myself yet, but it seems that Vitamio library has support for multiple audio tracks (among other interesting features). It is API-compatible with VideoView class from Android.

也许你将不得不使用的 Vitamio VideoView.setAudioTrack()来设置音轨(例如基于区域)。见的 Vitamio API文档了解详细信息。

Probably you would have to use Vitamio VideoView.setAudioTrack() to set audio track (for example based on locale). See Vitamio API docs for details.

这篇关于安卓:在VideoView多个音轨?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆