SoundPool简单实用

1.

SoundPool soundPool = new SoundPool(1, AudioManager.STREAM_SYSTEM, 10);
		
int hit1 = soundPool.load(myContext, R.raw.btn_sound1, 0);//加载音频文件
		
int hit2 = soundPool.load(myContext, R.raw.btn_sound2, 0);
		
int hit3 = soundPool.load(myContext, R.raw.btn_sound3, 0);


2.

soundPool.play(hit2, 2, 1, 0, 0, (float)1.4);//播放


就这么简单
 

你可能感兴趣的:(SoundPool)