macOS 上的本地端即時語音辨識、英中翻譯與課堂逐字稿工具。
Version 0.3.10 · Apple Silicon · SwiftUI · Local-first · MIT License
- 開發者 / Author:Jason Chen
- 版本:0.3.10(Length Guard)
- 完整本地翻譯:TranslateGemma + MLX,透過
127.0.0.1本機服務 - 逐字稿:自動保存在專案本機
Data/Transcripts/,可匯出 TXT / Markdown
畫面中的 LIVE 區塊會持續顯示目前語音辨識結果;英文內容由本地端翻譯流程產生繁體中文,已穩定的前文保留、只更新尾端。上方可切換 SpeechAnalyzer 模式、暫停/繼續監聽、匯出逐字稿並開啟歷史紀錄。
- 即時麥克風語音辨識與字幕。
- 英文 → 繁體中文的本地 TranslateGemma 翻譯。
- macOS 26+ 使用 Apple SpeechAnalyzer / DictationTranscriber 長段落辨識;較舊系統使用 on-device Speech.framework fallback。
- 自動 / 純英文 / 中文+中英夾雜三種辨識模式。
- 約 3 秒真實停頓自動建立新的 transcript Segment。
- 0.3.10 Length Guard:長時間沒有停頓時,在約 300 個非空白可見字元後等待自然句尾再 commit;600 字為極端事故保底上限。
- 翻譯與語音邊界分流:翻譯延遲不會重新定義或阻塞來源文字切段。
- 每段文字具有固定 Segment ID,支援即時更新、複製與歷史保存。
- 一鍵匯出 TXT / Markdown 課堂逐字稿。
- App 執行期間翻譯服務只監聽
127.0.0.1:11435。
- Apple Silicon Mac(本專案的 MLX / TranslateGemma 本地翻譯路徑要求 arm64)
- macOS 13 或更新版本
- Xcode Command Line Tools / Apple Swift toolchain
- 麥克風與語音辨識權限
- 約 2.2 GB 以上空間放置 TranslateGemma 模型,另需本地 MLX runtime 空間
macOS 26+ 可使用新版 SpeechAnalyzer 長段落辨識;macOS 13–15 會使用專案內的舊版 on-device Speech.framework backend。新版 Apple Speech 資產若尚未安裝,系統可能下載相應的裝置端語音資產。
Clone 或下載 repository 後,在 Finder 打開 Tools/,雙擊:
Tools/安裝並啟動 LectureLive.command
安裝流程會:
- 檢查 macOS / Apple Silicon / Apple Swift。
- 建立
LectureLive.app。 - 優先重用已相容的本機 Python + MLX;若不相容,才把必要 Python 套件放進專案自己的
Runtime/python-packages/。 - 若本機尚無 TranslateGemma,會在真正下載約 2.2 GB 模型之前詢問你。
- 模型與 runtime 驗證成功後啟動 App。
它不會用 pip -U 去更新系統、Conda 或 Homebrew 的 Python 套件。
./Scripts/build_app.command./Scripts/setup_translator.commandFinder 雙擊:
Tools/檢查執行環境.command
正常使用時,逐字稿、log、cache、模型和 runtime 都存放在專案本地 Data/ / Runtime/。翻譯 App 只呼叫 loopback (127.0.0.1) 上的本地服務。
設定階段可能有兩類網路下載:
- 若缺少 TranslateGemma,
Scripts/download_model.command會在你明確同意後從 Hugging Face 下載mlx-community/translategemma-4b-it-4bit。 - macOS 26+ 的 SpeechAnalyzer 若缺少 Apple 語音資產,系統框架可能要求下載並安裝對應的 on-device speech assets。
詳見 SECURITY.md。
LectureLive/
├── Sources/LectureLive/ # SwiftUI App、ASR、segment、translation orchestration
├── Scripts/ # App build、MLX runtime、model 與本地 translator 工具
├── Assets/ # App icon
├── Tools/ # Finder 雙擊入口
├── docs/ # 架構、runtime 與 release 文件
├── .github/ # Issue / PR templates
├── Package.swift
├── VERSION
├── SECURITY.md
├── CHANGELOG.md
└── LICENSE
架構細節請看 docs/ARCHITECTURE.md。
本版新增長段落安全切分:
- 約 300 個非空白可見字元是軟門檻。
- 超過門檻後只在
. ? ! 。!?等自然句尾 commit。 - 不把內容機械切成固定 300 字 chunk。
- 約 600 字是無標點情況下的事故保底上限。
- commit 只建立新的 Segment,不會停止/重啟 SpeechAnalyzer,也不等待 TranslateGemma。
完整說明:docs/release-notes/0.3.10.md。
Jason Chen
LectureLive © 2026 Jason Chen,依 MIT License 發布。外部 runtime、Python 套件、Apple 語音資產與 TranslateGemma 模型仍依各自上游授權條款。
