Top AI Repos โ open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
๐ค The easiest way to transcribe audio in Swift
| Date | Stars |
|---|---|
| 2026-07-24 | 784 |
| 2026-07-25 | 784 |
| 2026-07-28 | 783 |
| 2026-07-30 | 783 |
| 2026-08-06 | 783 |
Today
โ stars today
This week
โ stars this week
This month
โ stars this month
Momentum
0.0
growth rate 0.00%/day
# SwiftWhisper
> The easiest way to use Whisper in Swift
Easily add transcription to your app or package. Powered by [whisper.cpp](https://github.com/ggerganov/whisper.cpp).
[](https://swiftpackageindex.com/exPHAT/SwiftWhisper)
[](https://swiftpackageindex.com/exPHAT/SwiftWhisper)
## Install
#### Swift Package Manager
Add SwiftWhisper as a dependency in your `Package.swift` file:
```swift
let package = Package(
...
dependencies: [
// Add the package to your dependencies
.package(url: "https://github.com/exPHAT/SwiftWhisper.git", branch: "master"),
],
...
targets: [
// Add SwiftWhisper as a dependency on any target you want to use it in
.target(name: "MyTarget",
dependencies: [.byName(name: "SwiftWhisper")])
]
...
)
```
#### Xcode
Add `https://github.com/exPHAT/SwiftWhisper.git` in the ["Swift Package Manager" tab.](https://developer.apple.com/documentation/xcode/adding-package-dependencies-to-your-app)
## Usage
[API Documentation.](https://swiftpackageindex.com/exPHAT/SwiftWhisper/1.0.1/documentation/)
```swift
import SwiftWhisper
let whisper = Whisper(fromFileURL: /* Model file URL */)
let segments = try await whisper.transcribe(audioFrames: /* 16kHz PCM audio frames */)
print("Transcribed audio:", segments.map(\.text).joined())
```
#### Delegate methods
You can subscribe to segments, transcription progress, and errors by implementing `WhisperDelegate` and setting `whisper.delegate = ...`
```swift
protocol WhisperDelegate {
// Progress updates as a percentage from 0-1
func whisper(_ aWhisper: Whisper, didUpdateProgress progress: Double)
// Any time a new segments of text have been transcribed
func whisper(_ aWhisper: Whisper, didProcessNewSegments segments: [Segment], atIndex index: Int)
// Finished transcribing, includes all transcribed segments of text
func whisper(_ aWhisper: Whisper, didCompleteWithSegments segments: [Segment])
// Error with transcription
func whisper(_ aWhisper: Whisper, didErrorWith error: Error)
}
```
## Misc
### Downloading Models :inbox_tray:
You can find the pre-trained models [here](https://huggingface.co/ggerganov/whisper.cpp) for download.
### CoreML Support :brain:
To use CoreML, you'll need to include a CoreML model file with the suffix `-encoder.mlmodelc` under the same name as the whisper model (Example: `tiny.bin` would also sit beside a `tiny-encoder.mlmodelc` file). In addition to the additonal model file, you will also need to use the `Whisper(fromFileURL:)` initializer. You can verify CoreML is active by checking the console output during transcription.
### Converting audio to 16kHz PCM :wrench:
The easiest way to get audio frames into SwiftWhisper is to use [AudioKit](https://github.com/AudioKit/AudioKit). The following example takes an input audio file, converts and resamples it, and returns an array of 16kHz PCM floats.
```swift
import AudioKit
func convertAudioFileToPCMArray(fileURL: URL, completionHandler: @escaping (Result<[Float], Error>) -> Void) {
var options = FormatConverter.Options()
options.format = .wav
options.sampleRate = 16000
options.bitDepth = 16
options.channels = 1
options.isInterleaved = false
let tempURL = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent(UUID().uuidString)
let converter = FormatConverter(inputURL: fileURL, outputURL: tempURL, options: options)
converter.start { error in
if let error {
completionHandler(.failure(error))
return
}
let data = try! Data(contentsOf: tempURL) // Handle error here
let floats = stride(from: 44, to: data.count, by: 2).map {
rExcerpt of 5,157 characters
Read on GitHub62
1
Would you bet a product on this? Bounded 0โ100 and slow moving.
matched fp:23ad96b319fa869f, topic:speech-recognition, topic:whisper, topic:speech-to-text