|
|
@ -125,7 +125,6 @@ class ReadAloudService : BaseService(), TextToSpeech.OnInitListener, |
|
|
|
private lateinit var audioManager: AudioManager |
|
|
|
private lateinit var audioManager: AudioManager |
|
|
|
private lateinit var mFocusRequest: AudioFocusRequest |
|
|
|
private lateinit var mFocusRequest: AudioFocusRequest |
|
|
|
private var broadcastReceiver: BroadcastReceiver? = null |
|
|
|
private var broadcastReceiver: BroadcastReceiver? = null |
|
|
|
private var speak: Boolean = true |
|
|
|
|
|
|
|
private var nowSpeak: Int = 0 |
|
|
|
private var nowSpeak: Int = 0 |
|
|
|
private val contentList = arrayListOf<String>() |
|
|
|
private val contentList = arrayListOf<String>() |
|
|
|
private var readAloudNumber: Int = 0 |
|
|
|
private var readAloudNumber: Int = 0 |
|
|
@ -147,7 +146,6 @@ class ReadAloudService : BaseService(), TextToSpeech.OnInitListener, |
|
|
|
} |
|
|
|
} |
|
|
|
initMediaSession() |
|
|
|
initMediaSession() |
|
|
|
initBroadcastReceiver() |
|
|
|
initBroadcastReceiver() |
|
|
|
upMediaSessionPlaybackState(PlaybackStateCompat.STATE_PLAYING) |
|
|
|
|
|
|
|
upSpeechRate() |
|
|
|
upSpeechRate() |
|
|
|
ReadAloudNotification.upNotification(this) |
|
|
|
ReadAloudNotification.upNotification(this) |
|
|
|
} |
|
|
|
} |
|
|
@ -363,7 +361,7 @@ class ReadAloudService : BaseService(), TextToSpeech.OnInitListener, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun pauseReadAloud(pause: Boolean) { |
|
|
|
private fun pauseReadAloud(pause: Boolean) { |
|
|
|
if (pause) postEvent(Bus.ALOUD_STATE, Status.PAUSE) |
|
|
|
postEvent(Bus.ALOUD_STATE, Status.PAUSE) |
|
|
|
this.pause = pause |
|
|
|
this.pause = pause |
|
|
|
textToSpeech?.stop() |
|
|
|
textToSpeech?.stop() |
|
|
|
upMediaSessionPlaybackState(PlaybackStateCompat.STATE_PAUSED) |
|
|
|
upMediaSessionPlaybackState(PlaybackStateCompat.STATE_PAUSED) |
|
|
|