Seeking to play a sound code? Thanks! ! ! !

Category: Java SE
 
shimin126
2013-08-20 06:04:07

Sponsored Links

I checked a lot of information, all about the applet to play a sound, please help me to find in the application code to play sounds, thank you! ! ! !

Sponsored Links

chinazhaok
2013-08-20 06:11:28
import sun.audio. *;
import java.io. *;
try
{

InputStream in = new FileInputStream ("D: \ \ temp \ \ TestSnd.wav");

; AudioStream as = new AudioStream (in);
AudioPlayer.player.start (as);
AudioPlayer.player.stop (as);

}
catch (Exception e)
; {
e.printStackTrace ();
}
Domain and server ip had changed since 8/23/2013. Suspend the user registration and posts for program maintenance.