























@@ -50,9 +50,9 @@ class MicCaptureManager(
5050) {
5151companion object {
5252private const val tag = "MicCapture"
53-private const val speechMinSessionMs = 30_000L
54-private const val speechCompleteSilenceMs = 1_500L
55-private const val speechPossibleSilenceMs = 900L
53+private const val speechMinSessionMs = 30_000
54+private const val speechCompleteSilenceMs = 1_500
55+private const val speechPossibleSilenceMs = 900
5656private const val transcriptIdleFlushMs = 1_600L
5757private const val maxConversationEntries = 40
5858private const val pendingRunTimeoutMs = 45_000L
@@ -625,8 +625,8 @@ class MicCaptureManager(
625625when (error) {
626626SpeechRecognizer.ERROR_AUDIO -> "Audio error"
627627SpeechRecognizer.ERROR_CLIENT -> "Client error"
628-SpeechRecognizer.ERROR_NETWORK -> "Network error"
629-SpeechRecognizer.ERROR_NETWORK_TIMEOUT -> "Network timeout"
628+SpeechRecognizer.ERROR_NETWORK -> "Speech network error"
629+SpeechRecognizer.ERROR_NETWORK_TIMEOUT -> "Speech network timeout"
630630SpeechRecognizer.ERROR_NO_MATCH -> "Listening"
631631SpeechRecognizer.ERROR_RECOGNIZER_BUSY -> "Recognizer busy"
632632SpeechRecognizer.ERROR_SERVER -> "Server error"
@@ -638,8 +638,6 @@ class MicCaptureManager(
638638SpeechRecognizer.ERROR_TOO_MANY_REQUESTS -> "Speech requests limited; retrying"
639639else -> "Speech error ($error)"
640640 }
641-_statusText.value = status
642-643641if (
644642 error == SpeechRecognizer.ERROR_INSUFFICIENT_PERMISSIONS ||
645643 error == SpeechRecognizer.ERROR_LANGUAGE_NOT_SUPPORTED ||
@@ -654,9 +652,17 @@ class MicCaptureManager(
654652SpeechRecognizer.ERROR_NO_MATCH,
655653SpeechRecognizer.ERROR_SPEECH_TIMEOUT,
656654-> 1_200L
655+SpeechRecognizer.ERROR_AUDIO,
656+SpeechRecognizer.ERROR_CLIENT,
657+SpeechRecognizer.ERROR_NETWORK,
658+SpeechRecognizer.ERROR_NETWORK_TIMEOUT,
659+SpeechRecognizer.ERROR_RECOGNIZER_BUSY,
660+SpeechRecognizer.ERROR_SERVER,
661+SpeechRecognizer.ERROR_SERVER_DISCONNECTED,
657662SpeechRecognizer.ERROR_TOO_MANY_REQUESTS -> 2_500L
658663else -> 600L
659664 }
665+_statusText.value = if (status == "Listening") status else "$status · retrying"
660666 scheduleRestart(delayMs = restartDelayMs)
661667 }
662668此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。