Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to play mp3+g on mediaplayer android

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

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

like image 877
user430926 Avatar asked Oct 24 '22 05:10

user430926


1 Answers

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.

Workaround 1

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.

Workaround 2

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.

Workaround 3

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.

like image 111
shibbybird Avatar answered Nov 15 '22 06:11

shibbybird