The moose likes Swing / AWT / SWT and the fly likes Audio Clips in Applets Broken? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Audio Clips in Applets Broken?" Watch "Audio Clips in Applets Broken?" New topic

Audio Clips in Applets Broken?

Siegfried Heintze
Ranch Hand

Joined: Aug 11, 2000
Posts: 397
I'm trying to play an audio clip inside an applet. It works great inside the applet viewer using Java SE 1.3 to
compile it. It does not work at all when I upload it to
I thought it might be a problem with Sun's AWT so I uploaded two applets that are supposed to play The first applet is compiled with MS J++ v6 and the second one is
compiled with Sun's SE 1.3. I cannot get any sound from Netscape 4.75 or IE 5.5 using either applet.
When I use netscape 4.75 on either applet, (see I see it is trying to
13K (the size of Dogbrk.wav) and it stalls at 10% or 70%.
The attached code fragments show one of my attempts. I've tried every combination of the overloads for
getAudioClip and play that I can think of and none work.
void Load(){
clipName = txtClipName.getText();
URL url = new URL(clipName);// getCodeBase();
clip = getAudioClip(url);
catch( e){
label1.setText("e: "+e);
Inside the event handler:;
Siegfried Heintze
Ranch Hand

Joined: Aug 11, 2000
Posts: 397
Oopps -- my mistake. I did not mean to post this a second time.
I agree. Here's the link:
subject: Audio Clips in Applets Broken?
It's not a secret anymore!