Hi Rooster13,
this might be a solution for you:
Code:
package com.company.j2me;
//#if polish.api.mmapi || polish.midp2
import javax.microedition.media.*;
//#endif
//#if polish.api.nokia-ui
import com.nokia.mid.sound.Sound;
//#endif
[...]
class MyMidlet extends MIDlet {
[...]
public void playSound() {
//#if polish.api.mmapi || polish.midp2
Player player = Manager.createPlayer( openMidiFile(), "audio/midi");
[...]
//#elif polish.api.nokia-ui
// here you could check if the device supports the WAV format
// with the preprocessing symbol "polish.audio.wav" by the way...
Sound sound = new Sound( loadWavFile(), Sound.FORMAT_WAV );
[...]
//#else
AlertType.INFO.playSound( this.display );
//#endif
}
}
This code assumes that you are using J2ME Polish:
http://www.j2mepolish.org.
Best regards,
Robert