From 92ef84083050e99023e538d291592ee0d0d8851a Mon Sep 17 00:00:00 2001 From: FoxV Date: Mon, 28 Nov 2022 14:26:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8F=90=E4=BA=A4=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E9=9F=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../icssoft/icspda/util/SoundPoolUtil.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 app/src/main/java/com/icssoft/icspda/util/SoundPoolUtil.java 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; + } + +}