Skip to content

Template Project For iOS Apps using .onnx Speech Models for Speech Diarization

Notifications You must be signed in to change notification settings

carlosmbe/SpeechDiarizationStarter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SwiftUI Speech Diarization Example

Note: This project is currently under development and this README will be periodcally updated.

Project Overview

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.

Getting Started

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.

Download Required Framework

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.

Building Directly From Sherpa Onnx

Clone the original k2-fsa/sherpa-onnx repository and follow its detailed build instructions.

Summary of Build Steps

  1. Clone the reposity git clone https://git.1-hub.cnk2-fsa/sherpa-onnx
  2. Enter the repo directory cd sherpa-onnx
  3. Run the ios build script with ./build-ios.sh
  4. After the script completes, there will be a new folder named build-ios
  5. Copy sherpa-onnx.xcframework to your XCode project
  6. 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 from ios-onnxruntime -> 1.17.1 -> onnxruntime.xcframework
Screenshot 2025-04-10 at 1 01 38 PM

The Actual App

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

Contributing

Contributions and suggestions are welcome as the project is actively evolving.


Updates and additional documentation will be provided as development progresses.

About

Template Project For iOS Apps using .onnx Speech Models for Speech Diarization

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published