Skip to content

知了 Cicada · 任何会议和直播的实时字幕、同声传译、AI 会议纪要,Mac、Windows、Linux、Android 免费开源。Live subtitles, interpreting and meeting notes for any call or stream, on Mac, Windows, Linux and Android.

chore: lsctl talkDown/talkUp hold the talk key with the real mic, and the log says how much the on-device recognizer and Ming each heard

wquguru805475b3179c
diff --git a/Sources/Cicada/AppModel.swift b/Sources/Cicada/AppModel.swift
index 181b20b..7cb1bce 100644
--- a/Sources/Cicada/AppModel.swift
+++ b/Sources/Cicada/AppModel.swift
@@ -1936,6 +1936,9 @@ final class AppModel: ObservableObject {
case "speakOff": enableSpeaking(false)
case "speakOut": speak.debugOutputURL = arg.isEmpty ? nil : URL(fileURLWithPath: arg)
case "speakFile": speak.speakFile(URL(fileURLWithPath: arg))
+ // talkDown / talkUp: the talk key held and let go, with the real microphone (audio tests).
+ case "talkDown": speak.pressBegan()
+ case "talkUp": speak.pressEnded()
case "speakVP": speak.echoCancel = arg != "off"
case "voiceMicRun":
// voiceMicRun:<on|off> runs the echo-cancelling unit with nobody listening (what it does to the rest).
diff --git a/Sources/Cicada/SpeakEngine.swift b/Sources/Cicada/SpeakEngine.swift
index 5a8c09c..46e6a8e 100644
--- a/Sources/Cicada/SpeakEngine.swift
+++ b/Sources/Cicada/SpeakEngine.swift
@@ -490,6 +490,7 @@ final class SpeakEngine {
volatile = ""
if !text.isEmpty { onLive?(.translating, text, "") }
let heard = await ming.value
+ debugLog("speak: on-device heard \(text.count) chars, Ming \(heard.map { "\($0.original.count)" } ?? "-") chars")
if let heard { text = heard.original }
// Ming answers recognition and translation together: its whole call counts as `recognize`.
let textAt = Date()