Menu

1 / 2

Building an offline speech-to-text app with Flutter, FFI, whisper.cpp and FFmpeg

DEV Community: flutter·sarbador_·about 19 hours ago
#pqIAi34r
#devtoflutter#devto#dev#disable#native
Reading 0:00
15s threshold

Cloud transcription is convenient until you have a recording you'd rather not upload: a lecture, a client call, a voice note. So I built Extracter , an open-source Flutter app that turns any audio or video file into text entirely on the device. No account, no analytics, and no network at all once a model is downloaded.

It runs on Android, iOS and macOS today (Windows and Linux build scripts exist but haven't been tested yet). This post walks through how it works, and the one native bug that taught me more about Dart isolates than any documentation.

The architecture

audio/video file → FFmpeg (decode-only) → 16 kHz mono PCM → whisper.cpp → segments → Flutter UI

Enter fullscreen mode

Exit fullscreen mode

The heavy lifting lives in a small FFI plugin, extracter_native , with one C ABI shared by every platform:

ex_job_start(media, model, language, translate, threads) starts a job on a native worker thread and returns an id.

ex_job_cancel(id) is idempotent.

The worker posts events back to Dart: progress,…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.