Hans Lin 林思翰434 downloadsTraditional-Chinese-first TTS for notes with offline system, Edge CLI or Azure voices, sentence highlighting, folder playback, cursor start, pronunciation rules, and Callout/Highlightr support.
中文為主 · English below
給繁中使用者的筆記跟讀與連播外掛:預設用各平台系統內建的中文語音免費、離線朗讀;桌面可切換免 Key 的 Edge CLI,或使用自己的 Azure Speech Key。支援逐句反白、游標起讀、資料夾連播、發音字典、不朗讀符號,以及 Callout/Highlightr 格式清理。只有主動選擇線上引擎時,朗讀文字才會送到 Microsoft。
#、> 與空白引用行不會送到語音引擎。[!type]- 預設收合 Callout 的內文;關閉時仍保留自訂標題,展開型 [!type]+ 不受影響。A. 官方社群外掛(推薦) 設定 → 社群外掛 → 瀏覽 → 搜「Hans TW TTS」→ 安裝 → 啟用。
B. BRAT(現在就能用,電腦與手機都可)
hansai-art/obsidian-tw-tts,確認。C. 手動
到 最新 release 下載 main.js、manifest.json、styles.css,放進 <vault>/.obsidian/plugins/tw-read-aloud/,再啟用外掛。手機上 .obsidian 是隱藏資料夾,通常用 BRAT 較方便。
朗讀目前筆記(任選一種):
Cmd/Ctrl + P)→「朗讀目前筆記」其他:
設定 → 社群外掛 → Hans TW TTS:
− 1.0x +,點中間數字即回到 1.0x。# 開頭為註解),校正破音字與專有名詞。例:iPAS=愛帕斯、臺=台。只改朗讀發音,畫面仍顯示原文。○ ● ◎ ※。這些符號送去朗讀前會被刪掉(否則 ○ 會被唸成「零」),畫面仍顯示原文。整行只有這類符號時會被安靜跳過。若同一個符號在發音字典裡另有指定唸法,以發音字典為準。外掛預設仍使用系統語音(離線)、自動挑選最佳中文語音,音高預設為 0。如要使用 Edge CLI,可在設定把「朗讀引擎」切成 Edge CLI;它預設使用 zh-CN-XiaoxiaoNeural,不需要 Azure 帳號或 API Key。第一次使用前,請在電腦安裝 edge-tts,讓終端機可執行 edge-tts。
macOS 終端機:python3 -m pip install --user edge-tts
Windows PowerShell:py -m pip install --user edge-tts
安裝後重新啟用外掛,再到設定頁按「執行環境檢查」。外掛不會自行執行 pip 或要求系統管理員權限。
Edge CLI 是透過 Microsoft Edge 線上服務合成,朗讀文字會傳送到該服務;可隨時切回系統語音(離線)。
可在「Edge 語音」欄位選擇已知 voice,例如 zh-CN-YunyangNeural;再將音高設為 -7,即可使用 Yunyang 的低沉音高作為一組可選範例,並非預設值。
Edge CLI 僅支援桌面版 Obsidian;iPhone/iPad 會自動使用既有的系統語音。
設定 → Hans TW TTS →「疑難排解與環境檢查」:
安全診斷不包含筆記內容、Azure Key、Vault 名稱、完整私人路徑或 raw stderr。設定頁的「常見問題 Q&A」也提供 Edge CLI 安裝、錯誤語音、網路逾時與 Azure 設定的解法。
Android 版固定切換為系統「隨選朗讀」模式。外掛會顯示啟用與操作指引,不會嘗試啟動 Edge CLI、Azure 或 Web Speech 播放。系統模式可免費朗讀、調整速度及在背景播放,但不提供外掛逐句反白、資料夾連播或 Yunyang。基於 Android 權限限制,外掛不能自行開啟無障礙服務,仍需使用者先在系統設定中啟用。
桌機與 iPhone/iPad 的朗讀文字會略過 Obsidian Callout 的 [!type]/摺疊符號,以及 Highlightr 寫入的 <mark>/<font> 顯示標籤與色碼,只保留自訂標題及可見內文。Callout 內的標題、清單、任務、表格、程式碼、數學式與註腳會套用與正文相同的 Markdown 清理;單獨用來換段的 > 只形成段落停頓,不會建立空語音。設定可略過 [!type]- 的收合內文,但仍朗讀其自訂標題。這項相容性限於筆記原始 Markdown 中的 Callout 與上述標籤,不代表支援所有第三方外掛或所有 HTML。
Hans TW TTS 在切句與交給任何語音引擎前,會先用同一套內容解析器清理筆記。預設會略過 Block ID(如 ^473eef)、%% comments %%、HTML comments、Footnotes、Embed syntax、fenced code blocks 與 Callout metadata;Markdown link/wikilink 則保留可見文字。朗讀窗格顯示的也是清理後內容,因此系統語音、Edge CLI、Azure、選取朗讀及游標起讀會保持一致。
獨立標籤列、直接出現的 http/https 網址與數學式可在「內容朗讀」設定中個別開啟。未知或無法確定的語法會保守保留,避免誤刪正文。
本外掛的內容清理功能適用於由 Hans TW TTS 自己處理朗讀的桌機與 iOS 路徑;Android 系統隨選朗讀由 Android 系統控制。
選擇「Azure Speech API(自己的 Key)」後,設定頁會顯示三個欄位:Azure Speech Key、Azure Region 與精選語音。這是 Microsoft 官方 API,不依賴本機 Python CLI;目前供桌機與 iPhone/iPad 使用。Android 版依產品策略固定切換為系統「隨選朗讀」。
Eastasia。| 平台 | 支援 | 說明 |
|---|---|---|
| macOS | ✅ | 用系統內建中文語音 |
| Windows | ✅ | 需在系統安裝中文語音 |
| iPhone / iPad | ✅ | 用 iOS 內建中文語音 |
| Android | 系統朗讀引導 | 外掛會引導啟用 Android「選取即朗讀」;不提供外掛逐句反白、資料夾連播或 Yunyang |
Android 為什麼改用系統朗讀: Obsidian 的 Android WebView 沒有穩定提供本外掛採用的 Web Speech 路徑,桌面 Edge CLI 也無法在 Android 執行。因此 Hans TW TTS 會交由 Android 系統「選取即朗讀」處理。其他外掛若使用雲端服務或額外原生 App,可能採用不同路徑。
Android 建議做法(系統「選取即朗讀」,台灣語音、免費、離線):
(各廠牌選單名稱略有不同;找不到時直接搜尋「文字轉語音」「選取即朗讀」。想要逐句反白、資料夾連播等外掛功能,請在電腦或 iPhone / iPad 使用。)
外掛偵測不到中文語音時,會在朗讀窗格內顯示「原因 + 解法」面板。請先到系統安裝中文語音:
npm run dev 監看建置,npm run build 正式建置。npm test 跑單元測試(Node 內建測試 runner + tsx)。sentence-splitter、tts-engine、voice-catalog、pronunciation、note-order、setting-defs、playback-error)與 Obsidian 解耦,可獨立測試。MIT。原創程式碼,不衍生自任何 AGPL 專案。
A Traditional-Chinese-first read-aloud and folder-playback plugin. The default system voice is free and offline; desktop users can switch to the no-key Edge CLI, or use their own Azure Speech Key. It also supports sentence highlighting, cursor start, pronunciation rules, silent symbols, and Callout/Highlightr cleanup. Note text is sent to Microsoft only when an online provider is selected.
A. Community Plugins (recommended): Settings → Community plugins → Browse → search "Hans TW TTS" → Install → Enable.
B. BRAT (works now, desktop and mobile): Install the BRAT plugin, then command palette → "BRAT: Add a beta plugin" → paste hansai-art/obsidian-tw-tts → enable "Hans TW TTS".
C. Manual: Download main.js, manifest.json, styles.css from the latest release into <vault>/.obsidian/plugins/tw-read-aloud/, then enable the plugin.
Read the current note via the ribbon speaker icon, the status-bar "🔊 朗讀" button, or the command "朗讀目前筆記". Select text and run "朗讀選取文字" to read only the selection, or "從游標處開始唸" to start from the sentence at your cursor. Right-click a folder → "朗讀此資料夾" to play every note in it back-to-back. The reader pane opens on the right, highlights each sentence as it is read (with the note title + position when playing a folder), and click any sentence to start from there. "停止朗讀" stops playback.
Settings let you choose from Chinese and English system voices (quality-ranked Chinese voices come first), adjust/reset/preview speed and pitch, set paragraph and heading pauses from 0–1500 ms, optionally read semantic task states, optionally skip default-collapsed Callout bodies, toggle auto-advance to the next note, choose whether folder playback recurses into subfolders, define a pronunciation dictionary (one 原文=唸法 rule per line), and list silent symbols (for example ○ ● ◎ ※) that are removed before speaking. The same timing, pronunciation, symbol and structural-safety rules apply to system, Edge, and Azure providers. The reader pane also has a live speed control (− [1.0x] +).
macOS ✅ · Windows ✅ · iPhone/iPad ✅. On Android, the plugin provides setup guidance for the system Select to Speak accessibility service instead of using the plugin reader. This Android handoff does not include sentence highlighting, folder playback, or Edge voices.
MIT. Original code; not derived from any AGPL project.