[6.7.2][Fix]解决科大讯飞收费版发音人过期不播报的问题
This commit is contained in:
@@ -38,6 +38,8 @@ class IFlyTekTts : IMogoTTS, InitListener {
|
||||
|
||||
private var voicer: String = "x4_lingxiaoying_en"
|
||||
private var voicerEntries: Array<String>? = null
|
||||
@Volatile
|
||||
private var isExpire = false
|
||||
|
||||
// 等级由低到高为0、1、2、3,默认为-1表示没有正在tts的
|
||||
private var curTtsLevel = -1
|
||||
@@ -305,6 +307,11 @@ class IFlyTekTts : IMogoTTS, InitListener {
|
||||
}
|
||||
curTtsEntity = null
|
||||
curTtsContent = ""
|
||||
if (error.errorCode == 11200) {
|
||||
isExpire = true
|
||||
voicer = "xiaoyan"
|
||||
updateTtsParam()
|
||||
}
|
||||
}
|
||||
|
||||
private val ttsListener = object : SynthesizerListener {
|
||||
@@ -386,10 +393,14 @@ class IFlyTekTts : IMogoTTS, InitListener {
|
||||
|
||||
private fun updateVoicer(language: LanguageType) {
|
||||
voicerEntries?.let {
|
||||
voicer = when (language) {
|
||||
LanguageType.ENGLISH -> it[5]
|
||||
LanguageType.KOREAN -> it[6]
|
||||
else -> it[0]
|
||||
if (!isExpire) {
|
||||
voicer = when (language) {
|
||||
LanguageType.ENGLISH -> it[5]
|
||||
LanguageType.KOREAN -> it[6]
|
||||
else -> it[0]
|
||||
}
|
||||
} else {
|
||||
voicer = "xiaoyan"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user