← all repositories
exPHAT/SwiftWhisper

Swift wrapper hides whisper.cpp’s C++ rough edges

It repackages whisper.cpp as a Swift-native API so you can transcribe audio offline without writing C++ bridging headers.

SwiftWhisper
Not currently ranked — collecting fresh signals.
star history

What it does

SwiftWhisper wraps ggerganov’s whisper.cpp in a Swift package, exposing an async transcribe method that takes 16kHz PCM audio frames and returns segmented text. It runs entirely offline using local .bin models and offers delegate callbacks for progress updates, partial segments, and errors.

The interesting bit

The entire project is essentially glue code, but that is the point. It turns a C++ inference engine into something that feels native to Swift—complete with async/await, protocol-based delegates, and SPM integration—so adding on-device speech-to-text to an iOS or macOS app does not require wrestling with C++ interop.

Key highlights

  • Runs fully offline using local Whisper models
  • Supports CoreML acceleration on Apple Silicon when a matching -encoder.mlmodelc file is provided alongside the base model
  • Provides real-time delegate hooks for transcription progress and partial segment updates
  • Distributed as a standard Swift Package Manager dependency
  • Offers a fast branch compiled with -O3 to mitigate sluggish performance in Debug builds

Caveats

  • Audio must be pre-converted to 16kHz PCM; the README suggests AudioKit but the library does not bundle conversion utilities
  • CoreML support requires manually downloading and pairing an additional encoder model file with your base .bin model
  • Transcription is intentionally slow in Debug builds; the README warns you should use Release configuration or the fast branch

Verdict

A solid choice if you need offline speech-to-text in a Swift codebase and would rather not maintain C++ bridging layers. Look elsewhere if you need a bundled audio pipeline or cloud-based transcription.

Frequently asked

What is exPHAT/SwiftWhisper?
It repackages whisper.cpp as a Swift-native API so you can transcribe audio offline without writing C++ bridging headers.
Is SwiftWhisper open source?
Yes — exPHAT/SwiftWhisper is open source, released under the MIT license.
What language is SwiftWhisper written in?
exPHAT/SwiftWhisper is primarily written in Swift.
How popular is SwiftWhisper?
exPHAT/SwiftWhisper has 784 stars on GitHub.
Where can I find SwiftWhisper?
exPHAT/SwiftWhisper is on GitHub at https://github.com/exPHAT/SwiftWhisper.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.