Apple quietly shipped everything you need to build a real-time translator — so I built one
Описание и применение
Wakaru — приложение macOS, которое преобразует любой звук, воспроизводимый на компьютере, в субтитры с переводом в реальном времени, полностью на устройстве, без отправки данных в облако.
Задача
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