|
|
@@ -90,7 +90,6 @@ class CountdownDialog : DialogFragment() {
|
|
|
/**
|
|
|
* 初始化定时器
|
|
|
*/
|
|
|
- @RequiresApi(Build.VERSION_CODES.N)
|
|
|
private fun initTimer() {
|
|
|
rxTimer = RxTimer()
|
|
|
val m: Long = 1000
|
|
|
@@ -101,8 +100,8 @@ class CountdownDialog : DialogFragment() {
|
|
|
"1" -> {
|
|
|
imageCountdown!!.setBackgroundResource(R.mipmap.icon_one)
|
|
|
imageCountdown!!.post {
|
|
|
- val wavFile = resources.openRawResourceFd(R.raw.one)
|
|
|
- voicePlayer?.play(wavFile) {
|
|
|
+ val wavFile = resources.assets.openFd("one.wav")
|
|
|
+ voicePlayer?.playByLocation(wavFile) {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
@@ -110,8 +109,8 @@ class CountdownDialog : DialogFragment() {
|
|
|
"2" -> {
|
|
|
imageCountdown!!.setBackgroundResource(R.mipmap.icon_two)
|
|
|
imageCountdown!!.post {
|
|
|
- val wavFile = resources.openRawResourceFd(R.raw.two)
|
|
|
- voicePlayer?.play(wavFile) {
|
|
|
+ val wavFile = resources.assets.openFd("two.wav")
|
|
|
+ voicePlayer?.playByLocation(wavFile) {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
@@ -119,8 +118,8 @@ class CountdownDialog : DialogFragment() {
|
|
|
"3" -> {
|
|
|
imageCountdown!!.setBackgroundResource(R.mipmap.icon_three)
|
|
|
imageCountdown!!.post {
|
|
|
- val wavFile = resources.openRawResourceFd(R.raw.three)
|
|
|
- voicePlayer?.play(wavFile) {
|
|
|
+ val wavFile = resources.assets.openFd("three.wav")
|
|
|
+ voicePlayer?.playByLocation(wavFile) {
|
|
|
|
|
|
}
|
|
|
}
|