知了 Cicada · 任何会议和直播的实时字幕、同声传译、AI 会议纪要,Mac、Windows、Linux、Android 免费开源。Live subtitles, interpreting and meeting notes for any call or stream, on Mac, Windows, Linux and Android.
Swift androidlinuxlive-captionsmacosmeeting-notesmenubar-appsimultaneous-interpretationspeech-recognitionsubtitlesswiftswiftuitranslationwindows
chore(android): keep each line's via when reading and writing a record, as the Mac does
wquguru2585b31913c4
diff --git a/android/cli/src/main/kotlin/cicada/cli/Tests.kt b/android/cli/src/main/kotlin/cicada/cli/Tests.ktindex 42d5bc6..740f28d 100644--- a/android/cli/src/main/kotlin/cicada/cli/Tests.kt+++ b/android/cli/src/main/kotlin/cicada/cli/Tests.kt@@ -109,6 +109,7 @@ object Tests {"src" : "你好","srcLang" : "zh-CN","t" : 2.5,+ "via" : "room","voice" : 1}],@@ -165,6 +166,7 @@ object Tests {val s = Session.read(MAC)!!equal(1, s.lines.size, "lines")equal(1, s.lines[0].voice, "voice")+ equal("room", s.lines[0].via, "heard in the room")equal("Hello / \"hi\"", s.lines[0].dst, "escapes read")equal("Emma", s.voiceNames!!["1"], "voice names")equal(12.4, s.notes!!.topics[0].pointTime(0), "point time")diff --git a/android/core/src/main/kotlin/cicada/Models.kt b/android/core/src/main/kotlin/cicada/Models.ktindex 7838189..e8cc1d7 100644--- a/android/core/src/main/kotlin/cicada/Models.kt+++ b/android/core/src/main/kotlin/cicada/Models.kt@@ -28,19 +28,22 @@ class TranscriptLine(var dstLang: String = "",/// Experimental voice id on the Mac; Android doesn't tell voices apart yet.var voice: Int? = null,+ /// "room": heard by the Mac's room microphone in a 电脑和会议室 meeting; kept so a Mac record+ /// opened here keeps its 现场 / 线上.+ var via: String? = null,) {- fun copy() = TranscriptLine(id, t, speaker, src, dst, srcLang, dstLang, voice)+ fun copy() = TranscriptLine(id, t, speaker, src, dst, srcLang, dstLang, voice, via)fun toJson(): Map<String, Any?> = mapOf("id" to id, "t" to t, "speaker" to speaker, "src" to src, "dst" to dst,- "srcLang" to srcLang, "dstLang" to dstLang, "voice" to voice,+ "srcLang" to srcLang, "dstLang" to dstLang, "voice" to voice, "via" to via,)companion object {fun from(o: Map<String, Any?>) = TranscriptLine(id = o["id"].str() ?: "", t = o["t"].num() ?: 0.0, speaker = o["speaker"].str() ?: "them",src = o["src"].str() ?: "", dst = o["dst"].str(), srcLang = o["srcLang"].str() ?: "",- dstLang = o["dstLang"].str() ?: "", voice = o["voice"].int(),+ dstLang = o["dstLang"].str() ?: "", voice = o["voice"].int(), via = o["via"].str(),)}}