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.

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.mlmodelcfile 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
fastbranch compiled with-O3to 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
.binmodel - Transcription is intentionally slow in Debug builds; the README warns you should use Release configuration or the
fastbranch
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.