Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Publish flutter packages for Android #1074

Merged
merged 19 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
468 changes: 459 additions & 9 deletions .github/workflows/release-dart-package.yaml

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions .github/workflows/test-dart-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,51 @@ jobs:
dart --version
flutter doctor

- name: Display sherpa-onnx package info
shell: bash
run: |
cd dart-api-examples/vad
flutter pub get

if [[ ${{ matrix.os }} == ubuntu-latest ]]; then
echo "-----"
ls -lh /home/runner/work/_temp/pub-cache/hosted/pub.dev

echo "-----"
ls -lh /home/runner/work/_temp/pub-cache/hosted/pub.dev/sherpa_onnx*

echo "-----"
ls -lh /home/runner/work/_temp/pub-cache/hosted/pub.dev/sherpa_onnx*/*

echo "-----"
ls -lh /home/runner/work/_temp/pub-cache/hosted/pub.dev/sherpa_onnx_linux-*

# sudo mkdir /home/runner/work/_temp/pub-cache/hosted/pub.dev/sherpa_onnx_linux-1.10.7/lib
# sudo touch /home/runner/work/_temp/pub-cache/hosted/pub.dev/sherpa_onnx_linux-1.10.7/lib/.gitkeep

echo "-----"
ls -lh /home/runner/work/_temp/pub-cache/hosted/pub.dev/sherpa_onnx_linux-*/linux
elif [[ ${{ matrix.os }} == macos-latest ]]; then
echo "-----"
ls -lh /Users/runner/work/_temp/pub-cache/hosted/pub.dev

echo "-----"
ls -lh /Users/runner/work/_temp/pub-cache/hosted/pub.dev/sherpa_onnx*

echo "-----"
ls -lh /Users/runner/work/_temp/pub-cache/hosted/pub.dev/sherpa_onnx*/*

echo "-----"
ls -lh /Users/runner/work/_temp/pub-cache/hosted/pub.dev/sherpa_onnx_macos-*/

echo "-----"
ls -lh /Users/runner/work/_temp/pub-cache/hosted/pub.dev/sherpa_onnx_macos-*/macos

# sudo mkdir /Users/runner/work/_temp/pub-cache/hosted/pub.dev/sherpa_onnx_macos-1.10.7/lib
# sudo touch /Users/runner/work/_temp/pub-cache/hosted/pub.dev/sherpa_onnx_macos-1.10.7/lib/.gitkeep
fi


- name: Run tests
shell: bash
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,4 @@ sherpa-onnx-nemo-*
sherpa-onnx-vits-*
sherpa-onnx-telespeech-ctc-*
*.fst
.ccache
10 changes: 9 additions & 1 deletion flutter/sherpa_onnx/CHANGELOG.md → CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
## 1.10.9

* Fix released packages. piper-phonemize was not included in v1.10.8.

## 1.10.8

* Fix released packages. There should be a lib directory.

## 1.10.7

* Support Android
* Support Android for Flutter.

## 1.10.2

Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ project(sherpa-onnx)
# ./nodejs-addon-examples
# ./dart-api-examples/
# ./sherpa-onnx/flutter/CHANGELOG.md
set(SHERPA_ONNX_VERSION "1.10.6")
set(SHERPA_ONNX_VERSION "1.10.9")

# Disable warning about
#
Expand Down Expand Up @@ -61,7 +61,7 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()

if(DEFINED ANDROID_ABI AND NOT SHERPA_ONNX_ENABLE_JNI)
if(DEFINED ANDROID_ABI AND NOT SHERPA_ONNX_ENABLE_JNI AND NOT SHERPA_ONNX_ENABLE_C_API)
message(STATUS "Set SHERPA_ONNX_ENABLE_JNI to ON for Android")
set(SHERPA_ONNX_ENABLE_JNI ON CACHE BOOL "" FORCE)
endif()
Expand Down
2 changes: 1 addition & 1 deletion dart-api-examples/non-streaming-asr/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ environment:

# Add regular dependencies here.
dependencies:
sherpa_onnx: ^1.10.2
sherpa_onnx: ^1.10.9
path: ^1.9.0
args: ^2.5.0

Expand Down
2 changes: 1 addition & 1 deletion dart-api-examples/streaming-asr/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ environment:

# Add regular dependencies here.
dependencies:
sherpa_onnx: ^1.10.2
sherpa_onnx: ^1.10.9
path: ^1.9.0
args: ^2.5.0

Expand Down
2 changes: 1 addition & 1 deletion dart-api-examples/tts/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ environment:

# Add regular dependencies here.
dependencies:
sherpa_onnx: ^1.10.2
sherpa_onnx: ^1.10.9
path: ^1.9.0
args: ^2.5.0

Expand Down
2 changes: 1 addition & 1 deletion dart-api-examples/vad/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ environment:
sdk: ^3.4.0

dependencies:
sherpa_onnx: ^1.10.2
sherpa_onnx: ^1.10.9
path: ^1.9.0
args: ^2.5.0

Expand Down
2 changes: 1 addition & 1 deletion flutter-examples/streaming_asr/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies:
record: ^5.1.0
url_launcher: ^6.2.6

sherpa_onnx: ^1.10.0
sherpa_onnx: ^1.10.9
# sherpa_onnx:
# path: ../../flutter/sherpa_onnx

Expand Down
2 changes: 1 addition & 1 deletion sherpa-onnx/flutter/notes.md → flutter/notes2.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Usage
# Some use commands while learning flutter/dart

