0

I'm running Processing 2.02 in Windows 8, have jre 7 installed, running an emulator created for API level 11, using the latest Minim version (as of 9/20/2013). I wrote a test sketch to make sure I can run things to the emulator (a canvas 100x100 green with a simple line drawn). This works. I then wrote a sketch to test out Minim playing a mp3 sound snippet. The mp3 file is about 201K and is in the data folder The sketch works in java but fails when I switched to Android mode.

Can someone please help guide me to get it running. Thank you in advance.

Below is the sketch and the error I received.

***Processing sketch: >

  // libraries
  import dff.minim.*;

  // audio variables
  Minim myMinim;>
  AudioSnippet textReading;

  void setup() {
      size(100, 100);
      background(0, 255, 0); // green background color
      myMinim = new Minim(this);
      textReading = myMinim.loadSnippet("testmp3.mp3");
  }// setup

  void draw() {
  }// draw

  void mouseReleased() {
      textReading.play();
  }// mouseReleased

  void stop() {
      myMinim.stop();
      super.stop();
  )// stop

***Error:

-post-build:

debug:
FATAL EXCEPTION: Animation Thread
java.lang.ExceptionInInitializerError
    at processing.test.minimtest.MinimTest.setup(MinimTest.java:31)
    at processing.core.PApplet.handleDraw(Unknown Source)
    at processing.core.PGraphicsAndroid2D.requestDraw(Unknown Source)
    at processing.core.PApplet.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:1019)
Caused by: java.lang.NoClassDefFoundError: javax.sound.sampled.AudioFileFormat$Type
    at ddf.minim.Minim.<clinit>(Minim.java:65)
    ... 5 more
Susanna
  • 1
  • 1

1 Answers1

0

Minim uses javax.sound.* which is not present on Android.

Try APWidgets and start with the media player examples.

The other alternative is to use the Android SDK's Media Player

George Profenza
  • 50,687
  • 19
  • 144
  • 218
  • Hi everyone, turns out, my problem isn't the Fatal Exception with Minim. It is with the way Processing expects files versus Android. Processing expects to find "things" under the data folder while Android needs them under Assets folder or res folder. So as good as Processing is as a development environment (which I love), I need to isolate the I/O (video, image, audio) files to know if I'm running in Android or not!!! I'm open to suggestions if someone has a way to help migrate code seamlessly between Processing and Android. – Susanna Oct 03 '13 at 00:02