开发者

J2ME Mp3 player - playing mp3 files in loop

开发者 https://www.devze.com 2023-01-29 22:25 出处:网络
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

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

精彩评论

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