|
|
@ -570,17 +570,24 @@ object AgentService : CoroutineScope { |
|
|
if (isActive && isRecognitionActive && !isTtsSpeaking && !isAiStreaming) { |
|
|
if (isActive && isRecognitionActive && !isTtsSpeaking && !isAiStreaming) { |
|
|
Log.d(TAG, "空闲检测触发自动停止,模式: $currentRecognitionMode") |
|
|
Log.d(TAG, "空闲检测触发自动停止,模式: $currentRecognitionMode") |
|
|
BleService.closeCodec() |
|
|
BleService.closeCodec() |
|
|
if (mode != "phone_call"){ |
|
|
if (currentRecognitionMode != "phone_call"){ |
|
|
stopRecognition() |
|
|
stopRecognition() |
|
|
} |
|
|
} |
|
|
sendEvent( |
|
|
sendEvent( |
|
|
"auto_stop", |
|
|
"recognition_result", mapOf( |
|
|
mapOf( |
|
|
"sessionid" to currsessionAsrId, |
|
|
"reason" to "idle_timeout", |
|
|
"text" to recognitionResult, |
|
|
"seconds" to idleSeconds, |
|
|
// "language" to detectedLanguage |
|
|
"mode" to currentRecognitionMode |
|
|
|
|
|
) |
|
|
) |
|
|
) |
|
|
) |
|
|
|
|
|
// sendEvent( |
|
|
|
|
|
// "auto_stop", |
|
|
|
|
|
// mapOf( |
|
|
|
|
|
// "reason" to "idle_timeout", |
|
|
|
|
|
// "seconds" to idleSeconds, |
|
|
|
|
|
// "mode" to currentRecognitionMode |
|
|
|
|
|
// ) |
|
|
|
|
|
// ) |
|
|
} |
|
|
} |
|
|
} catch (e: CancellationException) { |
|
|
} catch (e: CancellationException) { |
|
|
// 协程被取消,正常行为 |
|
|
// 协程被取消,正常行为 |
|
|
|