• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

reg audioclip

 
Prabhu Raghunathan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
public void sayIt(Applet app){
String english = num.toEnglish();
StringTokenizer ST = new StringTokenizer(english);
do {
String token = ST.nextToken();

String audio = "http://www.cs.wustl.edu/~sck/504/current-semester/lab/lab4/audio/";
(app.getAudioClip(newURL(audio+token+".au"))).play();
}
while(ST.hasMoreTokens());
}
private URL newURL(String str)
{
URL url = null;
try {
url = new URL(str);
System.out.println("tok");
}
catch(MalformedURLException murle)
{
System.exit(0);
}
return url;
}
Hi all,
On implementing this piece of code it compiles fine.But I get a runtime error saying sun.applet.AppletSecurityException:checkconnect.networkhost1.I dont understand why this happens.Thanks.
Prabhu.R
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Applet security, an Applet can only establish a connect back to the server that initiated it. This prevents a rogue applet from performing operations on a computer which could be dangerous or comprimise the computers security.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic