Minim won't load sound

edited November 2014 in Library Questions

The example PlayAFile works perfectly. So I traced it in the Processing's libraries folder and pasted another file "A.wav" in the data folder. Tried to play that file ( player = minim.loadFile("A.wav"); ), but now I'm getting java.lang.NullPointerException. Should I be limiting the samples or something? The code is the same the example, except for A.wav part.

Tagged:

Answers

  • Answer ✓

    Can't guess what went wrong in your case, but I suggest to copy the examples to your sketchbook, to keep the originals intact.
    And you will be in a familiar environment, where you can experiment at will.

    Do you have any other error message? Sometime, Minim complains when it doesn't recognize the file format.

  • I tried that again. Created new project, copied the example PlayASound, created a "data" folder in the new project and copied the sound "A.wav" in it. Is there any particular type of audio file that should be played? Is this maybe too complicated of a file? Anyway, this is what it returned:

    ==== JavaSound Minim Error ====
    ==== Error invoking createInput on the file loader object: null
    
    java.lang.RuntimeException: java.lang.NullPointerException
        at com.jogamp.common.util.awt.AWTEDTExecutor.invoke(AWTEDTExecutor.java:58)
        at jogamp.opengl.awt.AWTThreadingPlugin.invokeOnOpenGLThread(AWTThreadingPlugin.java:103)
        at jogamp.opengl.ThreadingImpl.invokeOnOpenGLThread(ThreadingImpl.java:206)
        at javax.media.opengl.Threading.invokeOnOpenGLThread(Threading.java:172)
        at javax.media.opengl.Threading.invoke(Threading.java:191)
        at javax.media.opengl.awt.GLCanvas.display(GLCanvas.java:541)
        at processing.opengl.PJOGL.requestDraw(PJOGL.java:688)
        at processing.opengl.PGraphicsOpenGL.requestDraw(PGraphicsOpenGL.java:1651)
        at processing.core.PApplet.run(PApplet.java:2256)
        at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.NullPointerException
        at ddf.minim.javasound.JSMinim.getAudioRecordingStream(Unknown Source)
        at ddf.minim.Minim.loadFile(Unknown Source)
        at ddf.minim.Minim.loadFile(Unknown Source)
        at proba.setup(proba.java:42)
        at processing.core.PApplet.handleDraw(PApplet.java:2361)
        at processing.opengl.PJOGL$PGLListener.display(PJOGL.java:862)
        at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:665)
        at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:649)
        at javax.media.opengl.awt.GLCanvas$10.run(GLCanvas.java:1289)
        at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1119)
        at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:994)
        at javax.media.opengl.awt.GLCanvas$11.run(GLCanvas.java:1300)
        at java.awt.event.InvocationEvent.dispatch(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$200(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)
    
  • Turns out it needed an .mp3 input. Problem solved, I guess.

Sign In or Register to comment.