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 meetings each line says whether it was heard in the room or online

wquguruafb45f96a048
diff --git a/Resources/en.lproj/Localizable.strings b/Resources/en.lproj/Localizable.strings
index 5a44d0e..4f19947 100644
--- a/Resources/en.lproj/Localizable.strings
+++ b/Resources/en.lproj/Localizable.strings
@@ -627,6 +627,8 @@
"今天" = "Today";
"昨天" = "Yesterday";
"本周" = "This Week";
+"现场" = "In room";
+"线上" = "Online";
"不到 1 分钟" = "Under 1 min";
"%lld 小时" = "%lld h";
"%lld 小时 %lld 分" = "%lld h %lld min";
@@ -848,6 +850,8 @@
"说话人 %lld" = "Speaker %lld";
/* SpeakerViews */
+"会议室的麦克风听到的" = "Heard by the room mic";
+"电脑里放出来的" = "Played by the Mac";
"没认出是谁:太短,或和已知的声音都不像" = "Not recognised: too short, or unlike the known voices";
"关掉说话人识别,记录里的名字一起收起" = "Turn off speaker identification; the names in your records are hidden too";
"Ling 从对话里认出,点一下可以改" = "Ling found this name in the conversation; click to change";
diff --git a/Resources/ja.lproj/Localizable.strings b/Resources/ja.lproj/Localizable.strings
index 71b45f3..306c823 100644
--- a/Resources/ja.lproj/Localizable.strings
+++ b/Resources/ja.lproj/Localizable.strings
@@ -627,6 +627,8 @@
"今天" = "今日";
"昨天" = "昨日";
"本周" = "今週";
+"现场" = "会議室";
+"线上" = "オンライン";
"不到 1 分钟" = "1分未満";
"%lld 小时" = "%lld時間";
"%lld 小时 %lld 分" = "%lld時間%lld分";
@@ -848,6 +850,8 @@
"说话人 %lld" = "話者 %lld";
/* SpeakerViews */
+"会议室的麦克风听到的" = "会議室のマイクで聞いた";
+"电脑里放出来的" = "Mac から流れた";
"没认出是谁:太短,或和已知的声音都不像" = "誰か判別できません:短すぎるか、既知の声と似ていません";
"关掉说话人识别,记录里的名字一起收起" = "話者識別をオフにします(記録の名前も隠れます)";
"Ling 从对话里认出,点一下可以改" = "Ling が会話から見つけた名前です。クリックで変更";
diff --git a/Resources/ko.lproj/Localizable.strings b/Resources/ko.lproj/Localizable.strings
index eea5f3b..6d1e5ff 100644
--- a/Resources/ko.lproj/Localizable.strings
+++ b/Resources/ko.lproj/Localizable.strings
@@ -627,6 +627,8 @@
"今天" = "오늘";
"昨天" = "어제";
"本周" = "이번 주";
+"现场" = "현장";
+"线上" = "온라인";
"不到 1 分钟" = "1분 미만";
"%lld 小时" = "%lld시간";
"%lld 小时 %lld 分" = "%lld시간 %lld분";
@@ -848,6 +850,8 @@
"说话人 %lld" = "화자 %lld";
/* SpeakerViews */
+"会议室的麦克风听到的" = "회의실 마이크로 들은 말";
+"电脑里放出来的" = "Mac에서 재생된 말";
"没认出是谁:太短,或和已知的声音都不像" = "누군지 알 수 없어요: 너무 짧거나 알려진 목소리와 달라요";
"关掉说话人识别,记录里的名字一起收起" = "화자 인식을 꺼요(기록의 이름도 숨겨져요)";
"Ling 从对话里认出,点一下可以改" = "Ling이 대화에서 찾은 이름이에요. 클릭해서 바꿀 수 있어요";
diff --git a/Resources/zh-Hans.lproj/Localizable.strings b/Resources/zh-Hans.lproj/Localizable.strings
index 8268009..4fca3c3 100644
--- a/Resources/zh-Hans.lproj/Localizable.strings
+++ b/Resources/zh-Hans.lproj/Localizable.strings
@@ -627,6 +627,8 @@
"今天" = "今天";
"昨天" = "昨天";
"本周" = "本周";
+"现场" = "现场";
+"线上" = "线上";
"不到 1 分钟" = "不到 1 分钟";
"%lld 小时" = "%lld 小时";
"%lld 小时 %lld 分" = "%lld 小时 %lld 分";
@@ -848,6 +850,8 @@
"说话人 %lld" = "说话人 %lld";
/* SpeakerViews */
+"会议室的麦克风听到的" = "会议室的麦克风听到的";
+"电脑里放出来的" = "电脑里放出来的";
"没认出是谁:太短,或和已知的声音都不像" = "没认出是谁:太短,或和已知的声音都不像";
"关掉说话人识别,记录里的名字一起收起" = "关掉说话人识别,记录里的名字一起收起";
"Ling 从对话里认出,点一下可以改" = "Ling 从对话里认出,点一下可以改";
diff --git a/Sources/Cicada/NotesViews.swift b/Sources/Cicada/NotesViews.swift
index 61517ef..42c694a 100644
--- a/Sources/Cicada/NotesViews.swift
+++ b/Sources/Cicada/NotesViews.swift
@@ -530,6 +530,8 @@ struct TranscriptListView<Partial: View>: View, Equatable {
var voices: [Int: Int] = [:]
/// The voice being edited above: its paragraphs are tinted.
var marked: Int?
+ /// 电脑和会议室 heard both: each paragraph says 现场 or 线上 (RecordList.heardBoth).
+ var places = false
var onAssign: ((Set<String>, Int) -> Void)?
@ViewBuilder var partial: Partial
@@ -543,7 +545,7 @@ struct TranscriptListView<Partial: View>: View, Equatable {
a.lines == b.lines && a.topics == b.topics && a.terms == b.terms && a.currentMatch == b.currentMatch
&& a.bilingual == b.bilingual && a.live == b.live && a.partialShown == b.partialShown
&& a.jumpTo == b.jumpTo && a.speakers == b.speakers && a.startedAt == b.startedAt && a.voices == b.voices && a.marked == b.marked
- && a.identifying == b.identifying
+ && a.identifying == b.identifying && a.places == b.places
}
private var searching: Bool { !terms.isEmpty }
@@ -754,22 +756,25 @@ struct TranscriptListView<Partial: View>: View, Equatable {
.foregroundStyle(latest || isMatch ? Palette.accentInk : Palette.tertiary)
.frame(width: l.t >= 3600 ? 56 : 40, alignment: .leading).padding(.top, 2)
VStack(alignment: .leading, spacing: 4) {
- if !label {
- } else if l.speaker == "me" { Text("你").font(.system(size: 11, weight: .semibold)).foregroundStyle(Palette.accentInk) }
- else if onAssign != nil, !voices.isEmpty {
- Button { assigning = assigning == l.id ? nil : l.id } label: {
- HStack(spacing: 4) {
- if let n = speakers[l.id] { SpeakerTag(number: n) } else { UnknownSpeakerTag() }
- Image(systemName: "chevron.down").font(.system(size: 8, weight: .bold)).foregroundStyle(Palette.tertiary)
+ HStack(spacing: 6) {
+ if !label {
+ } else if l.speaker == "me" { Text("你").font(.system(size: 11, weight: .semibold)).foregroundStyle(Palette.accentInk) }
+ else if onAssign != nil, !voices.isEmpty {
+ Button { assigning = assigning == l.id ? nil : l.id } label: {
+ HStack(spacing: 4) {
+ if let n = speakers[l.id] { SpeakerTag(number: n) } else { UnknownSpeakerTag() }
+ Image(systemName: "chevron.down").font(.system(size: 8, weight: .bold)).foregroundStyle(Palette.tertiary)
+ }
+ .padding(.horizontal, assigning == l.id ? 6 : 0).frame(height: 20)
+ .background(RoundedRectangle(cornerRadius: 6).fill(assigning == l.id ? Color.white : .clear))
+ .contentShape(Rectangle())
}
- .padding(.horizontal, assigning == l.id ? 6 : 0).frame(height: 20)
- .background(RoundedRectangle(cornerRadius: 6).fill(assigning == l.id ? Color.white : .clear))
- .contentShape(Rectangle())
+ .buttonStyle(.plain).help(ls.count > 1 ? L("这段是谁说的") : L("这句是谁说的"))
}
- .buttonStyle(.plain).help(ls.count > 1 ? L("这段是谁说的") : L("这句是谁说的"))
+ else if let n = speakers[l.id] { SpeakerTag(number: n) }
+ else if !speakers.isEmpty { UnknownSpeakerTag() }
+ if places, label, l.speaker != "me" { PlaceTag(line: l) }
}
- else if let n = speakers[l.id] { SpeakerTag(number: n) }
- else if !speakers.isEmpty { UnknownSpeakerTag() }
Text(highlighted(src, current: isMatch)).font(.system(size: 14)).lineSpacing(2).textSelection(.enabled)
if bilingual, !dst.isEmpty {
Text(highlighted(dst, current: isMatch)).font(.system(size: 13)).foregroundStyle(Palette.secondary)
@@ -819,7 +824,7 @@ enum TranscriptParagraphs {
var out: [[TranscriptLine]] = []
var key: String?
for l in lines {
- let k = l.speaker == "me" ? "me" : speakers[l.id].map { "n\($0)" } ?? "?"
+ let k = (l.speaker == "me" ? "me" : speakers[l.id].map { "n\($0)" } ?? "?") + (l.via ?? "")
if k == key, let first = out.last?.first, l.t - first.t <= span {
out[out.count - 1].append(l)
} else {
diff --git a/Sources/Cicada/NotesWindow.swift b/Sources/Cicada/NotesWindow.swift
index d6e044f..53c712d 100644
--- a/Sources/Cicada/NotesWindow.swift
+++ b/Sources/Cicada/NotesWindow.swift
@@ -742,6 +742,7 @@ struct NotesWindowView: View {
jumpTo: jumpTo, speakers: speakers, startedAt: store.liveStart,
identifying: model.identifyingLanguage,
voices: speakers.isEmpty ? [:] : SpeakerLabels.voiceNumbers(lines), marked: editingVoice,
+ places: RecordList.heardBoth(lines),
onAssign: { ids, voice in if let s = session { model.assignLines(session: s.id, ids, to: voice) } }) {
LivePartialRow(model: model, startedAt: store.liveStart)
}
diff --git a/Sources/Cicada/RecordList.swift b/Sources/Cicada/RecordList.swift
index c06e885..6423452 100644
--- a/Sources/Cicada/RecordList.swift
+++ b/Sources/Cicada/RecordList.swift
@@ -33,6 +33,30 @@ enum RecordList {
}
return title
}
+ /// 电脑和会议室: the room mic and the Mac's audio both brought in the other side's lines, so each
+ /// one says where it was heard. Derived from the lines (`via`), not stored: a meeting that only
+ /// heard one side reads as before.
+ static func heardBoth(_ lines: [TranscriptLine]) -> Bool {
+ var room = false, mac = false
+ for l in lines where l.speaker == "them" {
+ if l.via == "room" { room = true } else { mac = true }
+ if room && mac { return true }
+ }
+ return false
+ }
+ /// Lines of the other side's where the place changes from the line before: their label shows again.
+ static func placeStarts(_ lines: [TranscriptLine]) -> Set<String> {
+ var out: Set<String> = [], last: String??
+ for l in lines {
+ let key: String? = l.speaker == "me" ? "me" : l.via
+ if l.speaker != "me", key != last { out.insert(l.id) }
+ last = key
+ }
+ return out
+ }
+ /// Where a line of the other side's was heard, in a meeting that heard both.
+ static func place(_ l: TranscriptLine) -> String { l.via == "room" ? L("现场") : L("线上") }
+
/// Still on the stored "会议 <date>" title: not renamed, and no notes title to show.
static func untitled(_ s: Session) -> Bool {
!(s.renamed ?? !s.title.hasPrefix("会议 ")) && (s.notes?.title ?? "").isEmpty && s.sourceFile == nil
diff --git a/Sources/Cicada/SpeakerViews.swift b/Sources/Cicada/SpeakerViews.swift
index b708881..bd36951 100644
--- a/Sources/Cicada/SpeakerViews.swift
+++ b/Sources/Cicada/SpeakerViews.swift
@@ -31,6 +31,18 @@ struct SpeakerTag: View {
}
}
+/// 现场 / 线上 beside a line in a meeting that heard the room and the Mac together.
+struct PlaceTag: View {
+ let line: TranscriptLine
+ var body: some View {
+ Text(RecordList.place(line)).font(.system(size: 10, weight: .medium)).foregroundStyle(Palette.secondary)
+ .padding(.horizontal, 5).padding(.vertical, 1)
+ .background(RoundedRectangle(cornerRadius: 4).fill(line.via == "room" ? Palette.fill : .clear))
+ .overlay(RoundedRectangle(cornerRadius: 4).stroke(Palette.line, lineWidth: line.via == "room" ? 0 : 1))
+ .help(line.via == "room" ? L("会议室的麦克风听到的") : L("电脑里放出来的"))
+ }
+}
+
/// A line from the other side whose voice isn't one of the people on show.
struct UnknownSpeakerTag: View {
var body: some View {
diff --git a/Sources/Cicada/Views.swift b/Sources/Cicada/Views.swift
index 4e3a0c3..56105f1 100644
--- a/Sources/Cicada/Views.swift
+++ b/Sources/Cicada/Views.swift
@@ -824,6 +824,13 @@ struct MainWindowView: View {
} else if s.fromRecording, s.lines.isEmpty {
Image(systemName: "waveform").font(.system(size: 11)).foregroundStyle(Palette.secondary)
.help(L("只有录音"))
+ } else if RecordList.heardBoth(s.lines) {
+ HStack(spacing: 2) {
+ Image(systemName: "mic")
+ Image(systemName: "display")
+ }
+ .font(.system(size: 10)).foregroundStyle(Palette.secondary)
+ .help(L("电脑和会议室"))
} else if s.room == true {
Image(systemName: "mic").font(.system(size: 11)).foregroundStyle(Palette.secondary)
.help(L("会议室"))
@@ -1039,7 +1046,7 @@ struct MainWindowView: View {
HStack(spacing: 8) {
if live { Tag(L("正在记录"), live: true) }
Text(([dateText(s.startedAt, "MMMdHHmm"), RecordList.length(s)] + (s.sourceFile.map { [$0, L("导入")] } ?? [])
- + (s.room == true ? [L("会议室")] : [])).joined(separator: " · "))
+ + (RecordList.heardBoth(s.lines) ? [L("电脑和会议室")] : s.room == true ? [L("会议室")] : [])).joined(separator: " · "))
.font(.system(size: 12).monospacedDigit()).foregroundStyle(Palette.tertiary).lineLimit(1)
.help(([dateLine(s, live: live)] + more.compactMap { $0 }).joined(separator: " · "))
}
@@ -1137,10 +1144,12 @@ struct MainWindowView: View {
header(s).padding(.bottom, 16)
let speakers = settings.speakerVoices ? SpeakerLabels.numbers(s.lines) : [:]
if !speakers.isEmpty { SpeakerStrip(model: model, session: s).padding(.bottom, 8) }
- let starts = SpeakerLabels.runStarts(s.lines, speakers)
+ let both = RecordList.heardBoth(s.lines)
+ // In a meeting that heard the room and the Mac, a change of place starts a new run too.
+ let starts = SpeakerLabels.runStarts(s.lines, speakers).union(both ? RecordList.placeStarts(s.lines) : [])
let voices = SpeakerLabels.voiceNumbers(s.lines)
ForEach(s.lines) { l in
- lineRow(l, speaker: speakers[l.id], label: speakers.isEmpty || starts.contains(l.id), voices: !speakers.isEmpty, in: s)
+ lineRow(l, speaker: speakers[l.id], label: speakers.isEmpty || starts.contains(l.id), voices: !speakers.isEmpty, place: both, in: s)
.contextMenu { if !speakers.isEmpty, l.speaker == "them" { assignMenu(s, l, voices) } }
.id(l.id)
}
@@ -1162,7 +1171,7 @@ struct MainWindowView: View {
}
}
- private func lineRow(_ l: TranscriptLine, speaker: Int? = nil, label: Bool = true, voices: Bool = false, in shownSession: Session? = nil) -> some View {
+ private func lineRow(_ l: TranscriptLine, speaker: Int? = nil, label: Bool = true, voices: Bool = false, place: Bool = false, in shownSession: Session? = nil) -> some View {
let me = l.speaker == "me"
return HStack(alignment: .top, spacing: 16) {
if let shownSession, player.sessionID == shownSession.id, player.ready {
@@ -1179,19 +1188,22 @@ struct MainWindowView: View {
.frame(width: 52, alignment: .leading).padding(.top, 1)
}
VStack(alignment: .leading, spacing: 5) {
- if !label {
- } else if voices, !me, let s = shownSession {
- // A click on whose line it is: say it was someone else's.
- Menu { assignMenu(s, l, SpeakerLabels.voiceNumbers(s.lines)) } label: {
- if let speaker { SpeakerTag(number: speaker) } else { UnknownSpeakerTag() }
+ HStack(spacing: 6) {
+ if !label {
+ } else if voices, !me, let s = shownSession {
+ // A click on whose line it is: say it was someone else's.
+ Menu { assignMenu(s, l, SpeakerLabels.voiceNumbers(s.lines)) } label: {
+ if let speaker { SpeakerTag(number: speaker) } else { UnknownSpeakerTag() }
+ }
+ .menuStyle(.borderlessButton).menuIndicator(.visible).fixedSize()
+ .help(L("这句是谁说的"))
+ } else if let speaker { SpeakerTag(number: speaker) }
+ else if shownSession?.sourceFile == nil {
+ // An imported file has no "other side": its lines carry no label.
+ Text(me ? L("你") : L("对方")).font(.system(size: 11, weight: .semibold))
+ .foregroundStyle(me ? Palette.accentInk : Palette.secondary)
}
- .menuStyle(.borderlessButton).menuIndicator(.visible).fixedSize()
- .help(L("这句是谁说的"))
- } else if let speaker { SpeakerTag(number: speaker) }
- else if shownSession?.sourceFile == nil {
- // An imported file has no "other side": its lines carry no label.
- Text(me ? L("你") : L("对方")).font(.system(size: 11, weight: .semibold))
- .foregroundStyle(me ? Palette.accentInk : Palette.secondary)
+ if place, label, !me { PlaceTag(line: l) }
}
if view != "dst" {
Text(l.src)
diff --git a/site/changelog.json b/site/changelog.json
index 3fe8ee2..bc32441 100644
--- a/site/changelog.json
+++ b/site/changelog.json
@@ -61,6 +61,14 @@
],
"title": "会议标题点一下就能改,改完点别处也会保存。",
"text": "鼠标移到标题上会出现铅笔;回车或点别处保存,Esc 取消;清空就换回自动标题。原来不按回车直接点别处,改的标题会丢。"
+ },
+ {
+ "kind": "improved",
+ "platforms": [
+ "mac"
+ ],
+ "title": "电脑和会议室的会议里,每句话标出是“现场”还是“线上”。",
+ "text": "实时纪要和会议记录里都有;会议列表用麦克风和显示器两个图标标出这种会议,详情顶部写“电脑和会议室”。"
}
]
},