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.

fix(ios): imported meetings show who said each line once their voices are told apart, and short-spoken remembered people get a chip

wqugurud47adc3a3d9f
diff --git a/ios/Sources/Cicada/CicadaApp.swift b/ios/Sources/Cicada/CicadaApp.swift
index cb854fc..ec147d9 100644
--- a/ios/Sources/Cicada/CicadaApp.swift
+++ b/ios/Sources/Cicada/CicadaApp.swift
@@ -372,7 +372,7 @@ final class AppModel: ObservableObject {
/// Name a voice ("" keeps 说话人 N, nil goes back to Ling's guess).
func renameSpeaker(session id: String, voice: Int, _ name: String?) {
guard let s = store.session(id) else { return }
- let n = SpeakerLabels.voiceNumbers(s.lines)[voice] ?? 0
+ let n = SpeakerLabels.voiceNumbers(s)[voice] ?? 0
let before = SpeakerLabels.label(n, SpeakerLabels.names(s))
speakerEdit(id) { store.setVoiceName(id, voice: voice, name) }
let after = store.session(id).map { SpeakerLabels.label(n, SpeakerLabels.names($0)) } ?? before
@@ -382,7 +382,7 @@ final class AppModel: ObservableObject {
/// Two voices are one person.
func mergeSpeaker(session id: String, _ from: Int, into: Int) {
guard let s = store.session(id) else { return }
- let numbers = SpeakerLabels.voiceNumbers(s.lines), names = SpeakerLabels.names(s)
+ let numbers = SpeakerLabels.voiceNumbers(s), names = SpeakerLabels.names(s)
let a = SpeakerLabels.label(numbers[from] ?? 0, names), b = SpeakerLabels.label(numbers[into] ?? 0, names)
speakerEdit(id) { store.mergeVoice(id, from, into: into) }
speakerUndo?.text = L("\(a) 已并入 \(b)")
diff --git a/ios/Sources/Cicada/RecordView.swift b/ios/Sources/Cicada/RecordView.swift
index 431d536..cf5e588 100644
--- a/ios/Sources/Cicada/RecordView.swift
+++ b/ios/Sources/Cicada/RecordView.swift
@@ -203,7 +203,7 @@ struct SpeakerChips: View {
var body: some View {
let names = SpeakerLabels.names(session)
- let voices = voicesOn ? SpeakerLabels.voiceNumbers(session.lines) : [:]
+ let voices = voicesOn ? SpeakerLabels.voiceNumbers(session) : [:]
// Voice id by its speaker number.
let byNumber = Dictionary(uniqueKeysWithValues: voices.map { ($1, $0) })
let numbers = byNumber.keys.sorted()
@@ -307,7 +307,8 @@ struct TranscriptList: View {
VStack(alignment: .leading, spacing: 4) {
HStack(spacing: 8) {
if inline { time(l, on) }
- if session.sourceFile == nil {
+ // An imported file names a line once its voice is told apart (the Mac's saysWho).
+ if session.sourceFile == nil || numbers[l.id] != nil {
Text(TranscriptExport.speakerName(l, numbers, names))
.font(.caption.weight(.semibold))
.foregroundStyle(l.speaker == "me" ? Ink.accentText : (focus == nil || mine ? Ink.ink : Ink.tertiary))
diff --git a/ios/Sources/Cicada/RecordsView.swift b/ios/Sources/Cicada/RecordsView.swift
index fbb93d5..dd33d88 100644
--- a/ios/Sources/Cicada/RecordsView.swift
+++ b/ios/Sources/Cicada/RecordsView.swift
@@ -274,7 +274,7 @@ struct RecordRow: View {
/// "10:02 · 48 分钟 · 3 人 · 英 → 中 · 会议室", as in the design's rows.
static func meta(_ s: Session, voices on: Bool) -> String {
var parts = [RecordList.when(s), RecordList.length(s)]
- let voices = on ? SpeakerLabels.voiceNumbers(s.lines).count : 0
+ let voices = on ? SpeakerLabels.voiceNumbers(s).count : 0
if voices >= 2 { parts.append(L("\(voices) 人")) }
if let pair = RecordList.pair(s, short: true) { parts.append(pair) }
if s.sourceFile != nil { parts.append(L("导入")) } else if s.room == true { parts.append(L("会议室")) }