开发者

J2ME Mp3 player - playing mp3 files in loop

Hi any one knows how to play list of mp3 files in a loop automatically in J2ME? Please share code if u have.开发者_Go百科..


you can use this to play an .mp3 or .wav file

Player p;
InputStream is = getClass().getResourceAsStream(SoundName[sound]);
        try {
            p = Manager.createPlayer(is, "audio/X-wav");
            p.start();
            is.close();
            is = null;
        } catch (IOException ex) {
            ex.printStackTrace();
        } catch (MediaException ex) {
            ex.printStackTrace();
        }

p.setLoopCount(100);//using this you can play the sound in loop 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