Offline speech-to-text for Flutter, with no server and no API key
Описание и применение
Пакет transcribe_cpp позволяет выполнять распознавание речи в реальном времени на устройствах iOS и Android без подключения к сети, серверов и ключей API, обеспечивая приватность и высокую скорость.
Задача
Developers need real‑time transcription on mobile devices without relying on cloud APIs, network, accounts, or API keys.
Результат
The package delivers fast, private, live transcription on mobile devices, handling phone calls, background execution, and varying audio sources without external dependencies.
Рабочий процесс
- Add transcribe_cpp to pubspec:
flutter pub add transcribe_cpp - Import the package and download a model once:
final models = await ModelManager.open(); final model = await models.ensure(const ModelId('parakeet-tdt_ctc-110m-Q4_K_M')); - Open a session and start listening:
final session = await TranscribeSession.open(model); await session.start(); - Display live text via a ValueListenableBuilder on
session.text.full - Stop the session with
await session.stop(); - If audio is already captured, transcribe it with
await session.transcribeStream(myAudio, format: const AudioFormat(sampleRate: 48000));
Доказательства
It works in airplane mode.
Fast. On a mid‑range phone, the recommended model transcribes speech about 40 times faster than real time.
The model I recommend is NVIDIA's Parakeet 110M: a 90 MB download with a 2.5% word error rate on the LibriSpeech benchmark.
The package re‑reads the unfinished sentence every 350 ms to avoid flicker.
The package runs Silero VAD, a small voice‑detection model I ported to plain C, and an endpointer tuned by measuring, not by feel.
- Дата записи: 2026-10-22T13:11:35.548Z