Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A Question on Applet Audioclips

 
Andres Delrotti
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Javaranch......I have a problem....

I think my question would be more appropriate on this category and not the JSP category since playing sound files and applets are related with each other.

I have an application which has a JSP page which refreshes every minute. What I would like to do is play a beep sound to inform the user that the page has reloaded itself. What's the proper way to open and run a .wav sound file to be able to play the beep sound everytime my page refreshes? I've researched for some code snippets on the net and all of them pointed to the fact that if I wanna play sound files, it should be opened and played in an applet running on a thread. What if I wanted it to be played in a JSP page? I need to embed the applet in it?

I tried running this piece of code on the main method of a test class I created the test class for testing playing sound files and I runned this class in eclipse.

Audioclip audioClip = Applet.newAudioClip(new URL("file:C:\\testsounds\\beep.wav"));
audioClip.play();
Thread.sleep(1000);
audioClip.stop();

After the main methods ended, I noticed through the debug mode in Eclipse that there are still threads running even though the main method has finished executing. I already What are those threads that are still running? Is it the thread of my delay method?
 
Peter Gragert
Ranch Hand
Posts: 424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
maybe you should use the debug-mode of Eclipse, there you
can get more info about the threads,
you see them coming and going e.g. and more!
Peter
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic