如何在Media Player Android上播放MP3 + G [英] How to play mp3+g on mediaplayer android

查看:83
本文介绍了如何在Media Player Android上播放MP3 + G的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道我们可以在MediaPlayer中播放mp3文件. 但是我们可以在android上播放mp3 + g吗?

I know we can play mp3 file in MediaPlayer. But can we play mp3+g on android??

我在android的文档中看到过,但没有看到. http://developer.android.com/guide/appendix/media-formats.html

I saw in the documentation on android, but i didn't see it. http://developer.android.com/guide/appendix/media-formats.html

是否有其他解决方法或图书馆可以做到这一点? 谢谢

Is there any work around or library to do this? Thanks

推荐答案

我不认为Android会很快支持mp3 + g播放.话虽这么说,一个mp3 + g文件"应该是一个压缩文件(内部有两个文件),或者是两个单独的文件,除了文件扩展名外,它们的名称相同.因此,除了播放MP3之外,MediaPLayer确实无能为力,并且将Android框架中的MediaPlayer更改为使其正常工作将无法在设备之间移植.

I don't "think" that Android is going to support mp3+g playback anytime soon. That being said an mp3+g "file" should either be one zipped file(with two files inside) or two separate files named the same with exception of the file extension. So other then playing the MP3 there is really nothing else that MediaPLayer can do, and changing MediaPlayer int the android framework to get this to work would not be portable from device to device.

解决方法1

使用FFMPEG将这些文件转码和多路复用为支持的其他格式,例如mp4. 此处是某人使用ffmpeg混合mp3的示例+ g进入FLV.

Use FFMPEG to transcode and mux these files to a different format that is supported such as mp4. Here is an example of someone using ffmpeg to mux mp3+g into FLV.

解决方法2

另一种选择是使用Android For VLC,该软件位于此处中处于预测试阶段的状态.现在,我不确定Android的VLC是否支持mp3 + g,但libvlc确实支持两个文件的解码,所以我猜想它可以工作,或者您可以稍稍更改代码以使其工作.我最近检查了VLC for Android代码,不得不说它是cpu猪,但是由于mp3和cdg通常是较小的,不占用cpu的文件,因此我认为android设备可以使用VLC处理工作量.

Another option would be to use Android For VLC which is in pre-alpha found here. Now I'm not sure that VLC for android will support mp3+g, but libvlc does support decoding of the two files so I'm guessing it would work, or you could alter the code a bit to get it to work. I have checked out the VLC for Android code recently and I have to say its a cpu hog but since mp3 and cdg are generally smaller less cpu intensive files I think that android devices could handle the work load using VLC.

解决方法3

现在,就更复杂的选项而言,您可以利用Android NDK并自己创建一个解码器(这将花费您很多时间).

Now as far as more complex options you could utilize the Android NDK and create a decoder yourself (This would take you a lot of time).

希望其中一些可以帮助您.

Hope some of this helps you.

这篇关于如何在Media Player Android上播放MP3 + G的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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