Not able to run the code in android mode (AudioContext : no AudioIO specified)

edited March 12 in Android Mode

Not able to run the code in android mode, anyone familiar with error, please help.

This is the code:

import beads.*;
import java.util.List;

AudioContext ac;
WavePlayer wp;
Gain g;
Glide gainGlide;
Glide frequencyGlide;

void setup()
   ac = new AudioContext(); 

 gainGlide = new Glide(ac, 40f, 20);
 frequencyGlide = new Glide(ac, 250, 20);
 wp = new WavePlayer(ac, frequencyGlide, Buffer.SINE);
 g = new Gain(ac, 1, gainGlide);

This is the error:

AudioContext : no AudioIO specified, using default => beads.JavaSoundAudioIO.
Process: processing.test.sketch_180311a, PID: 11871
java.lang.NoClassDefFoundError: Failed resolution of: Ljavax/sound/sampled/AudioFormat;
    at beads.JavaSoundAudioIO.create(Unknown Source)
    at beads.JavaSoundAudioIO$ Source)
Caused by: java.lang.ClassNotFoundException: Didn't find class "javax.sound.sampled.AudioFormat" on path: DexPathList[[zip file "/data/app/processing.test.sketch_180311a-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
    at dalvik.system.BaseDexClassLoader.findClass(
    at java.lang.ClassLoader.loadClass(
    at java.lang.ClassLoader.loadClass(
    ... 3 more
    Suppressed: java.lang.ClassNotFoundException: javax.sound.sampled.AudioFormat
        at java.lang.Class.classForName(Native Method)
        at java.lang.BootClassLoader.findClass(
        at java.lang.BootClassLoader.loadClass(
        at java.lang.ClassLoader.loadClass(
        ... 4 more
    Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available


  • Edit post, highlight code, press Ctrl-o to format.

    Looks like a missing class. Is the class in the jar? Is it on the classpath? Is it anywhere on the device?

    Have you googled the error?

    Android version? Processing version?

  • I googled it but nothing is there.

  • edited March 13


    the error code is simple :android does not allow the use of javax.sound; it uses its own; that s why beads or minim cannot work with it

  • (we keep seeing errors like this. should libraries be tagged with the platforms they support somehow?)

  • @koogs===

    could be useful!

  • @tilak - Beads can use alternative audio IO, it's not stuck with using JavaSound. However, I don't think there's an Android audio IO yet -

    The integration is not that difficult to write (I wrote the one for the JAudioLibs JACK bindings).

Sign In or Register to comment.