Playback of MOD (tracker) files

  ... the .MOD Player Extension for AndEngine.

Playback of MOD (tracker) files

Postby alex » Wed Jul 07, 2010 9:27 pm

I was pleasantly surprised that there exists a .mod player, JavaMod, which I am hoping to include in my project.

http://www.quippy.de/mod_en.php

The .jar is added to the build path and I've managed to utilize "EasyModPlay.java" from http://labs.weltenkonstrukteur.de/grassveins
but all this time I am wondering if I am wasting my time and it'll just end up crashing on the Android platform
alex
 
Posts: 275
Joined: Thu Jul 01, 2010 8:21 pm

Re: playback of MOD (tracker) files

Postby alex » Wed Jul 07, 2010 10:32 pm

the only apparent problem at the moment seems to be URL versus AssetFileDescriptor.


the URL I've created by:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.         public EasyModPlay( String strModFilename ) throws MalformedURLException //throws HeadlessException
  2.         {
  3.                 super();
  4.                 File modFile = new File(strModFilename);
  5.                 URL urlModFile = modFile.toURI().toURL();
  6.  
Parsed in 0.011 seconds, using GeSHi 1.0.8.4



then initiate the class with:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.         try
  2.         {
  3.             modMusicPlayer = new EasyModPlay("mfx/mymusic.mod");
  4.         }
  5.         catch (MalformedURLException e)
  6.         {
  7.             // TODO Auto-generated catch block
  8.             e.printStackTrace();
  9.         }
  10.  
Parsed in 0.010 seconds, using GeSHi 1.0.8.4


but accessing assets on Android only takes place with the AssetFileDescriptor ?
alex
 
Posts: 275
Joined: Thu Jul 01, 2010 8:21 pm

Re: playback of MOD (tracker) files

Postby Nicolas Gramlich » Wed Jul 07, 2010 11:21 pm

Hi alex,

while I still couldn't really figure out what that JavaMOD tool from the homepage does (except playing various audio files) :?: :?: :?: , I usually open Asset-Files like this:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. final InputStream in = getContext().getAssets().open(pAssetPath);
Parsed in 0.010 seconds, using GeSHi 1.0.8.4


Hope this helps you :?

Best Regards,
Nicolas
Nicolas Gramlich
Site Admin
 
Posts: 1734
Joined: Mon Jun 07, 2010 6:20 pm
Location: Schriesheim, Germany

Re: playback of MOD (tracker) files

Postby alex » Thu Jul 08, 2010 3:14 am

I solved the file-reading problem by copying the .mod from resources/raw to sdram; with this I could use the absolute path to generate a URL.

However, as I feared, the pre-compiled .JAR crashes on Android :-(

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. 07-08 01:08:55.318: WARN/dalvikvm(12800): Exception Ljava/lang/NoClassDefFoundError; thrown during Lde/quippy/javamod/system/Helpers;.<clinit>
  2. 07-08 01:08:55.318: DEBUG/AndroidRuntime(12800): Shutting down VM
  3. 07-08 01:08:55.330: WARN/dalvikvm(12800): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
  4. 07-08 01:08:55.349: ERROR/AndroidRuntime(12800): FATAL EXCEPTION: main
  5. 07-08 01:08:55.349: ERROR/AndroidRuntime(12800): java.lang.ExceptionInInitializerError
  6. 07-08 01:08:55.349: ERROR/AndroidRuntime(12800):     at de.quippy.javamod.io.ModfileInputStream.readString(ModfileInputStream.java:192)
  7. 07-08 01:08:55.349: ERROR/AndroidRuntime(12800):     at de.quippy.javamod.io.ModfileInputStream.isPowerPacker(ModfileInputStream.java:115)
  8. 07-08 01:08:55.349: ERROR/AndroidRuntime(12800):     at de.quippy.javamod.io.ModfileInputStream.<init>(ModfileInputStream.java:54)
  9. 07-08 01:08:55.349: ERROR/AndroidRuntime(12800):     at de.quippy.javamod.io.ModfileInputStream.<init>(ModfileInputStream.java:85)
  10. 07-08 01:08:55.349: ERROR/AndroidRuntime(12800):     at de.quippy.javamod.multimedia.mod.loader.ModuleFactory.getInstance(ModuleFactory.java:174)
  11. 07-08 01:08:55.349: ERROR/AndroidRuntime(12800):     at biemann.android.ultimateinversion.ModPlayer.doStartPlaying(ModPlayer.java:104)
  12. 07-08 01:08:55.349: ERROR/AndroidRuntime(12800):     at biemann.android.ultimateinversion.MenuExample.onLoadComplete(MenuExample.java:133)
  13. 07-08 01:08:55.349: ERROR/AndroidRuntime(12800):     at org.anddev.andengine.ui.activity.BaseGameActivity.onCreate(BaseGameActivity.java:56)
  14. 07-08 01:08:55.349: ERROR/AndroidRuntime(12800):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
  15. 07-08 01:08:55.349: ERROR/AndroidRuntime(12800):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
  16. 07-08 01:08:55.349: ERROR/AndroidRuntime(12800):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
  17. 07-08 01:08:55.349: ERROR/AndroidRuntime(12800):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)
  18. 07-08 01:08:55.349: ERROR/AndroidRuntime(12800):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
  19. 07-08 01:08:55.349: ERROR/AndroidRuntime(12800):     at android.os.Handler.dispatchMessage(Handler.java:99)
  20. 07-08 01:08:55.349: ERROR/AndroidRuntime(12800):     at android.os.Looper.loop(Looper.java:123)
  21. 07-08 01:08:55.349: ERROR/AndroidRuntime(12800):     at android.app.ActivityThread.main(ActivityThread.java:4627)
  22. 07-08 01:08:55.349: ERROR/AndroidRuntime(12800):     at java.lang.reflect.Method.invokeNative(Native Method)
  23. 07-08 01:08:55.349: ERROR/AndroidRuntime(12800):     at java.lang.reflect.Method.invoke(Method.java:521)
  24. 07-08 01:08:55.349: ERROR/AndroidRuntime(12800):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
  25. 07-08 01:08:55.349: ERROR/AndroidRuntime(12800):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
  26. 07-08 01:08:55.349: ERROR/AndroidRuntime(12800):     at dalvik.system.NativeStart.main(Native Method)
  27. 07-08 01:08:55.349: ERROR/AndroidRuntime(12800): Caused by: java.lang.NoClassDefFoundError: java.awt.Font
  28. 07-08 01:08:55.349: ERROR/AndroidRuntime(12800):     at de.quippy.javamod.system.Helpers.<clinit>(Helpers.java:76)
  29. 07-08 01:08:55.349: ERROR/AndroidRuntime(12800):     ... 21 more
  30.  
  31.  
Parsed in 0.000 seconds, using GeSHi 1.0.8.4
alex
 
Posts: 275
Joined: Thu Jul 01, 2010 8:21 pm

Re: playback of MOD (tracker) files

Postby Nicolas Gramlich » Thu Jul 08, 2010 3:18 am

As I assume this is a tool that can playback .mod Audio-Files :?: I expect the real problems to arise later ;)
Seems to have problems finding a class here :?

