5

I posted this question over at anddev.org and thougt here was a good place to post this too because this site has a bigger usergroup.

I will make it shorter here: How can i play .xm or .mod files on the android platform? Is there a good android compatible library for the playback? I cant seem to find one. I dont search a player like Extended Multimedia Player, just a library.

I know i could convert all the modules to mp3 but I don't like that. It would blow up the app in filesize.

Regards.

Sebastian
  • 281
  • 4
  • 14
  • Is converting to mp3 so bad? Sure the app would be a few megabytes bigger, but so what -- apps are typically several megabytes in size. Would anybody fundamentally care? You'd then have the advantage of using standard OS-supported (presumably) playback routines. – Neil Coffey Apr 08 '11 at 16:25

3 Answers3

5

AndEngine is probably a good way to go.

Or if you just want to add mod/xm playing to your own code base, check out my page:

building libmodplug for android

there are a few caveats (using older Android NDK, building version 0.8.6 of libmodplug, could use better thread handling) but basically it works. There's an example apk with source.

Also recently added a new app using libmodplug with soundtracks from two of my games - 44 songs in 1.2MB :)

PGsoundtracks

Patrick
  • 53
  • 6
  • Do I really need to compile the libmodplug against my NDK or can I use your PlayerThread.java in order to play tracker files now? – Sebastian Jun 06 '11 at 09:24
  • Compiling it yourself will give you more flexibility. For example, the PlayerThread.java & libmodplug.so in ModPlayer.zip on the website have a somewhat arbitrary max MOD file size of 60K which may be small for the MOD files you want to play. But you should be able to drop the whole com.examples.modplayer source under your eclipse src/ directory and copy the libmodplug.so into libs/armeabi/ and use it that way. So you'd have src/com.examples.modplayer and src/com.yourpackage.yourapp for your own custom code. – Patrick Jun 10 '11 at 00:30
  • Update: I've added a new page with a beta version of the Android libmodplug code built as a library which should be easier to add to your own app/game without having to compile the libmodplug source. It should also eliminate the 60K limit, but it's still best to keep the size down. Check it out: [link](http://www.peculiar-games.com/libmodplug-in-android/andmodplug) – Patrick Sep 16 '11 at 00:23
1

The 2D game engine AndEngine has an extension that can play .mod files, it might suit your needs:

http://code.google.com/p/andenginemodplayerextension/

Kristóf Marussy
  • 1,202
  • 8
  • 18
1

download xmp player from Android Market. That is the module Andengine extensions are using. You don't need Andengine nor their extensions for that.

Mikko
  • 11
  • 1