• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

A Question on Applet Audioclips

 
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic