Browse Source

修改讯飞语音识别

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

6
local_plugins/agent_service/android/src/main/kotlin/com/yunqiinnovation/agent_service/AgentService.kt

@ -721,7 +721,11 @@ object AgentService : CoroutineScope {
if (currsessionAsrId.isEmpty()) {
currsessionAsrId = sessionid
}
recognitionResult += result
var text = result
if(recognitionResult.isEmpty()) {
text = text.replace(Regex("^[,。?、!, . ? !]+"), "")
}
recognitionResult += text
if (currentRecognitionMode == "push_to_talk") { //按住说话
sendEvent(
"recognizing", mapOf(

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

@ -187,6 +187,7 @@ class XunFeiAsrHelper(private val context: Context) {
}
if (ls && wordCount == 0 && punctuationCount == 1) {
callback.onSessionStopped(currentSessionId)
return
}

Loading…
Cancel
Save