pull/1344/head
gedoor 3 years ago
parent 5711f09cc7
commit ab13bcca05
  1. 3
      app/src/main/java/io/legado/app/help/MediaHelp.kt
  2. 5
      app/src/main/java/io/legado/app/service/TTSReadAloudService.kt

@ -57,6 +57,9 @@ object MediaHelp {
return request == AudioManager.AUDIOFOCUS_REQUEST_GRANTED
}
/**
* 播放静音音频,用来获取音频焦点
*/
fun playSilentSound(mContext: Context) {
kotlin.runCatching {
// Stupid Android 8 "Oreo" hack to make media buttons work

@ -147,6 +147,11 @@ class TTSReadAloudService : BaseReadAloudService(), TextToSpeech.OnInitListener
}
}
override fun onAudioAvailable(utteranceId: String?, audio: ByteArray?) {
super.onAudioAvailable(utteranceId, audio)
}
override fun onError(s: String) {
//nothing
}

Loading…
Cancel
Save