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: early in a meeting, the transcript no longer runs several people's lines into one paragraph

wquguru00c57e34346b
diff --git a/Sources/Cicada/NotesViews.swift b/Sources/Cicada/NotesViews.swift
index c4e0d38..659ebc3 100644
--- a/Sources/Cicada/NotesViews.swift
+++ b/Sources/Cicada/NotesViews.swift
@@ -830,12 +830,19 @@ enum TranscriptParagraphs {
static func group(_ lines: [TranscriptLine], _ speakers: [String: Int]) -> [[TranscriptLine]] {
var out: [[TranscriptLine]] = []
var key: String?
+ // Before any number is on show (two voices with five lines each), a question and its answer
+ // would read as one block: a known voice that differs from the paragraph's starts a new one.
+ // Short lines are left out, as for numbers: their voice is too often wrong.
+ var voice: Int?
for l in lines {
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 {
+ let v = speakers.isEmpty && l.speaker == "them" && SpeakerLabels.substantive(l.src) ? l.voice : nil
+ if k == key, let first = out.last?.first, l.t - first.t <= span, voice == nil || v == nil || v == voice {
out[out.count - 1].append(l)
+ voice = voice ?? v
} else {
out.append([l])
+ voice = v
}
key = k
}
diff --git a/Tests/CicadaTests/NotesWindowTests.swift b/Tests/CicadaTests/NotesWindowTests.swift
index 8abdef3..d0446e6 100644
--- a/Tests/CicadaTests/NotesWindowTests.swift
+++ b/Tests/CicadaTests/NotesWindowTests.swift
@@ -39,6 +39,19 @@ import Testing
#expect(groups.map { $0.map(\.id) } == [["a"], ["b", "c"]])
}
+ @Test func paragraphsSplitBetweenVoicesBeforeNumbersShow() {
+ func said(_ id: String, _ t: Double, _ voice: Int?, _ src: String = "three whole words") -> TranscriptLine {
+ var l = line(id, t, "them", src); l.voice = voice; return l
+ }
+ // A speaks, B asks, A answers; a line with no voice yet and a short "Yeah." heard as A stay put.
+ let lines = [said("a", 0, 1), said("b", 5, nil), said("c", 9, 2), said("d", 12, 1, "Yeah."),
+ said("e", 14, 1), said("f", 18, 1)]
+ #expect(TranscriptParagraphs.group(lines, [:]).map { $0.map(\.id) } == [["a", "b"], ["c", "d"], ["e", "f"]])
+ // Once numbers show, they decide: lines without one stay together as before.
+ let shown = TranscriptParagraphs.group(lines, ["x": 1])
+ #expect(shown.map { $0.map(\.id) } == [["a", "b", "c", "d", "e", "f"]])
+ }
+
@Test func joinSpacesWordsNotChinese() {
#expect(TranscriptParagraphs.join(["Hello.", " World. "]) == "Hello. World.")
#expect(TranscriptParagraphs.join(["你好。", "再见。"]) == "你好。再见。")
diff --git a/site/changelog.json b/site/changelog.json
index 46702b4..15f1bc0 100644
--- a/site/changelog.json
+++ b/site/changelog.json
@@ -1,4 +1,21 @@
[
+ {
+ "version": "1.5.1",
+ "date": null,
+ "title": "",
+ "summary": "",
+ "image": null,
+ "items": [
+ {
+ "kind": "fixed",
+ "platforms": [
+ "mac"
+ ],
+ "title": "会议刚开始时,文字记录不再把几个人说的话挤成一段。",
+ "text": "说话人编号要等两个声音各说够 5 句才出现,在那之前所有的话都算同一个人,半分钟内的问答会并成一大段。现在只要听出前后两句是不同的声音,就分成两段;编号出来后照旧标上说话人。"
+ }
+ ]
+ },
{
"version": "1.5.0",
"date": "2026-11-07",