Hi,
I'm trying to play an audio file in Nokia C5 using the J2ME Mobile Media API. The audio file is embedded in the jar file of the midlet. I have enabled warning sounds for the profile I'm using. In Nokia E52 the midlet displays "playing com.symbian.j2me.midp.runtimeV2.NativeInputStream@f044eaeb" and the audio plays without problems. In Nokia C5 the midlet displays "playing com.ibm.oti.vm.ZipStream@17671767" and I get no sound.
What could be the reason for this lack of audio in C5? Is there some new "known issue" like enable warning sounds?
- Juha
Code:package audiotest; import java.io.InputStream; import javax.microedition.lcdui.Display; import javax.microedition.lcdui.TextBox; import javax.microedition.media.Manager; import javax.microedition.media.Player; import javax.microedition.midlet.*; public class TestMidlet extends MIDlet { public void startApp() { TextBox tb = new TextBox("Message", "", 1000, 0); Display.getDisplay(this).setCurrent(tb); InputStream stream = getClass().getResourceAsStream("test.aac"); if (stream == null) { tb.setString("null stream"); return; } try { Player p = Manager.createPlayer(stream, "audio/aac"); p.prefetch(); p.realize(); p.start(); tb.setString("playing " + stream); } catch (Exception e) { tb.setString(e.toString()); } } public void pauseApp() { } public void destroyApp(boolean unconditional) { } }

Reply With Quote

