I got problem about play wav file in my application.
This is my error:
java.lang.IllegalArgumentException
at javax.microedition.media.Manager.createPlayer(), bci=8
at Tajwid.Tajwid.run(Tajwid.java:649)
at Tajwid.Tajwid.actionPerformed(Tajwid.java:186)
at com.sun.lwuit.util.EventDispatcher.fireActionSync(), bci=19
at com.sun.lwuit.util.EventDispatcher.fireActionEvent(EventDispatcher.java:257)
This is my code:
public void run() { try { InputStream is = getClass().getResourceAsStream("/tes.wav"); player = Manager.createPlayer(is, "audio/x-wav"); player.realize(); // get volume control for player and set volume to max vc = (VolumeControl) player.getControl("VolumeControl"); if (vc != null) { vc.setLevel(100); } player.prefetch(); player.start(); } catch (Exception e) { e.printStackTrace(); }
Device Configuration : CLDC-1.1
Device Profile MIDP 2.0