我正在开发一款游戏,每次摇晃手机时都会播放一个声音。在我的activity的onCreate中使用SoundPool并加载声音是否有意义,或者每次都创建一个媒体播放器是否可以,如下所示:
private void onShake() {
MediaPlayer mp= MediaPlayer.create(this, whipSound[currentWhip][force]);
mp.start();
}
我的猜测是 SoundPool 更好,因为声音只加载一次。我对吗?
谢谢
朱利安