|
|
@ -0,0 +1,27 @@ |
|
|
|
package com.icssoft.icspda.util; |
|
|
|
|
|
|
|
import android.content.Context; |
|
|
|
import android.media.AudioManager; |
|
|
|
import android.media.SoundPool; |
|
|
|
|
|
|
|
import com.icssoft.icspda.R; |
|
|
|
|
|
|
|
public class SoundPoolUtil { |
|
|
|
|
|
|
|
private static SoundPoolUtil soundPoolUtil; |
|
|
|
private SoundPool soundPool; |
|
|
|
|
|
|
|
private SoundPoolUtil(Context context){ |
|
|
|
soundPool = new SoundPool(10, AudioManager.STREAM_SYSTEM,0); |
|
|
|
//加载音频文件 |
|
|
|
// soundPool.load(context, R,1); |
|
|
|
} |
|
|
|
|
|
|
|
private static SoundPoolUtil getInstance(Context context){ |
|
|
|
if (soundPoolUtil == null){ |
|
|
|
soundPoolUtil = new SoundPoolUtil(context); |
|
|
|
} |
|
|
|
return soundPoolUtil; |
|
|
|
} |
|
|
|
|
|
|
|
} |