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: name each meeting from its notes

wquguruecb12ecae9b6
diff --git a/AGENTS.md b/AGENTS.md
index ba04b21..25b7fe2 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -11,7 +11,7 @@ Cicada (知了, formerly Live Subs) is a macOS menu bar app that turns whatever
- Subtitle bar: shows only while someone talks (auto) or always; tucks into a dot after 2/4/8 s of quiet; fades to 15% and stays click-through while the pointer passes over it; editable after the pointer rests 0.6 s (drag to move, drag the corner to scale, double-click resets); ⌃⌥S (changeable) cycles the display mode (notes → bar → none). Position, width and size are remembered per display.
- Speaking: hold the right ⌥ key alone (a listen-only event tap, needs Input Monitoring; any other key while held cancels the press as a chord) or a user-chosen combination (Carbon hotkey, no permission) → microphone → with a usable Ling key the press (16 kHz WAV, ≤ 60 s) goes to `Ming-3.0-audio-flash` in one `.speak` request that returns `ORIGINAL:` / `TRANSLATION:` lines (`TranslationService.interpret`; anything else is dropped, since the model sometimes answers a question instead of interpreting it; ~2 s, names right). One `SpeechAnalyzer` per press always runs too, finished with `finalizeAndFinishThroughEndOfInput`: it shows the words while held and is the fallback transcript, translated into the room's language by the usual chain → voice → the chosen output device (a virtual microphone). The virtual microphone is BlackHole 2ch, installed from the app: download the official notarized package, check its pinned SHA-256, run `installer` and restart `coreaudiod` in one standard administrator prompt (the package only copies the driver and asks for a reboot; Core Audio loads a new HAL plug-in only when it restarts). Then a loopback sound test: speak a fixed English phrase into the device, record its input side, transcribe it (`LoopbackTest`). The checklist UI (`MicSetupCard`) is shared by onboarding step 3 and settings. We never bundle the GPL driver.
- AI (Ling, ant-ling.com, OpenAI-compatible): one user key for the whole app, for now in a 0600 file `ling-api-key` in the app's Application Support folder, excluded from backups (`AIKey`; never in UserDefaults, logs or exports; ad-hoc signing makes the Keychain ask for the password after every rebuild or update, so it moves back to the Keychain once builds have a Developer ID; a key in the old Keychain item, service = bundle id + `.ai`, is moved over once), checked with a one-token `Ling-3.0-tiny` call. `LingClient` is the single gate for every call: request *starts* ≥ 0.6 s apart (the account allows ~2 requests/s across all models), waiting requests ordered speak-back > translation > notes; notes retry 429 with 1/2/4/8 s backoff, translation and speak-back fail fast to the next translator; 401 marks the key invalid. Every call sends `thinking: disabled`, puts the content in the **system** message and a fixed instruction in the user message (otherwise question-like text gets a search-grounded essay instead), and drops replies with no `finish_reason` or starting 根据现有检索证据.
-- Live notes (`NotesEngine`, UI-free): about every 45 s with new lines, one JSON call sends the current notes + new lines (`[L12 02:03 对方] …`) and gets the whole notes back (summary, ≤ 8 topics with points and an optional fishbone, conclusions/to-dos with evidence line ids → support counts, terms with misrecognised forms); a bad reply never replaces good notes. A final pass over the whole transcript runs when the meeting ends ("完整版"). Notes are written in the 纪要语言 (`AppModel.notesLanguageCode`): the reader's language by default (the translate-to choice, or Chinese when Chinese is among the system languages), or the meeting's own; one meeting can differ (`notesLanguageFor`, the notes window's "EN → 中" chip, an inline card since a popover closes at once in the non-activating panel; changing it mid-meeting rewrites the notes from scratch, `NotesEngine.rewrite`). The language is stated again at the end of the prompt and in the user message, and a reply not in it (`NotesEngine.written`, CJK share) is retried once on the final pass, otherwise dropped: the final pass has no Chinese notes to follow, and a long English transcript pulls it into English. Stored as `notes` in `session.json`; finished meetings without notes can generate them from the main window. Speak-back voices (`Voices.swift`, settings UI `VoicePicker.swift` on the 同声传译 page): one choice per room language (`speakVoices`, "en" → `ming:US_Emma` / `system:<AVSpeechSynthesisVoice id>` / `clone`). Offered: hand-picked Ming voices (English Emma/George/Charlotte; Chinese 小雅/小棠/小锋/卓然; ja/ko/de/fr/es via Emma/George with `language_id`) and the Mac's best female and male voice; default is Ming's first with a key, else the Mac's. `clone` is the user's own voice: a 8–30 s recording read from a passage in their language (16 kHz WAV + its on-device transcript in `voice/` under Application Support, 0600, out of backups), sent to Ming as `references` with every sentence (~600 KB, first audio ~3 s, ~8 s on a cold call; a foreign language keeps the speaker's accent). Ming's voices fall back to the Mac's voice without a usable key or when the stream fails; previews play on the default output, not the room.0-tts-0.5B`, SSE PCM 24 kHz) through the same key, falling back to the system voice.
+- Live notes (`NotesEngine`, UI-free): about every 45 s with new lines, one JSON call sends the current notes + new lines (`[L12 02:03 对方] …`) and gets the whole notes back (a meeting name — shown as "<date> <name>" via `Session.displayTitle` unless the user renamed it —, summary, ≤ 8 topics with points and an optional fishbone, conclusions/to-dos with evidence line ids → support counts, terms with misrecognised forms); a bad reply never replaces good notes. A final pass over the whole transcript runs when the meeting ends ("完整版"). Notes are written in the 纪要语言 (`AppModel.notesLanguageCode`): the reader's language by default (the translate-to choice, or Chinese when Chinese is among the system languages), or the meeting's own; one meeting can differ (`notesLanguageFor`, the notes window's "EN → 中" chip, an inline card since a popover closes at once in the non-activating panel; changing it mid-meeting rewrites the notes from scratch, `NotesEngine.rewrite`). The language is stated again at the end of the prompt and in the user message, and a reply not in it (`NotesEngine.written`, CJK share) is retried once on the final pass, otherwise dropped: the final pass has no Chinese notes to follow, and a long English transcript pulls it into English. Stored as `notes` in `session.json`; finished meetings without notes can generate them from the main window. Speak-back voices (`Voices.swift`, settings UI `VoicePicker.swift` on the 同声传译 page): one choice per room language (`speakVoices`, "en" → `ming:US_Emma` / `system:<AVSpeechSynthesisVoice id>` / `clone`). Offered: hand-picked Ming voices (English Emma/George/Charlotte; Chinese 小雅/小棠/小锋/卓然; ja/ko/de/fr/es via Emma/George with `language_id`) and the Mac's best female and male voice; default is Ming's first with a key, else the Mac's. `clone` is the user's own voice: a 8–30 s recording read from a passage in their language (16 kHz WAV + its on-device transcript in `voice/` under Application Support, 0600, out of backups), sent to Ming as `references` with every sentence (~600 KB, first audio ~3 s, ~8 s on a cold call; a foreign language keeps the speaker's accent). Ming's voices fall back to the Mac's voice without a usable key or when the stream fails; previews play on the default output, not the room.0-tts-0.5B`, SSE PCM 24 kHz) through the same key, falling back to the system voice.
- Live notes window (`NotesWindow`): opens at the first words of a meeting (system audio or a talk press; `AppModel.heardSpeech`), or at once when the user picks it; a floating `NSPanel`, `sharingType = .none` (invisible to screen sharing and screenshots), on all Spaces, frame autosaved; < 360 px a card that offers what the notes added since it was collapsed ("收起后新增 …", only when there is something), tabs 纪要 / 文字记录 in between, both side by side from 760 px; a 结束 button while live (asks in an inline strip once there are lines; `AppModel.requestStop` asks with an alert for ⌘R and the panel switch, 继续记录 the default), then an ended strip (final-pass state, 在会议记录中查看, 开始新会议); `FirstClickHostingView` so a click works without focusing the panel first; banners for no key (inline key entry) / invalid key / rate limited. While writing: sound bars before anyone speaks, a spinner with "已听到 N 句" and shimmering placeholders for the first version, an "正在更新" pill and a warm shimmer under the current topic for later updates (`TimelineView`, since the window redraws every second). Transcript: oldest first, follows the newest line plus the sentence still being spoken; following survives content and window height changes, and only a real scroll-wheel/trackpad event (`UserScroll`) followed by scrolling up pauses it and gathers new lines into a "↓ N 句新内容" button; search highlights in place (query plus the notes' misheard forms of a name). Notes carry times: points and conclusions get the time of their first evidence line (`pointTimes`, `NoteItem.t`; carried over when the model echoes a point without evidence), topics show ranges.
- App menu (`AppMenu`): the app is a regular app (name and menus top left, Dock, ⌘Tab) while the main, settings or onboarding window is visible, and an accessory otherwise (`AppDelegate.updateActivationPolicy`). The notes window doesn't count: it is a non-activating panel, so clicking it never takes focus from the meeting app or brings our other windows forward; it becomes key only for its text fields. Opening the app by hand shows the main window (not when started as a login item); the Dock icon brings back whichever windows are open (the main window only when none is); quitting while a meeting with lines is being recorded asks first; exports are a sheet on the window they were asked from. The settings window remembers its frame and last tab (`settingsSection`). Menus: app, 纪要, 显示 (display mode, ⌘1–⌘3 sizes, 始终置顶), 编辑 (standard responder-chain actions, so ⌘V works in fields; ⌘F search), 窗口, 帮助.
- Meeting records: one folder per meeting, `session.json` + `system.m4a` (+ `mic.m4a`); empty meetings are dropped; export to Markdown, Word (`.docx` via `NSAttributedString`, both starting with the notes) and SRT. Speaker labels are only "对方" (system audio) and "你" (microphone): no diarization yet.
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5735de1..6dd9f49 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,7 @@ the release workflow publishes it as the release notes.
## Unreleased
+- New: meetings name themselves. The notes give each meeting a short name in the notes language, and the records list, the page title and exports show the date and that name ("11月1日 Lumen 发布与结账转化问题讨论") instead of "会议 11月1日 20:16". A title you typed is kept; 恢复自动标题 in the list's right-click menu brings the automatic one back.
- New: Settings › 语言 puts every language choice in one place, under a line that reads the whole route ("对方说 English → 字幕 简体中文 · 纪要 简体中文 / 你说 中文 → 对方听到 English"): what the other side speaks, what the subtitles show (原文 + 译文 / 只看译文 / 只看原文 — the last translates nothing and uses no Ling quota; also in the menu bar panel), what to translate into, the notes language (你的语言 or the meeting's own), and the speak-back pair. 显示 and 同声传译 no longer hold these.
- New: an "EN → 中" chip in the live notes window changes the subtitles and notes language for this meeting only; a new notes language rewrites the notes right away. After a meeting, "改用 English 重新整理" writes its notes again in the other language.
- Fixed: the full notes written when a long meeting in another language ended came out in that language (English) instead of yours, while the live notes were right. The notes language is now stated where the model reads it last, and a reply in the wrong language is retried once, then dropped in favour of the live notes.
diff --git a/Sources/LiveSubs/AppModel.swift b/Sources/LiveSubs/AppModel.swift
index 58500b9..32e6637 100644
--- a/Sources/LiveSubs/AppModel.swift
+++ b/Sources/LiveSubs/AppModel.swift
@@ -611,7 +611,7 @@ final class AppModel: ObservableObject {
}
let panel = NSSavePanel()
let ext = kind == "word" ? "docx" : kind == "srt" ? "srt" : "md"
- panel.nameFieldStringValue = "\(session.title).\(ext)"
+ panel.nameFieldStringValue = "\(session.displayTitle.replacingOccurrences(of: "/", with: "-")).\(ext)"
panel.canCreateDirectories = true
if let w = NSApp.keyWindow, !(w is NSPanel), w.isVisible {
panel.beginSheetModal(for: w) { [weak self] r in
diff --git a/Sources/LiveSubs/Notes.swift b/Sources/LiveSubs/Notes.swift
index 216953f..7cebdb1 100644
--- a/Sources/LiveSubs/Notes.swift
+++ b/Sources/LiveSubs/Notes.swift
@@ -5,6 +5,8 @@ import Foundation
/// Meeting notes kept with the session (`session.json` › `notes`). Written by Ling while the
/// meeting runs ("速记版") and rewritten once over the whole transcript when it ends ("完整版").
struct MeetingNotes: Codable, Equatable {
+ /// A short name for the meeting in the notes' language (absent in older notes).
+ var title: String?
var summary = ""
var topics: [NoteTopic] = []
var conclusions: [NoteItem] = []
@@ -234,6 +236,8 @@ final class NotesEngine: ObservableObject {
return
}
Self.carryTimes(from: base, into: &next)
+ // A reply without a name keeps the last one (not after a language change).
+ if next.title == nil, !fresh { next.title = (id == shownID ? notes : session.notes)?.title }
next.covered = lines.count
next.updatedAt = Date()
next.final = final
@@ -316,13 +320,15 @@ final class NotesEngine: ObservableObject {
Return the full notes as one JSON object with exactly these keys:
- {"summary": "2-3 sentences on the whole meeting so far",
+ {"title": "the meeting's name: what it is about, a few words",
+ "summary": "2-3 sentences on the whole meeting so far",
"topics": [{"start": seconds, "title": "short title", "summary": "one sentence", "points": [{"text": "key point", "evidence": ["L4"]}], "evidence": ["L3"],
"fishbone": null or {"question": "the problem or question", "branches": [{"label": "2-6 words", "detail": "one short line", "t": seconds, "evidence": ["L5"]}]}}],
"conclusions": [{"text": "...", "evidence": ["L7", "L8"]}],
"todos": [{"text": "...", "owner": "对方" or "你" or null, "evidence": ["L9"]}],
"terms": [{"name": "correct spelling", "note": "who or what, a few words", "heard": ["how it was misrecognised"]}]}
Rules (be brief: these notes are read at a glance during the meeting):
+ - title: a name for the whole meeting, like a calendar entry (at most 12 Chinese characters or 6 words; no date, no quotes, not "会议" alone). Keep the current title unless the meeting's subject has clearly changed.
- summary: at most 3 short sentences.
- Topics in time order, at most 8 in total. Start a new topic only when the subject clearly changes (usually every few minutes); otherwise add to the current one, and merge small neighbouring topics. Keep earlier topics as they are unless new lines correct them. The last topic is the one being discussed now.
- At most 4 points per topic, each one short phrase. Merge rather than repeat.
@@ -330,7 +336,7 @@ final class NotesEngine: ObservableObject {
- Add a fishbone only to a topic that discusses causes, reasons or factors (3-5 branches); otherwise null.
- Every topic, point, branch, conclusion and to-do needs evidence: the ids of the lines that say it. Never state anything the transcript does not say.
- terms: at most 10 people, places or jargon words that matter. name is the correct spelling in the transcript's language (no translation in brackets); heard lists only the wrong forms the transcript used; note is a few words.
- - Write every summary, title, point, branch, conclusion and to-do in \(language), even when the transcript is in another language. Only term names keep the transcript's spelling.
+ - Write the meeting title and every summary, title, point, branch, conclusion and to-do in \(language), even when the transcript is in another language. Only term names keep the transcript's spelling.
- Write about what was said, never about the transcript or recognition quality.
- Use empty arrays when there is nothing. No markdown, no text outside the JSON.
"""
@@ -350,6 +356,7 @@ final class NotesEngine: ObservableObject {
/// The current notes as sent back to the model (no bookkeeping fields).
private struct Compact: Encodable {
+ let title: String?
let summary: String
let topics: [Topic]
let conclusions: [String]
@@ -363,6 +370,7 @@ final class NotesEngine: ObservableObject {
let fishbone: Fishbone?
}
init(_ n: MeetingNotes) {
+ title = n.title
summary = n.summary
topics = n.topics.map { Topic(start: $0.start, title: $0.title, summary: $0.summary, points: $0.points, fishbone: $0.fishbone) }
conclusions = n.conclusions.map(\.text)
@@ -394,6 +402,8 @@ final class NotesEngine: ObservableObject {
func time(_ v: Any?) -> Double? { lineNumbers(v).min().map { times[$0 - 1] } }
var n = MeetingNotes()
n.summary = str(root["summary"])
+ let title = str(root["title"]).trimmingCharacters(in: CharacterSet(charactersIn: "\"“”「」《》"))
+ n.title = title.isEmpty ? nil : title
n.topics = (root["topics"] as? [[String: Any]] ?? []).compactMap { t in
let title = str(t["title"])
guard !title.isEmpty else { return nil }
diff --git a/Sources/LiveSubs/SessionStore.swift b/Sources/LiveSubs/SessionStore.swift
index 51960ff..1619d1d 100644
--- a/Sources/LiveSubs/SessionStore.swift
+++ b/Sources/LiveSubs/SessionStore.swift
@@ -22,8 +22,28 @@ struct Session: Codable, Identifiable, Equatable {
var hasAudio: Bool
/// AI notes (absent in older sessions and without an API key).
var notes: MeetingNotes?
+ /// The user renamed it; nil in older sessions, where any title but the default counts as renamed.
+ var renamed: Bool?
var duration: TimeInterval { (endedAt ?? Date()).timeIntervalSince(startedAt) }
+
+ /// The user's own title, else the date and the name the notes gave the meeting
+ /// ("11月1日 产品路线评审", in the notes' language), else "会议 11月1日 14:30".
+ var displayTitle: String {
+ if renamed ?? !title.hasPrefix("会议 ") { return title }
+ guard let name = notes?.title, !name.isEmpty else { return title }
+ let f = DateFormatter()
+ f.locale = Locale(identifier: "zh_CN")
+ f.dateFormat = Calendar.current.isDate(startedAt, equalTo: Date(), toGranularity: .year) ? "M月d日" : "yyyy年M月d日"
+ return "\(f.string(from: startedAt)) \(name)"
+ }
+
+ static func defaultTitle(_ date: Date) -> String {
+ let f = DateFormatter()
+ f.locale = Locale(identifier: "zh_CN")
+ f.dateFormat = "M月d日 HH:mm"
+ return "会议 \(f.string(from: date))"
+ }
}
/// One folder per meeting under ~/Library/Application Support/LiveSubs/Sessions/<id>/:
@@ -67,12 +87,9 @@ final class SessionStore: ObservableObject {
@discardableResult
func begin() -> Session {
let now = Date()
- let f = DateFormatter()
- f.locale = Locale(identifier: "zh_CN")
- f.dateFormat = "M月d日 HH:mm"
let fid = DateFormatter()
fid.dateFormat = "yyyyMMdd-HHmmss"
- let s = Session(id: fid.string(from: now), title: "会议 \(f.string(from: now))",
+ let s = Session(id: fid.string(from: now), title: Session.defaultTitle(now),
startedAt: now, endedAt: nil, lines: [], hasAudio: false)
sessions.insert(s, at: 0)
liveID = s.id
@@ -118,12 +135,19 @@ final class SessionStore: ObservableObject {
// MARK: Editing
+ /// An empty title, or the one shown already, goes back to the automatic one.
func rename(_ id: String, to title: String) {
guard let i = index(id) else { return }
let t = title.trimmingCharacters(in: .whitespacesAndNewlines)
- guard !t.isEmpty else { return }
- sessions[i].title = t
- saveNow(id)
+ guard t != sessions[i].displayTitle else { return }
+ if t.isEmpty {
+ sessions[i].title = Session.defaultTitle(sessions[i].startedAt)
+ sessions[i].renamed = false
+ } else {
+ sessions[i].title = t
+ sessions[i].renamed = true
+ }
+ id == liveID ? scheduleSave(id) : saveNow(id)
}
func delete(_ id: String) {
@@ -200,7 +224,7 @@ enum TranscriptExport {
}
static func markdown(_ s: Session) -> String {
- var out = "# \(s.title)\n\n\(header(s))\n\n"
+ var out = "# \(s.displayTitle)\n\n\(header(s))\n\n"
let notes = notesMarkdown(s.notes)
if !notes.isEmpty { out += notes + "## 文字记录\n\n" }
for l in s.lines {
@@ -238,7 +262,7 @@ enum TranscriptExport {
.paragraphStyle: p,
]))
}
- add(s.title, size: 20, weight: .bold, after: 6)
+ add(s.displayTitle, size: 20, weight: .bold, after: 6)
add(header(s), size: 10, color: .darkGray, after: 14)
if let n = s.notes, !n.isEmpty {
add("纪要", size: 15, weight: .bold, after: 6)
diff --git a/Sources/LiveSubs/Views.swift b/Sources/LiveSubs/Views.swift
index 83be54a..de104fc 100644
--- a/Sources/LiveSubs/Views.swift
+++ b/Sources/LiveSubs/Views.swift
@@ -261,7 +261,7 @@ struct MainWindowView: View {
private var filtered: [Session] {
guard !query.isEmpty else { return store.sessions }
return store.sessions.filter { s in
- s.title.localizedCaseInsensitiveContains(query)
+ s.displayTitle.localizedCaseInsensitiveContains(query)
|| s.lines.contains { $0.src.localizedCaseInsensitiveContains(query) || ($0.dst ?? "").localizedCaseInsensitiveContains(query) }
}
}
@@ -355,12 +355,12 @@ struct MainWindowView: View {
let live = s.id == store.liveID
return Button {
selection = s.id
- titleDraft = s.title
+ titleDraft = ""
} label: {
VStack(alignment: .leading, spacing: 3) {
HStack(spacing: 7) {
if live { Circle().fill(Palette.accent).frame(width: 7, height: 7) }
- Text(s.title).font(.system(size: 13, weight: .semibold)).foregroundStyle(Palette.ink).lineLimit(1)
+ Text(s.displayTitle).font(.system(size: 13, weight: .semibold)).foregroundStyle(Palette.ink).lineLimit(1)
}
Text(meta(s, live: live)).font(.system(size: 11))
.foregroundStyle(live ? Palette.accentInk : Palette.secondary).lineLimit(1)
@@ -376,6 +376,9 @@ struct MainWindowView: View {
.buttonStyle(.plain)
.contextMenu {
Button("在 Finder 中显示") { NSWorkspace.shared.activateFileViewerSelecting([store.folder(s.id)]) }
+ if s.renamed ?? !s.title.hasPrefix("会议 "), s.notes?.title != nil {
+ Button("恢复自动标题") { store.rename(s.id, to: "") }
+ }
Button("删除", role: .destructive) { store.delete(s.id) }.disabled(live)
}
}
@@ -537,12 +540,15 @@ struct MainWindowView: View {
return VStack(alignment: .leading, spacing: 12) {
Text(dateLine(s, live: live)).font(.system(size: 12)).foregroundStyle(Palette.secondary)
TextField("标题", text: Binding(
- get: { titleDraft.isEmpty ? s.title : titleDraft },
+ get: { titleDraft.isEmpty ? s.displayTitle : titleDraft },
set: { titleDraft = $0 }
), axis: .vertical)
.textFieldStyle(.plain)
.font(.system(size: 28, weight: .bold))
- .onSubmit { store.rename(s.id, to: titleDraft) }
+ .onSubmit {
+ if !titleDraft.isEmpty { store.rename(s.id, to: titleDraft) }
+ titleDraft = ""
+ }
HStack(spacing: 8) {
if live { Tag("正在记录", live: true) }
chip(Self.length(s))
diff --git a/site/changelog.json b/site/changelog.json
index 1c7704f..f2fc246 100644
--- a/site/changelog.json
+++ b/site/changelog.json
@@ -6,6 +6,11 @@
"summary": "这一版让知了从“实时字幕”变成完整的会议助手:边开会边写纪要,同声传译可以用更自然的声音说出去,虚拟麦克风装完能当场试音。",
"image": null,
"items": [
+ {
+ "kind": "new",
+ "title": "会议自动命名。",
+ "text": "纪要会给每场会议起一个简短的名字(用纪要语言),会议记录列表、标题和导出文件都显示为「日期 + 会议名」,例如「11月1日 Lumen 发布与结账转化问题讨论」。自己改过的标题会保留,右键「恢复自动标题」可以改回来。"
+ },
{
"kind": "new",
"title": "语言集中设置。",