Anyway if you could quickly explain what ".mod" is and why it might be useful for an AndEngine, let me know.

Best Regards,
Nicolas
Nicolas Gramlich
Site Admin
 
Posts: 1734
Joined: Mon Jun 07, 2010 6:20 pm
Location: Schriesheim, Germany

Re: playback of MOD (tracker) files

Postby alex » Thu Jul 08, 2010 8:14 am

mod files are music files that contain samples and patterns that tell the player how to play the samples to make music.
with this filetype the music is decent and very small i.e. 200KB compared to 2MB MP3's.

It's and "old school" format that was widely used on the Amiga so now there's tons of public domain mod files
alex
 
Posts: 275
Joined: Thu Jul 01, 2010 8:21 pm

Re: playback of MOD (tracker) files

Postby Nicolas Gramlich » Thu Jul 08, 2010 10:44 am

Hi Alex,

look at this:

They say to have an experimental Android port: http://xmp.sourceforge.net/ which is said to have a easy JNI-Wrapper, what would be awesome!

Just verified that the apk they offer for download works on all my devices.
I'll contact the owners of the project to see if they give us early access to that library :)

Best Regards,
Nicolas
Nicolas Gramlich
Site Admin
 
Posts: 1734
Joined: Mon Jun 07, 2010 6:20 pm
Location: Schriesheim, Germany

Re: playback of MOD (tracker) files

Postby Nicolas Gramlich » Thu Jul 08, 2010 11:13 am

Finally got the native library to compile :)

more progress soon...
Nicolas Gramlich
Site Admin
 
Posts: 1734
Joined: Mon Jun 07, 2010 6:20 pm
Location: Schriesheim, Germany

Re: playback of MOD (tracker) files

Postby Nicolas Gramlich » Thu Jul 08, 2010 11:26 am

Works :)
Nicolas Gramlich
Site Admin
 
Posts: 1734
Joined: Mon Jun 07, 2010 6:20 pm
Location: Schriesheim, Germany

Re: Playback of MOD (tracker) files

Postby Nicolas Gramlich » Thu Jul 08, 2010 12:20 pm

The only problem is that it currently can only play .MOD files from the actual filesystem, what is the SDCard. That means not from assets and not from resources :(

I'll contact them to see if this is possible. Otherwise you'd have to copy the file from there to the SDCard what would suck.

Best Regards,
Nicolas
Nicolas Gramlich
Site Admin
 
Posts: 1734
Joined: Mon Jun 07, 2010 6:20 pm
Location: Schriesheim, Germany

Next

Return to .MOD-Player

Who is online

Users browsing this forum: No registered users and 1 guest