Hello all, I have a little problem, I try a program to play a midi file,
and even though it works in the emulator, it is not working when I
donwnload it to the mobile. Any idea??
This is the code I use:
import com.nttdocomo.ui.*;
import com.nttdocomo.io.*;
public class clase1 extends IApplication{
public void start(){
sonido miSonido = new sonido();
}
}
class sonido {
class eventosSonido implements MediaListener {
public void mediaAction(MediaPresenter source, int type, int
param) {
if (source == Bs) {
switch(type) {
case AudioPresenter.AUDIO_COMPLETE:
silencio = true;
}
}
}
}
private AudioPresenter Bs;
private boolean silencio = true;
public sonido(){
MediaSound s;
s = MediaManager.getSound("resource:///nolandies3.mid");
try{
s.use();
}catch (ConnectionException e){}
Bs = AudioPresenter.getAudioPresenter();
Bs.setMediaListener(new eventosSonido());
Bs.setSound(s);
silencio = false;
Bs.play();
while (silencio == false) {}
Bs.play();
}
}
Received on Thu Feb 26 18:10:19 2004