嗨,有人知道如何在 J2ME 中自动循环播放 mp3 文件列表吗?如果你有请分享代码...
问问题
1796 次
1 回答
1
您可以使用它来播放 .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
于 2010-12-24T10:49:54.260 回答