Apple quietly shipped everything you need to build a real-time translator — so I built one
说明与用途
Wakaru 是一款 macOS 应用,可将 Mac 上播放的任何音频实时转换为翻译字幕,完全在本地运行,无需将数据发送到云端。
问题
Need real‑time, on‑device subtitles for confidential meetings on macOS without sending audio to the cloud.
结果
Wakaru delivers live, on‑device subtitles for any audio on macOS 26+, achieving near‑real‑time latency, 10 source languages, 22 target languages, and optional high‑accuracy LLM mode, all with zero external dependencies.
工作流
- Capture system audio at 16 kHz via ScreenCaptureKit
- Use SpeechAnalyzer with .fastResults and prepareToAnalyze for low latency
- Collect complete sentences, then translate with Translation framework or Apple Intelligence LLM
- Render subtitles on a transparent NSPanel overlay
- Handle sample rate, reporting cadence, lazy loading, and shutdown optimizations
- Use content anchors to avoid re‑translation of rewritten text
- Manage TranslationSession via invisible .translationTask in SwiftUI
- Implement LLM guardrails: 2.5 s deadline, session reset every 10 sentences, reject degenerate output
证据
Wakaru runs on macOS 26+ (Apple silicon). It's free for 14 days (and stays free for 1 hour/day after that), with a one-time purchase for unlimited time — no subscription
SpeechAnalyzer prefers 16 kHz audio. My first version captured at 48 kHz and resampled with AVAudioConverter — and the first caption took seconds to appear.
Translation framework only works inside SwiftUI .translationTask view modifier.
- 记录日期: 2026-09-05T19:00:10.098Z