/* iアプリ, MIDP でのサウンド Time-stamp: "2003/11/19 Wed 22:48 hig" Saburo Higuchi 2003 http://www.math.ryukoku.ac.jp/~hig/ プログラム解説等 http://sparrow.math.ryukoku.ac.jp/~hig/course/juniors_2003/08/ */ import javax.microedition.midlet.*; import javax.microedition.lcdui.*; import com.jblend.media.smaf.phrase.*; /** IApplication または MIDlet を継承するクラス */ public class SoundSample extends MIDlet { /** 起動するときに呼ばれる メソッド. 必須. */ public void startApp(){ SoundCanvas cc = new SoundCanvas(this); Display.getDisplay(this).setCurrent(cc); } public void pauseApp(){} public void destroyApp(boolean unconditional){} } class SoundCanvas extends Canvas implements PhraseTrackListener { MIDlet parent; String message="012を押してね"; final int nfile=3; String [] filename; int initial=1; Phrase [] ms; PhraseTrack [] tr; PhrasePlayer ap; SoundCanvas(MIDlet parent){ this.parent=parent; ap= PhrasePlayer.getPlayer(); ms = new Phrase[nfile]; tr = new PhraseTrack[nfile]; // サウンドファイルの読み込み filename = new String [nfile]; filename[0]="jb2001.spf"; filename[1]="jse103.spf"; filename[2]="jse2107.spf"; try { for(int i=0; i