• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to add sound to JApplet??

 
li qing
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can some1 gif me a idea of the souce code? is my following code right?
AudioClip mySong = getAudioClip(getDocumentBase(), "coke.mid");
mySong.play();
 
Rob Ross
Bartender
Posts: 2205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by right? Can you compile this successfully? If so then the compiler thinks it's "right."
Are you asking because it is not playing a sound? That could be caused by a number of things...either your soundcard is not set up, or another application is using it so it's "busy" and not available to your app, etc. If you have a specific problem playing sound try re-asking the question with more information.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic