import javax.microedition.media.*; import javax.microedition.io.*; import java.io.*; public class AudioPlayer{ public static void play(String nameFile,String typeMusicFile,int numberLoop){ try{ InputStream inputStream= Connector.openInputStream(nameFile); Player player=Manager.createPlayer(inputStream,typeMusicFile); player.setLoopCount(numberLoop); player.prefetch(); player.start(); }catch(Exception e){} } }