File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes A Question on Applet Audioclips Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Applets
Reply Bookmark "A Question on Applet Audioclips" Watch "A Question on Applet Audioclips" New topic
Author

A Question on Applet Audioclips

Andres Delrotti
Ranch Hand

Joined: Aug 11, 2005
Posts: 98
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

Joined: Jan 16, 2001
Posts: 421
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
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: A Question on Applet Audioclips
 
Similar Threads
The GUI Thread.
playing sounds using Applet class
Small sound problem with applet
Stopping an audio file
Sound not loading