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
4

1 回答 1

0

Minim 使用 Android 上不存在的 javax.sound.*。

尝试APWidgets并从媒体播放器示例开始。

另一种选择是使用 Android SDK 的媒体播放器

于 2013-09-22T10:21:23.437 回答