|
|
|
@ -734,11 +734,18 @@ object AgentService : CoroutineScope { |
|
|
|
// 保存识别结果 |
|
|
|
if (currentRecognitionMode == "push_to_talk") { //按住说话 |
|
|
|
recognitionResult += result |
|
|
|
sendEvent( |
|
|
|
"recognizing", mapOf( |
|
|
|
"sessionid" to currsessionId, |
|
|
|
"text" to recognitionResult, |
|
|
|
"language" to detectedLanguage |
|
|
|
) |
|
|
|
) |
|
|
|
}else{ |
|
|
|
recognitionResult += result |
|
|
|
pendingProcessJob?.cancel() |
|
|
|
pendingProcessJob = launch { |
|
|
|
delay(1000) |
|
|
|
delay(2000) |
|
|
|
if (recognitionResult.isNotEmpty()) { |
|
|
|
sendEvent( |
|
|
|
"recognition_result", mapOf( |
|
|
|
|