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: clicking Start listening shows the Live notes window right away instead of waiting for someone to speak

wquguru277df6ce1690
diff --git a/Sources/Cicada/AppModel.swift b/Sources/Cicada/AppModel.swift
index 223437f..3fda3a5 100644
--- a/Sources/Cicada/AppModel.swift
+++ b/Sources/Cicada/AppModel.swift
@@ -480,7 +480,9 @@ final class AppModel: ObservableObject {
// MARK: Start / stop
- func start() {
+ /// `byUser`: started by a click or ⌘R, so the notes window shows at once as the sign that
+ /// 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 }
let session = store.begin()
diagnostics.begin()
@@ -502,7 +504,7 @@ final class AppModel: ObservableObject {
if settings.listensToRoom { store.markLiveInRoom() }
notes.begin(session.id)
if listen.isRunning {
- showDisplay()
+ showDisplay(force: byUser)
} else {
store.end()
}
@@ -532,7 +534,7 @@ final class AppModel: ObservableObject {
updates.notifyIfDue() // held while the meeting was on
}
- func setRunning(_ on: Bool) { on ? start() : requestStop() }
+ func setRunning(_ on: Bool) { on ? start(byUser: true) : requestStop() }
/// The menu (⌘R) and the panel switch: a meeting with lines is ended only after asking, with
/// "继续记录" as the default so a stray Return keeps it going. An empty one just stops.
@@ -645,7 +647,7 @@ final class AppModel: ObservableObject {
if settings.displayMode == "notes" { notesWindow.show() }
}
- /// `force`: the user asked for this mode, show it even before anyone speaks.
+ /// `force`: the user asked for this mode or started listening, show it even before anyone speaks.
private func showDisplay(force: Bool = false) {
switch settings.displayMode {
case "bar":
@@ -1299,7 +1301,8 @@ final class AppModel: ObservableObject {
let parts = cmd.split(separator: ":", maxSplits: 1).map(String.init)
let arg = parts.count > 1 ? parts[1] : ""
switch parts.first ?? "" {
- case "start": start()
+ // start:user is a click on 开始听; plain start is listening starting by itself.
+ case "start": start(byUser: arg == "user")
case "models":
// models:<installed,…>/<system languages,…> pretends the Mac has only these speech models
// and languages, to test the fetch of a second model and 听不出; models:off ends it.
diff --git a/Sources/Cicada/NotesWindow.swift b/Sources/Cicada/NotesWindow.swift
index 3e57a6e..d6e044f 100644
--- a/Sources/Cicada/NotesWindow.swift
+++ b/Sources/Cicada/NotesWindow.swift
@@ -562,7 +562,7 @@ struct NotesWindowView: View {
model.openMainWindow?()
}
}
- SoftButton(session == nil ? L("开始记录") : L("开始新会议"), dark: true) { model.start() }
+ SoftButton(session == nil ? L("开始记录") : L("开始新会议"), dark: true) { model.start(byUser: true) }
}
}
.frame(maxWidth: .infinity, alignment: .leading)
diff --git a/site/changelog.json b/site/changelog.json
index a964989..6c88f20 100644
--- a/site/changelog.json
+++ b/site/changelog.json
@@ -107,6 +107,14 @@
],
"title": "Android 悬浮窗加了回到知了的按钮。",
"text": "点悬浮窗顶上的按钮,直接回到正在听的页面,看完整纪要或结束会议。"
+ },
+ {
+ "kind": "improved",
+ "platforms": [
+ "mac"
+ ],
+ "title": "Mac 上点开始听,实时纪要窗口马上出现。",
+ "text": "不用等有人开口才知道已经在听;开机或会议软件来电时自动开始,仍等第一句话再出现。"
}
]
},
diff --git a/tools/README.md b/tools/README.md
index f036a1f..de868d3 100644
--- a/tools/README.md
+++ b/tools/README.md
@@ -6,7 +6,7 @@
编译:`swiftc -O lsctl.swift -o lsctl`(其他几个文件同理)。
- `lsctl <命令>`:通过分布式通知 `com.wquguru.cicada.debug` 遥控 App。
- - 开关字幕:`start` / `stop`
+ - 开关字幕:`start` / `stop`(`start:user` 当作用户点了开始听,纪要窗口立即出现;`start` 当作自动开始,等到有人说话)
- 听哪里:`listenSource:<system|room>`(room 用麦克风听会议室,日志里 `room mic started: <设备>`,念译文时 `room mic muted` / `open`),`roomPrompt:<room|no>` 等于在“在会议室里开会?”里点“改听会议室”或“不是”(听电脑 60 秒没声音才出现,日志 `mac silent true`)
- 打开界面:`open`(主窗口)、`panel`(菜单栏面板)、`settings[:speak]`(设置,可指定栏目)
- 虚拟麦克风:`micTest` 试音(往虚拟麦克风播一句再听回来,结果写进日志),`micNext` 做清单里的下一步