Results 1 to 3 of 3

Thread: Java Audio

  1. #1
    jumpman8947 is offline Member
    Join Date
    Feb 2013
    Posts
    38
    Rep Power
    0

    Default Java Audio

    Hey I'm making a simple program to playback audio such as mp3. My coding works but when I run the program and choose a mp3 file I get the error message
    "Unable to handle format: mpeglayer3, 44100.0 Hz, 16-bit, Stereo, LittleEndian,
    Signed, 24000.0 frame rate, FrameSize=32768 bits
    Failed to realize: com.sun.media.PlaybackEngine@193b604
    Error: Unable to realize com.sun.media.PlaybackEngine@193b604
    Press any key to continue . . ."

    I have installed the Java media framework. and think I installed the mp3 plugin properly. Under my system properties in environmental variables , under system variables I have as follows ,
    CLASSPATH = ; .; %JMFHOME%\lib\jmf.jar; .;%CLASSPATH% ; %JMFHOME%\lib\mp3plugin.jar;.;%CLASSPATH%
    JAVA_HOME = C:\Program Files\Java\jdk1.7.0_25
    JMFHOME = C:\JMF-2.1.1e

    I have also put the mp3plugin.jar under the lib/ext folder as well and when I try to cmd and run the command: java com.sun.media.codec.audio.mp3.JavaDecoder ,
    I get error messages of:
    C:\Users\jumpman8947>java com.sun.media.codec.audio.mp3.JavaDecoder
    Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/media/codec/a
    udio/AudioCodec
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknow n Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$100(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.launcher.LauncherHelper.checkAndLoadMain(Unkno wn Source)
    Caused by: java.lang.ClassNotFoundException: com.sun.media.codec.audio.AudioCode
    c
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 14 more

    I can't figure out what i'm doing wrong please help, Thanks.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,453
    Rep Power
    20

    Default Re: Java Audio

    Clean up your CLASSPATH.
    -- Remove %CLASSPATH%
    -- Remove spaces
    -- Remove duplications

    Then report any new errors/exceptions here.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    jumpman8947 is offline Member
    Join Date
    Feb 2013
    Posts
    38
    Rep Power
    0

    Default Re: Java Audio

    My CLASSPATH now reads as follows:
    ;.; %JMFHOME%\lib\jmf.jar;.;%JMFHOME%\lib\mp3plugin.ja r;.;
    But i still get the error of
    C:\Users\jumpman8947>java com.sun.media.codec.audio.mp3.JavaDecoder
    Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/media/codec/a
    udio/AudioCodec
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknow n Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$100(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.launcher.LauncherHelper.checkAndLoadMain(Unkno wn Source)
    Caused by: java.lang.ClassNotFoundException: com.sun.media.codec.audio.AudioCode
    c
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 14 more

Similar Threads

  1. Java Audio and Timer Functions, Audio Breaking
    By mjkaufer in forum AWT / Swing
    Replies: 1
    Last Post: 05-24-2013, 08:10 AM
  2. Java and audio output
    By Humphrey Bogart in forum New To Java
    Replies: 3
    Last Post: 03-20-2012, 06:21 PM
  3. pause audio in java
    By Saran185 in forum Advanced Java
    Replies: 1
    Last Post: 03-09-2011, 03:04 PM
  4. Audio processing in Java?
    By blind melon in forum New To Java
    Replies: 11
    Last Post: 12-03-2010, 12:22 AM
  5. Streaming Audio in Java Application?
    By jfxdd in forum Advanced Java
    Replies: 2
    Last Post: 11-24-2009, 08:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •