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.

feat: in Mac + Room the panel says when the room pauses for online speech, uses the Mac's mic, or needs the microphone

wquguru6f0da46c93ef
diff --git a/Resources/en.lproj/Localizable.strings b/Resources/en.lproj/Localizable.strings
index 940fe21..b59e1db 100644
--- a/Resources/en.lproj/Localizable.strings
+++ b/Resources/en.lproj/Localizable.strings
@@ -648,6 +648,8 @@
"标题" = "Title";
/* RoomMic */
+"线上有人说话时,先不听会议室" = "The room pauses while someone online speaks";
+"用 Mac 麦克风听会议室" = "Hearing the room with the Mac's mic";
"没有可用的麦克风" = "No microphone available";
/* SessionStore */
@@ -949,6 +951,9 @@
"电脑里 1 分钟没放出声音" = "Nothing has played on this Mac for a minute";
"改听会议室" = "Listen to the room";
"不是" = "No";
+"去设置" = "Open Settings";
+"听会议室要先允许麦克风" = "Allow the microphone to hear the room";
+"电脑声音照常在记" = "The Mac's audio is still being recorded";
"线上也有人?" = "Anyone online too?";
"%@ 正在通话" = "%@ is in a call";
"也听电脑" = "Hear the Mac too";
diff --git a/Resources/ja.lproj/Localizable.strings b/Resources/ja.lproj/Localizable.strings
index 445db99..d04b86f 100644
--- a/Resources/ja.lproj/Localizable.strings
+++ b/Resources/ja.lproj/Localizable.strings
@@ -648,6 +648,8 @@
"标题" = "タイトル";
/* RoomMic */
+"线上有人说话时,先不听会议室" = "オンラインの人が話す間は会議室を聞きません";
+"用 Mac 麦克风听会议室" = "会議室は Mac のマイクで聞きます";
"没有可用的麦克风" = "使用できるマイクがありません";
/* SessionStore */
@@ -949,6 +951,9 @@
"电脑里 1 分钟没放出声音" = "1 分間 Mac から音が出ていません";
"改听会议室" = "会議室を聞く";
"不是" = "いいえ";
+"去设置" = "設定を開く";
+"听会议室要先允许麦克风" = "会議室を聞くにはマイクを許可してください";
+"电脑声音照常在记" = "Mac の音声はそのまま記録中";
"线上也有人?" = "オンラインの参加者も?";
"%@ 正在通话" = "%@ で通話中";
"也听电脑" = "Mac も聞く";
diff --git a/Resources/ko.lproj/Localizable.strings b/Resources/ko.lproj/Localizable.strings
index 242c1aa..44879e2 100644
--- a/Resources/ko.lproj/Localizable.strings
+++ b/Resources/ko.lproj/Localizable.strings
@@ -648,6 +648,8 @@
"标题" = "제목";
/* RoomMic */
+"线上有人说话时,先不听会议室" = "온라인에서 말하는 동안 회의실은 잠시 듣지 않아요";
+"用 Mac 麦克风听会议室" = "회의실은 Mac 마이크로 들어요";
"没有可用的麦克风" = "사용할 수 있는 마이크가 없습니다";
/* SessionStore */
@@ -949,6 +951,9 @@
"电脑里 1 分钟没放出声音" = "1분 동안 Mac에서 소리가 나지 않았어요";
"改听会议室" = "회의실 듣기";
"不是" = "아니요";
+"去设置" = "설정 열기";
+"听会议室要先允许麦克风" = "회의실을 들으려면 마이크를 허용하세요";
+"电脑声音照常在记" = "Mac 소리는 계속 기록 중";
"线上也有人?" = "온라인 참석자도 있나요?";
"%@ 正在通话" = "%@ 통화 중";
"也听电脑" = "Mac도 듣기";
diff --git a/Resources/zh-Hans.lproj/Localizable.strings b/Resources/zh-Hans.lproj/Localizable.strings
index b104697..8e4af08 100644
--- a/Resources/zh-Hans.lproj/Localizable.strings
+++ b/Resources/zh-Hans.lproj/Localizable.strings
@@ -648,6 +648,8 @@
"标题" = "标题";
/* RoomMic */
+"线上有人说话时,先不听会议室" = "线上有人说话时,先不听会议室";
+"用 Mac 麦克风听会议室" = "用 Mac 麦克风听会议室";
"没有可用的麦克风" = "没有可用的麦克风";
/* SessionStore */
@@ -949,6 +951,9 @@
"电脑里 1 分钟没放出声音" = "电脑里 1 分钟没放出声音";
"改听会议室" = "改听会议室";
"不是" = "不是";
+"去设置" = "去设置";
+"听会议室要先允许麦克风" = "听会议室要先允许麦克风";
+"电脑声音照常在记" = "电脑声音照常在记";
"线上也有人?" = "线上也有人?";
"%@ 正在通话" = "%@ 正在通话";
"也听电脑" = "也听电脑";
diff --git a/Sources/Cicada/AppModel.swift b/Sources/Cicada/AppModel.swift
index 327ba86..6473b0e 100644
--- a/Sources/Cicada/AppModel.swift
+++ b/Sources/Cicada/AppModel.swift
@@ -85,6 +85,11 @@ final class AppModel: ObservableObject {
/// alone; its name for the grey line.
@Published var onlinePrompt: String?
private var callCheck: (at: Date, name: String?) = (.distantPast, nil)
+ /// 电脑和会议室 with the microphone not allowed: the Mac's side goes on, the room's can't start.
+ @Published var hybridMicDenied = false
+ /// HybridNote under 听哪里.
+ @Published var hybridNote: String?
+ private var headsetCheck: (at: Date, on: Bool) = (.distantPast, false)
/// Answered (or 听哪里 changed) in this meeting: not asked again until the next one.
var roomPromptDismissed = false
/// 线上也有人? answered this meeting. Its own flag: picking 会议室 by hand answers the question
@@ -393,6 +398,17 @@ final class AppModel: ObservableObject {
inCall: listen.macSilent && !(fakeCalls ?? MicUsers.currentCalls()).isEmpty)
if roomAsk != roomPrompt { roomPrompt = roomAsk }
updateOnlinePrompt()
+ let both = listen.isRunning && settings.hearsBoth && !Recognition.legacy
+ let denied = both && [.denied, .restricted].contains(AVCaptureDevice.authorizationStatus(for: .audio))
+ if denied != hybridMicDenied { hybridMicDenied = denied }
+ if both, Date().timeIntervalSince(headsetCheck.at) >= 2 {
+ let def = AudioDevices.defaultInput
+ let t = def.map { AudioDevices.transport($0.id) }
+ headsetCheck = (Date(), t == kAudioDeviceTransportTypeBluetooth || t == kAudioDeviceTransportTypeBluetoothLE)
+ }
+ let note = both ? HybridNote.line(roomRunning: roomListen.isRunning, echoCancelled: roomListen.hearsEchoCancelled,
+ headsetDefault: headsetCheck.on) : nil
+ if note != hybridNote { hybridNote = note }
if listen.modelProblem != modelProblem { modelProblem = listen.modelProblem }
if listen.blockedByModel != modelBlocked { modelBlocked = listen.blockedByModel }
let notInstalled = !ask.isEmpty && listen.mismatch && ask.allSatisfy { !listen.candidates.contains($0) }
diff --git a/Sources/Cicada/RoomMic.swift b/Sources/Cicada/RoomMic.swift
index 9677d6f..90a181e 100644
--- a/Sources/Cicada/RoomMic.swift
+++ b/Sources/Cicada/RoomMic.swift
@@ -96,6 +96,18 @@ enum RoomPrompt {
}
}
+/// The grey line under 听哪里 while listening to the Mac and the room: how the room is being heard
+/// when that isn't the plain case. Echo cancellation off comes first: it changes what gets recorded.
+enum HybridNote {
+ static func line(roomRunning: Bool, echoCancelled: Bool, headsetDefault: Bool) -> String? {
+ guard roomRunning else { return nil }
+ if !echoCancelled { return L("线上有人说话时,先不听会议室") }
+ // A Bluetooth headset is the default input: the room is heard by the Mac's own mic (RoomMicPlan).
+ if headsetDefault { return L("用 Mac 麦克风听会议室") }
+ return nil
+ }
+}
+
extension AudioDevices {
static func transport(_ device: AudioObjectID) -> UInt32 {
var value: UInt32 = 0
diff --git a/Sources/Cicada/Views.swift b/Sources/Cicada/Views.swift
index 68270a9..44dd787 100644
--- a/Sources/Cicada/Views.swift
+++ b/Sources/Cicada/Views.swift
@@ -189,6 +189,7 @@ struct MenuPanelView: View {
if model.running { LanguageNotice(model: model) }
if model.roomPrompt { roomPromptStrip }
if let app = model.onlinePrompt { onlinePromptStrip(app) }
+ if model.hybridMicDenied { hybridMicStrip }
AIServiceStrip(model: model, ling: model.ling)
// Right under the header: below the settings it was easy to miss.
UpdateBanner(updates: model.updates, model: model)
@@ -200,6 +201,10 @@ struct MenuPanelView: View {
+ (Recognition.legacy ? [] : [("both", L("电脑和会议室(线上和桌边的人都听)"))])) {
model.listenSourceSelection = $0
}
+ if let note = model.hybridNote {
+ Text(note).font(.system(size: 11)).foregroundStyle(Palette.tertiary)
+ .frame(maxWidth: .infinity, alignment: .leading).padding(.horizontal, 12)
+ }
ChoiceRow(label: L("听到"), value: heardValue.0, badge: heardValue.1, compact: true, sections: sourceSections) {
model.sourceSelection = $0
}
@@ -313,6 +318,22 @@ extension MenuPanelView {
}
}
+extension MenuPanelView {
+ /// 电脑和会议室 without the microphone: the Mac's side is still recorded.
+ var hybridMicStrip: some View {
+ HStack(spacing: 10) {
+ VStack(alignment: .leading, spacing: 2) {
+ Text("听会议室要先允许麦克风").font(.system(size: 13, weight: .semibold)).foregroundStyle(Palette.ink)
+ Text("电脑声音照常在记").font(.system(size: 11)).foregroundStyle(Palette.secondary)
+ }
+ Spacer(minLength: 0)
+ SoftButton(L("去设置"), dark: true) { model.openMicrophoneSettings() }
+ }
+ .padding(12).frame(maxWidth: .infinity, alignment: .leading)
+ .background(RoundedRectangle(cornerRadius: 11).fill(Palette.accentPale))
+ }
+}
+
extension MenuPanelView {
/// 线上也有人?: listening to the room while a meeting app here is in a call. Asked once a meeting.
func onlinePromptStrip(_ app: String) -> some View {
diff --git a/Tests/CicadaTests/HybridRecordTests.swift b/Tests/CicadaTests/HybridRecordTests.swift
new file mode 100644
index 0000000..8a0a08b
--- /dev/null
+++ b/Tests/CicadaTests/HybridRecordTests.swift
@@ -0,0 +1,38 @@
+import Foundation
+import Testing
+@testable import Cicada
+
+@Suite struct HybridRecordTests {
+ private func line(_ id: String, _ speaker: String = "them", via: String? = nil) -> TranscriptLine {
+ TranscriptLine(id: id, t: 0, speaker: speaker, src: "x", srcLang: "en", dstLang: "zh", via: via)
+ }
+
+ @Test func onlyAMeetingThatHeardBothShowsPlaces() {
+ #expect(!RecordList.heardBoth([line("a"), line("b")]))
+ #expect(!RecordList.heardBoth([line("a", via: "room"), line("b", via: "room")]))
+ // Your own lines (the talk key) don't make it a meeting that heard the Mac.
+ #expect(!RecordList.heardBoth([line("a", via: "room"), line("b", "me")]))
+ #expect(RecordList.heardBoth([line("a", via: "room"), line("b")]))
+ }
+
+ @Test func aChangeOfPlaceStartsANewRun() {
+ let ls = [line("a"), line("b"), line("c", via: "room"), line("d", "me"), line("e", via: "room"), line("f")]
+ #expect(RecordList.placeStarts(ls) == ["a", "c", "e", "f"])
+ }
+
+ @Test func onlinePromptAsksOnlyInTheRoomDuringACall() {
+ #expect(RoomPrompt.asksOnline(roomOnly: true, bothAvailable: true, answered: false, inCall: true))
+ #expect(!RoomPrompt.asksOnline(roomOnly: true, bothAvailable: true, answered: false, inCall: false))
+ #expect(!RoomPrompt.asksOnline(roomOnly: true, bothAvailable: true, answered: true, inCall: true))
+ // macOS 14/15 can't hear both: don't offer it.
+ #expect(!RoomPrompt.asksOnline(roomOnly: true, bothAvailable: false, answered: false, inCall: true))
+ #expect(!RoomPrompt.asksOnline(roomOnly: false, bothAvailable: true, answered: false, inCall: true))
+ }
+
+ @Test func noteSaysHowTheRoomIsHeard() {
+ #expect(HybridNote.line(roomRunning: true, echoCancelled: true, headsetDefault: false) == nil)
+ #expect(HybridNote.line(roomRunning: false, echoCancelled: false, headsetDefault: true) == nil)
+ #expect(HybridNote.line(roomRunning: true, echoCancelled: false, headsetDefault: true) == L("线上有人说话时,先不听会议室"))
+ #expect(HybridNote.line(roomRunning: true, echoCancelled: true, headsetDefault: true) == L("用 Mac 麦克风听会议室"))
+ }
+}
diff --git a/site/changelog.json b/site/changelog.json
index 8b2a568..a55be69 100644
--- a/site/changelog.json
+++ b/site/changelog.json
@@ -77,6 +77,14 @@
],
"title": "听会议室时会议软件开始通话,知了会问要不要也听电脑。",
"text": "点“也听电脑”就改成电脑和会议室,同一场会议接着记;一场只问一次,macOS 14/15 不问。"
+ },
+ {
+ "kind": "improved",
+ "platforms": [
+ "mac"
+ ],
+ "title": "电脑和会议室时,面板会说明会议室是怎么听的。",
+ "text": "回声消除用不了时写“线上有人说话时,先不听会议室”;戴着蓝牙耳机时写“用 Mac 麦克风听会议室”;没允许麦克风时提示去设置,电脑声音照常在记。"
}
]
},