import java.applet.*;
/**
* SoundApplet.java - a simple applet that plays the "gong.au" sound file.
*/
public class AppletGame extends Applet
{
public void init()
{
super.init();
resize(0,0);
AudioClip gong = getAudioClip(getDocumentBase(), "test0.au");
gong.play();
}
}
在 Eclipse applet 查看器中,它会加载但不播放声音。在 html 中,它无法加载并显示启动未初始化。我尝试过在 init 之外调用它,并且有人帮助我!!!
最佳答案
您是否尝试过稍长的示例程序,例如 http://www.iam.ubc.ca/guides/javatut99/sound/playing.html ?
关于java - 简单的 Java Sound Applet 无法工作! ARG!,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1399421/