|
|
@ -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) |
|
|
} |
|
|
} |
|
|
|