Browse Source

修改讯飞语音识别

weicu
tanlongsheng 10 months ago
parent
commit
cbcf16afcf
  1. 6
      local_plugins/azure_speech/android/src/main/kotlin/com/yunqiinnovation/azure_speech/XunFeiAsrHelper.kt

6
local_plugins/azure_speech/android/src/main/kotlin/com/yunqiinnovation/azure_speech/XunFeiAsrHelper.kt

@ -187,13 +187,9 @@ class XunFeiAsrHelper(private val context: Context) {
if (st.optInt("type") == 0) { if (st.optInt("type") == 0) {
callback.onResult(currentSessionId, resultTextTemp, detectedLanguage) callback.onResult(currentSessionId, resultTextTemp, detectedLanguage)
currentSessionId = "" currentSessionId = UUID.randomUUID().toString()
lastIntermediateResult = "" lastIntermediateResult = ""
} else { } else {
if (currentSessionId.isEmpty()) {
currentSessionId = UUID.randomUUID().toString()
callback.onSessionStarted(currentSessionId)
}
lastIntermediateResult = resultTextTemp lastIntermediateResult = resultTextTemp
callback.onRecognizing(currentSessionId, resultTextTemp, detectedLanguage) callback.onRecognizing(currentSessionId, resultTextTemp, detectedLanguage)
} }

Loading…
Cancel
Save