1.声明
private SoundPool sp;
private int soundID_1;
private int streamID_1;
2.创建
sp =new SoundPool(10, AudioManager.STREAM_MUSIC,0);
soundID_1 =sp.load(getApplicationContext(), R.raw.yinyue2,1);
3.播放
streamID_1 =sp.play(soundID_1,0.8f,0.8f,1, -1,1.0f);
4.释放资源
sp.release();
网友评论