我正在J2ME中开发游戏,并且在游戏中使用4个不同的sound(midi)文件。当我在诺基亚设备上运行此游戏时,它显示too many players prefetched
异常。在三星中运行正常。如何解决呢?
最佳答案
我遇到了同样的问题,解决了实现PlayerListener并在播放后释放声音的问题:
playbackPlayer = Manager.createPlayer(ttsConnection.getFileUrl());
PlayerListener pl = new PlayerListener() {
public void playerUpdate(Player player, String event, Object eventData) {
if (event.equalsIgnoreCase(PlayerListener.END_OF_MEDIA)
|| event.equalsIgnoreCase(PlayerListener.STOPPED)) {
player.close();
}
}
};
playbackPlayer.addPlayerListener(pl);