声音播放
This commit is contained in:
parent
55094fc24d
commit
5f09d0646f
|
|
@ -17,8 +17,11 @@ class AndroidInterface(private val activity: MainActivity) {
|
|||
private var isSpeaking = false
|
||||
private var lastSpeakTime = 0L
|
||||
private val MIN_SPEAK_DURATION = 200L
|
||||
private var alertPlayer: android.media.MediaPlayer? = null
|
||||
private var alertPlayCount = 0
|
||||
|
||||
companion object {
|
||||
private var alertPlayer: android.media.MediaPlayer? = null
|
||||
private var alertPlayCount = 0
|
||||
}
|
||||
|
||||
/**
|
||||
* JS bridge 调度入口
|
||||
|
|
@ -540,6 +543,7 @@ class AndroidInterface(private val activity: MainActivity) {
|
|||
setVolume(volume, volume)
|
||||
setOnCompletionListener {
|
||||
alertPlayCount++
|
||||
Timber.tag("AlertPlayer").d("already alert play, count=$alertPlayCount")
|
||||
if (alertPlayCount < count) {
|
||||
try {
|
||||
it.start()
|
||||
|
|
|
|||
Loading…
Reference in New Issue