diff --git a/app/src/main/java/io/legado/app/service/ReadAloudService.kt b/app/src/main/java/io/legado/app/service/ReadAloudService.kt index c6c2cec12..5e4638dc1 100644 --- a/app/src/main/java/io/legado/app/service/ReadAloudService.kt +++ b/app/src/main/java/io/legado/app/service/ReadAloudService.kt @@ -125,7 +125,6 @@ class ReadAloudService : BaseService(), TextToSpeech.OnInitListener, private lateinit var audioManager: AudioManager private lateinit var mFocusRequest: AudioFocusRequest private var broadcastReceiver: BroadcastReceiver? = null - private var speak: Boolean = true private var nowSpeak: Int = 0 private val contentList = arrayListOf() private var readAloudNumber: Int = 0 @@ -147,7 +146,6 @@ class ReadAloudService : BaseService(), TextToSpeech.OnInitListener, } initMediaSession() initBroadcastReceiver() - upMediaSessionPlaybackState(PlaybackStateCompat.STATE_PLAYING) upSpeechRate() ReadAloudNotification.upNotification(this) } @@ -363,7 +361,7 @@ class ReadAloudService : BaseService(), TextToSpeech.OnInitListener, } private fun pauseReadAloud(pause: Boolean) { - if (pause) postEvent(Bus.ALOUD_STATE, Status.PAUSE) + postEvent(Bus.ALOUD_STATE, Status.PAUSE) this.pause = pause textToSpeech?.stop() upMediaSessionPlaybackState(PlaybackStateCompat.STATE_PAUSED)