tags:

views:

131

answers:

1
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();
  }
}

In Eclipse applet viewer it loads and doesn't play sound. In html it doesn't load and says start not initalized. I've tried calling it outside of init, and all that someone help me!!!

A: 

Have you tried slightly longer example programs like http://www.iam.ubc.ca/guides/javatut99/sound/playing.html ?

joeforker