Results 1 to 3 of 3
Thread: Trouble with Applet.getAudioClip
- 01-20-2012, 01:22 PM #1
Member
- Join Date
- Jan 2012
- Posts
- 2
- Rep Power
- 0
Trouble with Applet.getAudioClip
Hi,
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.
Best,
Meix
- 01-20-2012, 01:42 PM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
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.
- 01-20-2012, 06:41 PM #3
Member
- Join Date
- Jan 2012
- Posts
- 2
- Rep Power
- 0
Similar Threads
-
Java Applet trouble with Menus in Firefox on Mac
By pseeburger in forum Java AppletsReplies: 12Last Post: 06-04-2012, 10:09 AM -
Applet Trouble
By Cosmos in forum New To JavaReplies: 1Last Post: 09-20-2011, 06:14 AM -
Java Applet starts then the applet field goes light blue
By oki in forum Java AppletsReplies: 30Last Post: 08-26-2011, 09:05 PM -
applet working in applet viewer, not browser
By plasticfood in forum Java AppletsReplies: 4Last Post: 06-24-2011, 06:47 PM -
Applet, To center text and To open I engage in a dialog in an Applet
By Marcus in forum Java AppletsReplies: 4Last Post: 06-08-2007, 06:15 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks