View Single Post
  #1 (permalink)  
Old 07-09-2007, 11:58 AM
Bagesh Bagesh is offline
Member
 
Join Date: Jul 2007
Posts: 1
Bagesh is on a distinguished road
Playing sound in applet??????
Hi,

Demo program given below is supposed to play sound.
--------------------------
import java.net.*;
import java.applet.*;

public class Sound2 {
public static void main(String a[]) throws java.net.MalformedURLException, InterruptedException {
URL url = new URL("http://simplythebest.net/sounds/WAV/WAV_files/cartoon_WAV_files/aladdin_goodbye.wav");
AudioClip clip = Applet.newAudioClip(url);
clip.play();
Thread.sleep(10000);
}
}
-------------------------------------------------------------
Is it possible to play (online .wav file) sound in Applet using URL Like
(http://simplythebest.net/sounds/WAV/...in_goodbye.wav)

Although I have tried

URL ur=new URL("file:\\C:\\Demo\\abc.wav");
AudioClip clip =Applet.newAudioClip(ur);
It's working fine
but while using URL "http://simplythebest.net/sounds/WAV/WAV_files/cartoon_WAV_files/aladdin_goodbye.wav" i can't hear any sound.


Actually i want to play "http://" URL file directly in applet
Please help me.

Last edited by Bagesh : 07-09-2007 at 12:21 PM.
Reply With Quote
Sponsored Links