|
Re: Adding Sound to Application
|
Posted: Feb 22, 2004 11:47 PM
|
|
YES, you can add sound capabilities into your Java applets and/or applications using the Java Sound API.
The full featured Java Sound API is available as a core API in the Java 2 SDK, Standard Edition, v. 1.3 and above. The full featured Java Sound API is also available as part of the Java Media Framework 2.x for use on older JDK 1.x platforms.
Please note that the Java 2 Runtime Environment, Standard Edition, v. 1.3 release for Win32 does not include a soundbank. To use the software synthesizer with this release bundle, you must manually install a soundbank. For more information
Example: --------- import java.applet.*; import java.awt.*; import java.net.*;
public class MySound extends Applet implements Runnable { Thread th; AudioClip bounce; public void init() { setBackground (Color.blue); bounce = getAudioClip (getCodeBase(), "bounce.au"); } public void start () { th = new Thread (this); th.start (); } public void run () { while(true) { bounce.play(); } } } end of code....
Thanks Hope this may help..you... Viswa --------
|
|