I wrote the code to play a sound, but you can read the file does not play, please help debug

Category: Java SE
 
bing5
2012-03-02 01:44:54

Sponsored Links
import sun.audio. *;
import java.net. *;
import java.io. *;
import java.io.FileInputStream;

public static void alertAudio (String fileName)
{
try {
; InputStream in = new FileInputStream (fileName);
AudioStream audio ; = new AudioStream (in);
AudioPlayer.player.start (audio);

}
catch (Exception e)
{
System.out.println (e);
;}

}

public static void main (String argv [])
{
String fileName = "test.au";
alertAudio (fileName);
System.out.println ("close");
}

Sponsored Links

waixingrenlaile
2012-03-02 01:51:25
open speaker yet? :)
What package you use ah?
liuxw1984
2012-03-02 02:08:06
sun.audio.
package
Domain and server ip had changed since 8/23/2013. Suspend the user registration and posts for program maintenance.