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(mic): open the room microphone when the user starts a meeting

clementchen0d9296cdc4ce
diff --git a/Resources/en.lproj/Localizable.strings b/Resources/en.lproj/Localizable.strings
index 92a82fb..fcab506 100644
--- a/Resources/en.lproj/Localizable.strings
+++ b/Resources/en.lproj/Localizable.strings
@@ -1515,3 +1515,7 @@
"已认出 %@" = "Recognized %@";
"这次不再按声纹认人" = "Stop recognizing by voice for this meeting";
"知道了" = "OK";
+
+/* Microphone on start */
+"开始听时打开麦克风" = "Open the microphone when listening starts";
+"关掉后只听电脑声音;开会时再手动打开" = "Off: only the Mac's audio; open it by hand when a meeting starts";
diff --git a/Resources/ja.lproj/Localizable.strings b/Resources/ja.lproj/Localizable.strings
index 4e66226..66b5875 100644
--- a/Resources/ja.lproj/Localizable.strings
+++ b/Resources/ja.lproj/Localizable.strings
@@ -1515,3 +1515,7 @@
"已认出 %@" = "%@ を認識しました";
"这次不再按声纹认人" = "この会議では声紋による認識を解除";
"知道了" = "わかりました";
+
+/* Microphone on start */
+"开始听时打开麦克风" = "聞き始めるときにマイクを開く";
+"关掉后只听电脑声音;开会时再手动打开" = "オフ: Mac の音だけを聞き、会議のときに手動で開きます。";
diff --git a/Resources/ko.lproj/Localizable.strings b/Resources/ko.lproj/Localizable.strings
index f6c7d15..1417a41 100644
--- a/Resources/ko.lproj/Localizable.strings
+++ b/Resources/ko.lproj/Localizable.strings
@@ -1515,3 +1515,7 @@
"已认出 %@" = "%@ 인식됨";
"这次不再按声纹认人" = "이번 회의에서는 음성 지문 인식을 해제";
"知道了" = "확인";
+
+/* Microphone on start */
+"开始听时打开麦克风" = "듣기 시작할 때 마이크 켜기";
+"关掉后只听电脑声音;开会时再手动打开" = "끄면 Mac 소리만 듣고, 회의할 때 직접 켭니다.";
diff --git a/Resources/zh-Hans.lproj/Localizable.strings b/Resources/zh-Hans.lproj/Localizable.strings
index 0291692..a15b0c2 100644
--- a/Resources/zh-Hans.lproj/Localizable.strings
+++ b/Resources/zh-Hans.lproj/Localizable.strings
@@ -1423,3 +1423,7 @@
"已认出 %@" = "已认出 %@";
"这次不再按声纹认人" = "这次不再按声纹认人";
"知道了" = "知道了";
+
+/* Microphone on start */
+"开始听时打开麦克风" = "开始听时打开麦克风";
+"关掉后只听电脑声音;开会时再手动打开" = "关掉后只听电脑声音;开会时再手动打开";
diff --git a/Sources/Cicada/AppModel.swift b/Sources/Cicada/AppModel.swift
index fa00246..ceb2afc 100644
--- a/Sources/Cicada/AppModel.swift
+++ b/Sources/Cicada/AppModel.swift
@@ -729,6 +729,12 @@ final class AppModel: ObservableObject {
/// listening began. Starting by itself (launch, a meeting app's call) waits for the first words.
func start(byUser: Bool = false) {
guard !listen.isRunning else { return }
+ // Starting by hand means the meeting is here now: open the room microphone too, unless
+ // this Mac is only ever used for online meetings (设置 › 通用). Launch still stays silent.
+ if byUser, settings.autoMicOnStart, settings.listenSource == "system" {
+ settings.listenSource = Recognition.legacy ? "room" : "both"
+ debugLog("mic auto-on: user started listening")
+ }
let session = store.begin()
diagnostics.begin()
speakers.reset()
diff --git a/Sources/Cicada/Settings.swift b/Sources/Cicada/Settings.swift
index 7e709fe..d1837e9 100644
--- a/Sources/Cicada/Settings.swift
+++ b/Sources/Cicada/Settings.swift
@@ -252,6 +252,11 @@ final class AppSettings: ObservableObject {
@Published var listenSource: String {
didSet { save() }
}
+ /// 开始听时打开麦克风: a user-started meeting hears the room as well as the Mac. Off for
+ /// online-only meetings; launch still never opens the microphone by itself.
+ @Published var autoMicOnStart: Bool {
+ didSet { save() }
+ }
/// The microphone chosen beside 打开麦克风, by UID; empty is 自动. Never the system default's.
@Published var roomMicUID: String {
didSet { save() }
@@ -318,6 +323,7 @@ final class AppSettings: ObservableObject {
silenceEnd = defaults.string(forKey: "silenceEnd") ?? "prompt"
silenceMinutes = defaults.object(forKey: "silenceMinutes") as? Double ?? 10
listenSource = ["room", "both"].contains(defaults.string(forKey: "listenSource")) ? defaults.string(forKey: "listenSource")! : "system"
+ autoMicOnStart = defaults.object(forKey: "autoMicOnStart") as? Bool ?? true
roomMicUID = defaults.string(forKey: "roomMicUID") ?? ""
diagnostics = defaults.object(forKey: "diagnostics") as? Bool ?? DevBuild.isDev
notesCapturable = defaults.bool(forKey: "notesCapturable")
@@ -381,6 +387,7 @@ final class AppSettings: ObservableObject {
defaults.set(silenceEnd, forKey: "silenceEnd")
defaults.set(silenceMinutes, forKey: "silenceMinutes")
defaults.set(listenSource, forKey: "listenSource")
+ defaults.set(autoMicOnStart, forKey: "autoMicOnStart")
defaults.set(roomMicUID, forKey: "roomMicUID")
defaults.set(diagnostics, forKey: "diagnostics")
defaults.set(notesCapturable, forKey: "notesCapturable")
diff --git a/Sources/Cicada/SettingsWindow.swift b/Sources/Cicada/SettingsWindow.swift
index b562a1b..5ee5c79 100644
--- a/Sources/Cicada/SettingsWindow.swift
+++ b/Sources/Cicada/SettingsWindow.swift
@@ -731,6 +731,10 @@ struct SettingsView: View {
Toggle("保存会议录音", isOn: $settings.recordAudio)
.toggleStyle(.switch).labelsHidden().controlSize(.small).tint(Palette.ink)
}
+ SettingsRow(title: L("开始听时打开麦克风"), detail: L("关掉后只听电脑声音;开会时再手动打开")) {
+ Toggle("开始听时打开麦克风", isOn: $settings.autoMicOnStart)
+ .toggleStyle(.switch).labelsHidden().controlSize(.small).tint(Palette.ink)
+ }
SettingsRow(title: L("说话人识别"), detail: L("按声音标出说话人 1、2…,只在这台 Mac 上处理")) {
Toggle("说话人识别", isOn: $settings.speakerVoices)
.toggleStyle(.switch).labelsHidden().controlSize(.small).tint(Palette.ink)