diff --git a/app/src/main/java/com/icssoft/icspda/util/SoundPoolUtil.java b/app/src/main/java/com/icssoft/icspda/util/SoundPoolUtil.java new file mode 100644 index 0000000..b384a29 --- /dev/null +++ b/app/src/main/java/com/icssoft/icspda/util/SoundPoolUtil.java @@ -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; + } + +}