GeeCON Prague 2014*
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
Author

Audio Clips in Applets Broken?

Siegfried Heintze
Ranch Hand

Joined: Aug 11, 2000
Posts: 381
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 http://216.121.166.169/index.html.
I thought it might be a problem with Sun's AWT so I uploaded two applets that are supposed to play
http://216.121.166.169/Dogbrk.wav. 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 http://216.121.166.169/index.html) I see it is trying to
download
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();
label1.setText("");
try{
URL url = new URL(clipName);// getCodeBase();
clip = getAudioClip(url);
}
catch(java.net.MalformedURLException e){
label1.setText("e: "+e);
}
-----------------------------------------------------------
Inside the event handler:
clip.play();
Siegfried Heintze
Ranch Hand

Joined: Aug 11, 2000
Posts: 381
Oopps -- my mistake. I did not mean to post this a second time.
 
GeeCON Prague 2014
 
subject: Audio Clips in Applets Broken?