知了 Cicada · 任何会议和直播的实时字幕、同声传译、AI 会议纪要,Mac、Windows、Linux、Android 免费开源。Live subtitles, interpreting and meeting notes for any call or stream, on Mac, Windows, Linux and Android.
Swift androidlinuxlive-captionsmacosmeeting-notesmenubar-appsimultaneous-interpretationspeech-recognitionsubtitlesswiftswiftuitranslationwindows
fix: with the mic on, holding the talk key no longer garbles what you say or keeps your voice from reaching the meeting
wqugurufa1677edfca6
diff --git a/Sources/Cicada/AppModel.swift b/Sources/Cicada/AppModel.swiftindex 21c38d5..864d9ea 100644--- a/Sources/Cicada/AppModel.swift+++ b/Sources/Cicada/AppModel.swift@@ -180,6 +180,10 @@ final class AppModel: ObservableObject {updates.busy = { [weak self] in guard let self else { return false }; return self.running || self.speak.phase != .idle }// Words in the Mac's audio: speech, which the room mic is silenced for (music isn't, `EchoGate`).listen.onWords = { [gate = roomListen.echoGate] in gate.heardWords() }+ speak.micTaken = { [weak self] in+ guard let self else { return false }+ return self.roomListen.holdsPlainMic || self.listen.holdsPlainMic+ }roomListen.onStateChange = { [weak self] in self?.refresh() }listen.onSubtitle = { [weak self] src, dst inguard let self else { return }diff --git a/Sources/Cicada/ListenEngine.swift b/Sources/Cicada/ListenEngine.swiftindex 0202078..abac400 100644--- a/Sources/Cicada/ListenEngine.swift+++ b/Sources/Cicada/ListenEngine.swift@@ -523,6 +523,9 @@ final class ListenEngine {/// or when the unit can't be had, the plain mic is gated while the Mac plays speech (`gateEcho`).var echoCancelled = truevar voiceMic: VoiceMic?+ /// Whether the plain room mic is open: the echo-cancelling unit would starve it, so it lets the+ /// unit go each time it starts (`startRoomMic`).+ var holdsPlainMic: Bool { isRunning && audioTap is RoomMic }/// Whether the room is heard through the echo-cancelling unit right now.var hearsEchoCancelled: Bool { audioTap is EchoCancelledRoomMic }/// The microphone hearing the room right now, to notice it going away (nil: the default input).diff --git a/Sources/Cicada/SpeakEngine.swift b/Sources/Cicada/SpeakEngine.swiftindex 46e6a8e..14ff3df 100644--- a/Sources/Cicada/SpeakEngine.swift+++ b/Sources/Cicada/SpeakEngine.swift@@ -117,7 +117,10 @@ final class SpeakEngine {}/// The real mic to cancel the echo for; nil when it is unknown or virtual (nothing to cancel there).private var echoInput: AudioObjectID? {- guard let d = inputDevice?(), !d.isVirtualMic else { return nil }+ // The plain room mic open: the unit readied after each press made it start again, which+ // gave the unit back, and every restart churned the system audio tap and the voice output+ // too, so later presses lost most of what was said and voices didn't reach the meeting.+ guard micTaken?() != true, let d = inputDevice?(), !d.isVirtualMic else { return nil }return d.id}private let micQueue = DispatchQueue(label: "com.wquguru.cicada.mic", qos: .userInitiated)@@ -128,6 +131,8 @@ final class SpeakEngine {private var finals: [String] = []private var volatile = ""private var pressStarted = Date()+ /// Whether the plain room mic holds the mic (打开麦克风 without echo cancellation).+ var micTaken: (() -> Bool)?private nonisolated(unsafe) var micRecorder: AVAudioFile?private nonisolated(unsafe) var micRecordURL: URL?/// This press's audio as 16 kHz mono 16-bit samples for Ming; only touched on `micQueue`.diff --git a/site/changelog.json b/site/changelog.jsonindex 35fcb39..42f7347 100644--- a/site/changelog.json+++ b/site/changelog.json@@ -6,6 +6,14 @@"summary": "刚开完会就换 AI 服务时,设置里不再把连不上的新服务显示成已连接;长会议生成完整纪要时,不再丢掉某个话题;AI 服务一直出错时会提示;Windows、Linux、Android 上开头轻声的一句短话不再被漏掉;真实麦克风和虚拟麦克风格式不同时,按住说话不再闪退。","image": null,"items": [+ {+ "kind": "fixed",+ "platforms": [+ "mac"+ ],+ "title": "打开麦克风时按住说话键,说的话不再只被听到一半,译文的声音也能传进会议了。",+ "text": ""+ },{"kind": "fixed","platforms": [