Results 1 to 3 of 3
  1. #1
    Meix is offline Member
    Join Date
    Jan 2012
    Rep Power

    Default Trouble with Applet.getAudioClip


    I have developed a web-based game site (applet - server solution).
    It has been running fine for 5 years by now.

    Now i found a computer where users can not enter the gameroom.
    I investigated the problem and found:

    log("Starting media download");
    GameAudioClips.downloadAudioClips(this); // Download the sound
    log("Sounds downloaded");
    getImages(); //Download the images

    The problem is in downloadAudioClips() method:
    public static void downloadAudioClips(JApplet applet) {
    try {
    String location = ClientApplet.getProperty("AppletAudioClipsLocation ");
    notifyClip = applet.getAudioClip(new URL(location + "notify.wav"));
    ... // Some other files
    } catch (Exception e) {
    //log some error

    In the log, i saw that the last line was "Starting media download", so the code gets stuck in the applet.getAudioClip() method!

    Java documentation says:
    public AudioClip getAudioClip(URL url)
    Returns the AudioClip object specified by the URL argument.
    This method always returns immediately, whether or not the audio clip exists

    By the way: getImages() (which does Toolkit.getDefaultToolkit().getImage()) works perfectly (if I commented downloadAudioClips() out)
    File permissions in the server are same for images and audio clips.

    As I said, the solution has been working fine for 5 years (approx. 2000 unique visitors every week).
    Now I found one computer (unfortunately it has to be my office machine :D) where it does not work.
    To make things more complicated - it works some times! (2 times a week or so).

    I guess it has to be something with my office computer's active protection software, firewall or something, but anyway - getAudioClips should never just hang.

    And if i'm having the problem, some of my clients might as well.


  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Rep Power

    Default Re: Trouble with Applet.getAudioClip

    Stick some more logging in the downloadAudioClips method so you can see exactly where it might be going wrong.
    Also you'll need to note the version of Java it is being run on, and the browser.
    Could be a Java bug.

  3. #3
    Meix is offline Member
    Join Date
    Jan 2012
    Rep Power

    Default Re: Trouble with Applet.getAudioClip

    Thanks, problem solved:

    I discovered that there were 4 JRE-s (JAVA 6 32 bit, JAVA7 64bit and so on) installed to this computer.

    I Uninstalled all the JRE-s and Installed 6_30.

    Now, everything works fine.

Similar Threads

  1. Java Applet trouble with Menus in Firefox on Mac
    By pseeburger in forum Java Applets
    Replies: 13
    Last Post: 04-28-2014, 12:44 PM
  2. Applet Trouble
    By Cosmos in forum New To Java
    Replies: 1
    Last Post: 09-20-2011, 06:14 AM
  3. Replies: 30
    Last Post: 08-26-2011, 09:05 PM
  4. applet working in applet viewer, not browser
    By plasticfood in forum Java Applets
    Replies: 4
    Last Post: 06-24-2011, 06:47 PM
  5. Replies: 4
    Last Post: 06-08-2007, 06:15 AM

Posting Permissions

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