Distributed Tone : Tones « J2ME « Java Tutorial






import javax.microedition.media.Manager;
import javax.microedition.media.Player;
import javax.microedition.midlet.MIDlet;

public class DistributedToneMIDlet extends MIDlet {

  private Player tonePlayer;
  
  public DistributedToneMIDlet() {
    try {
      tonePlayer = Manager.createPlayer(getClass().getResourceAsStream(
        "/x.jts"), "audio/x-tone-seq");
    } catch(Exception e) {
      System.err.println(e);
    }
  }
  
  public void startApp() {
    try {
      if(tonePlayer != null)
        tonePlayer.start();
    } catch(Exception e) {
      System.err.println(e);
    }
  }
  
  public void pauseApp() {
  }
  
  public void destroyApp(boolean unconditional) {
  }
}








31.49.Tones
31.49.1.Play tone
31.49.2.Play CSharp
31.49.3.Distributed Tone