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();
0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact