Java me J2ME Mp3播放器-循环播放Mp3文件
嗨,有人知道如何在J2ME中自动循环播放mp3文件列表吗?如果您有…,请共享代码。您可以使用它来播放.mp3或.wav文件Java me J2ME Mp3播放器-循环播放Mp3文件,java-me,j2mepolish,Java Me,J2mepolish,嗨,有人知道如何在J2ME中自动循环播放mp3文件列表吗?如果您有…,请共享代码。您可以使用它来播放.mp3或.wav文件 Player p; InputStream is = getClass().getResourceAsStream(SoundName[sound]); try { p = Manager.createPlayer(is, "audio/X-wav"); p.start(); is.cl
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
您可以使用它来播放.mp3或.wav文件
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