## macOS

Expand Down
3 changes: 0 additions & 3 deletions flutter/sherpa_onnx/README.md

This file was deleted.

26 changes: 11 additions & 15 deletions flutter/sherpa_onnx/example/example.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
# sherpa-onnx app example

See also <https://github.com/k2-fsa/sherpa-onnx/tree/master/flutter-examples>
## Flutter examples

## Streaming speech recognition
| Functions | URL | Supported Platforms|
|---|---|---|
|Streaming speech recognition| [Address](https://github.com/k2-fsa/sherpa-onnx/tree/master/flutter-examples/streaming_asr)| Android, macOS, Windows|

Please see https://github.com/k2-fsa/sherpa-onnx/tree/master/dart-api-examples/streaming-asr

## Non-streaming speech recognition

Please see https://github.com/k2-fsa/sherpa-onnx/tree/master/dart-api-examples/non-streaming-asr

## Text to speech (TTS)

Please see https://github.com/k2-fsa/sherpa-onnx/tree/master/dart-api-examples/tts

## Voice activity detection (VAD)

Please see https://github.com/k2-fsa/sherpa-onnx/tree/master/dart-api-examples/vad
## Pure dart-examples

| Functions | URL | Supported Platforms|
|---|---|---|
|Streaming speech recognition| [Address](https://github.com/k2-fsa/sherpa-onnx/tree/master/dart-api-examples/streaming-asr)| macOS, Windows, Linux|
|Non-Streaming speech recognition| [Address](https://github.com/k2-fsa/sherpa-onnx/tree/master/dart-api-examples/non-streaming-asr)| macOS, Windows, Linux|
|Text to speech| [Address](https://github.com/k2-fsa/sherpa-onnx/tree/master/dart-api-examples/tts)| macOS, Windows, Linux|
|Voice activity detection (VAD)| [Address](https://github.com/k2-fsa/sherpa-onnx/tree/master/dart-api-examples/vad)| macOS, Windows, Linux|
14 changes: 7 additions & 7 deletions flutter/sherpa_onnx/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: >
Speech recognition, speech synthesis, and speaker recognition using next-gen Kaldi
with onnxruntime without Internet connection.

repository: https://github.com/k2-fsa/sherpa-onnx/tree/master/sherpa-onnx/flutter
repository: https://github.com/k2-fsa/sherpa-onnx/tree/master/flutter

issue_tracker: https://github.com/k2-fsa/sherpa-onnx/issues
documentation: https://k2-fsa.github.io/sherpa/onnx/
Expand All @@ -16,8 +16,8 @@ topics:
- audio-tagging
- voice-activity-detection

# remember to change the version in ../sherpa_onnx_macos/macos/sherpa_onnx.podspec
version: 1.10.7
# remember to change the version in ../sherpa_onnx_macos/macos/sherpa_onnx_macos.podspec
version: 1.10.9

homepage: https://github.com/k2-fsa/sherpa-onnx

Expand All @@ -30,16 +30,16 @@ dependencies:
flutter:
sdk: flutter

sherpa_onnx_android:
sherpa_onnx_android: ^1.10.9
# path: ../sherpa_onnx_android

sherpa_onnx_macos:
sherpa_onnx_macos: ^1.10.9
# path: ../sherpa_onnx_macos

sherpa_onnx_linux:
sherpa_onnx_linux: ^1.10.9
# path: ../sherpa_onnx_linux
#
sherpa_onnx_windows:
sherpa_onnx_windows: ^1.10.9
# path: ../sherpa_onnx_windows

flutter:
Expand Down
43 changes: 0 additions & 43 deletions flutter/sherpa_onnx_android/example/.gitignore

This file was deleted.

9 changes: 0 additions & 9 deletions flutter/sherpa_onnx_android/example/README.md

This file was deleted.

18 changes: 0 additions & 18 deletions flutter/sherpa_onnx_android/example/example.md

This file was deleted.

3 changes: 3 additions & 0 deletions flutter/sherpa_onnx_android/lib/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Introduction

This directory is left empty intentionally.
21 changes: 19 additions & 2 deletions flutter/sherpa_onnx_android/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
name: sherpa_onnx_android
description: "A new Flutter FFI plugin project."

description: >
Speech recognition, speech synthesis, and speaker recognition using next-gen Kaldi
with onnxruntime without Internet connection.

version: 0.0.1
homepage:

repository: https://github.com/k2-fsa/sherpa-onnx/tree/master/flutter

issue_tracker: https://github.com/k2-fsa/sherpa-onnx/issues
documentation: https://k2-fsa.github.io/sherpa/onnx/

homepage: https://github.com/k2-fsa/sherpa-onnx

topics:
- speech-recognition
- speech-synthesis
- speaker-identification
- audio-tagging
- voice-activity-detection

environment:
sdk: '>=3.4.0 <4.0.0'
Expand Down
43 changes: 0 additions & 43 deletions flutter/sherpa_onnx_linux/example/.gitignore

This file was deleted.

9 changes: 0 additions & 9 deletions flutter/sherpa_onnx_linux/example/README.md

This file was deleted.

18 changes: 0 additions & 18 deletions flutter/sherpa_onnx_linux/example/example.md

This file was deleted.

3 changes: 3 additions & 0 deletions flutter/sherpa_onnx_linux/lib/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Introduction

This directory is left empty intentionally.
Loading
Loading