Add Flutter example for speaker identification (#894)

This commit is contained in:
Fangjun Kuang
2024-05-21 20:38:52 +08:00
committed by GitHub
parent b445956675
commit 4593ab49d1
46 changed files with 3317 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
# Usage
## macOS
1. Build required libraries
```bash
git clone https://github.com/k2-fsa/sherpa-onnx
cd sherpa-onnx
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=./install -DBUILD_SHARED_LIBS=ON -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" ..
make install
cd ../sherpa-onnx/flutter/
cp -v ../../build/install/lib/lib* ./macos/
```
2. Test for speaker identification
```bash
cd sherpa-onnx/sherpa-onnx/flutter/example
mkdir assets
```
## Useful commands
```
flutter pub publish --dry-run
flutter run -d macos
flutter run -d linux
flutter run -d windows
flutter build macos
flutter run --release -d macos
# add platform to an existing project
flutter create --platforms=windows,macos,linux .
dart analyze
```