Using the Mobile Media API, how do you play a sound file that comes in the JAR?

John Zukowski

You need to know the mime type of the audio file and pass it as a stream to the Player object.

InputStream is = getClass().getResourceAsStream("/example.wav");
Player player = Manager.createPlayer(is, "audio/x-wav");
player.start();
About | Sitemap | Contact