I am trying to play the mp3 file in WTK 2.1... I am unable to do so. I am able to play only the .wav and .midi files. I am using only the media API in the MIDP , i m not using the MM API.
heres the code ------------------------------
public class m4 extends MIDlet { public m4() { }
public void startApp() { try {
InputStream is=getClass().getResourceAsStream("a.mp3"); Player p = Manager.createPlayer(is,"audio/mpeg"); p.realize(); p.prefetch(); p.start();
If I remember right, default MIDP API supports only tones and MIDI. If you need to play MP3, you need to have the appropriate Java codec to play it. You'll probably have to initialize it using Player or Manager classes. There is no out-of-the-box support for MP3 in MIDP.