Note: This project is currently under development and this README will be periodcally updated.
This repository aims to refactor and simplify the SwiftUI example provided by k2-fsa/sherpa-onnx, specifically focusing on Speech Diarization.
I wrote a companion article breaking down how and why I built this project.
If you clone and attempt to build this project immediately, you will encounter errors due to the absence of the required onnxruntime
framework, which is too large to include directly in this repository.
After adding the onnxruntime
framework, you may still encounter errors. You will need to build and add Sherpa-Onnx.xcframework
to your project. Follow the steps in Building Directly From Sherpa Onnx
Follow the same steps if don't have the Sherpa-Onnx.xcframework
in your project.
After getting a successful build. You can test the app by picking a file containing Audio using the File Picker, otherwise you can change line 18
in ContentView
to hardcode a file in your bundle for testing.
You can download the onnxruntime
framework from the following link:
Download onnxruntime.xcframework-1.17.1.tar.bz2
Extract the downloaded archive and copy the onnxruntime.xcframework
to your Xcode project directory.
Clone the original k2-fsa/sherpa-onnx repository and follow its detailed build instructions.
- Clone the reposity
git clone https://git.1-hub.cnk2-fsa/sherpa-onnx
- Enter the repo directory
cd sherpa-onnx
- Run the ios build script with
./build-ios.sh
- After the script completes, there will be a new folder named
build-ios
- Copy
sherpa-onnx.xcframework
to your XCode project - The
onnxruntime.xcframework
here in this folder is the same as the one from the last section, so if you haven't downloaded it. Copy it fromios-onnxruntime -> 1.17.1 -> onnxruntime.xcframework

The App requires you to select an Audio/Video file
It then converts it to a format that the speech diarization model accepts
Afterwards, run the model and the results will eventually replace the placehodler text
Screen.Recording.2025-04-11.at.8.55.42.PM.mov
Contributions and suggestions are welcome as the project is actively evolving.
Updates and additional documentation will be provided as development progresses.