Fangjun Kuang
Committed by GitHub

Add API to get version information (#2309)

正在显示 169 个修改的文件 包含 1480 行增加12 行删除
@@ -2,7 +2,11 @@ @@ -2,7 +2,11 @@
2 2
3 cd dotnet-examples/ 3 cd dotnet-examples/
4 4
5 -cd ./speech-enhancement-gtcrn 5 +cd ./version-test
  6 +./run.sh
  7 +ls -lh
  8 +
  9 +cd ../speech-enhancement-gtcrn
6 ./run.sh 10 ./run.sh
7 ls -lh 11 ls -lh
8 12
@@ -7,6 +7,8 @@ echo "pwd: $PWD" @@ -7,6 +7,8 @@ echo "pwd: $PWD"
7 cd swift-api-examples 7 cd swift-api-examples
8 ls -lh 8 ls -lh
9 9
  10 +./run-test-version.sh
  11 +
10 ./run-decode-file-sense-voice-with-hr.sh 12 ./run-decode-file-sense-voice-with-hr.sh
11 rm -rf sherpa-onnx-sense-voice-* 13 rm -rf sherpa-onnx-sense-voice-*
12 rm -rf dict lexicon.txt replace.fst test-hr.wav 14 rm -rf dict lexicon.txt replace.fst test-hr.wav
@@ -58,6 +58,12 @@ jobs: @@ -58,6 +58,12 @@ jobs:
58 with: 58 with:
59 fetch-depth: 0 59 fetch-depth: 0
60 60
  61 + - name: Update version
  62 + shell: bash
  63 + run: |
  64 + ./new-release.sh
  65 + git diff .
  66 +
61 - name: Build sherpa-onnx 67 - name: Build sherpa-onnx
62 if: matrix.gpu == 'ON' 68 if: matrix.gpu == 'ON'
63 shell: bash 69 shell: bash
@@ -43,6 +43,12 @@ jobs: @@ -43,6 +43,12 @@ jobs:
43 with: 43 with:
44 fetch-depth: 0 44 fetch-depth: 0
45 45
  46 + - name: Update version
  47 + shell: bash
  48 + run: |
  49 + ./new-release.sh
  50 + git diff .
  51 +
46 - name: Build sherpa-onnx 52 - name: Build sherpa-onnx
47 uses: addnab/docker-run-action@v3 53 uses: addnab/docker-run-action@v3
48 with: 54 with:
@@ -47,6 +47,12 @@ jobs: @@ -47,6 +47,12 @@ jobs:
47 with: 47 with:
48 key: ${{ matrix.os }}-android-rknn 48 key: ${{ matrix.os }}-android-rknn
49 49
  50 + - name: Update version
  51 + shell: bash
  52 + run: |
  53 + ./new-release.sh
  54 + git diff .
  55 +
50 - name: Display NDK HOME 56 - name: Display NDK HOME
51 shell: bash 57 shell: bash
52 run: | 58 run: |
@@ -158,6 +164,12 @@ jobs: @@ -158,6 +164,12 @@ jobs:
158 with: 164 with:
159 fetch-depth: 0 165 fetch-depth: 0
160 166
  167 + - name: Update version
  168 + shell: bash
  169 + run: |
  170 + ./new-release.sh
  171 + git diff .
  172 +
161 # https://github.com/actions/setup-java 173 # https://github.com/actions/setup-java
162 - uses: actions/setup-java@v4 174 - uses: actions/setup-java@v4
163 with: 175 with:
@@ -45,6 +45,12 @@ jobs: @@ -45,6 +45,12 @@ jobs:
45 with: 45 with:
46 fetch-depth: 0 46 fetch-depth: 0
47 47
  48 + - name: Update version
  49 + shell: bash
  50 + run: |
  51 + ./new-release.sh
  52 + git diff .
  53 +
48 - name: ccache 54 - name: ccache
49 uses: hendrikmuhs/ccache-action@v1.2 55 uses: hendrikmuhs/ccache-action@v1.2
50 with: 56 with:
@@ -190,6 +196,12 @@ jobs: @@ -190,6 +196,12 @@ jobs:
190 with: 196 with:
191 fetch-depth: 0 197 fetch-depth: 0
192 198
  199 + - name: Update version
  200 + shell: bash
  201 + run: |
  202 + ./new-release.sh
  203 + git diff .
  204 +
193 # https://github.com/actions/setup-java 205 # https://github.com/actions/setup-java
194 - uses: actions/setup-java@v4 206 - uses: actions/setup-java@v4
195 with: 207 with:
@@ -42,6 +42,12 @@ jobs: @@ -42,6 +42,12 @@ jobs:
42 with: 42 with:
43 fetch-depth: 0 43 fetch-depth: 0
44 44
  45 + - name: Update version
  46 + shell: bash
  47 + run: |
  48 + ./new-release.sh
  49 + git diff .
  50 +
45 - name: ccache 51 - name: ccache
46 uses: hendrikmuhs/ccache-action@v1.2 52 uses: hendrikmuhs/ccache-action@v1.2
47 with: 53 with:
@@ -184,6 +190,12 @@ jobs: @@ -184,6 +190,12 @@ jobs:
184 with: 190 with:
185 fetch-depth: 0 191 fetch-depth: 0
186 192
  193 + - name: Update version
  194 + shell: bash
  195 + run: |
  196 + ./new-release.sh
  197 + git diff .
  198 +
187 # https://github.com/actions/setup-java 199 # https://github.com/actions/setup-java
188 - uses: actions/setup-java@v4 200 - uses: actions/setup-java@v4
189 with: 201 with:
@@ -31,6 +31,12 @@ jobs: @@ -31,6 +31,12 @@ jobs:
31 with: 31 with:
32 fetch-depth: 0 32 fetch-depth: 0
33 33
  34 + - name: Update version
  35 + shell: bash
  36 + run: |
  37 + ./new-release.sh
  38 + git diff .
  39 +
34 # https://github.com/actions/setup-java 40 # https://github.com/actions/setup-java
35 - uses: actions/setup-java@v4 41 - uses: actions/setup-java@v4
36 with: 42 with:
@@ -31,6 +31,12 @@ jobs: @@ -31,6 +31,12 @@ jobs:
31 with: 31 with:
32 fetch-depth: 0 32 fetch-depth: 0
33 33
  34 + - name: Update version
  35 + shell: bash
  36 + run: |
  37 + ./new-release.sh
  38 + git diff .
  39 +
34 # https://github.com/actions/setup-java 40 # https://github.com/actions/setup-java
35 - uses: actions/setup-java@v4 41 - uses: actions/setup-java@v4
36 with: 42 with:
@@ -31,6 +31,12 @@ jobs: @@ -31,6 +31,12 @@ jobs:
31 with: 31 with:
32 fetch-depth: 0 32 fetch-depth: 0
33 33
  34 + - name: Update version
  35 + shell: bash
  36 + run: |
  37 + ./new-release.sh
  38 + git diff .
  39 +
34 # https://github.com/actions/setup-java 40 # https://github.com/actions/setup-java
35 - uses: actions/setup-java@v4 41 - uses: actions/setup-java@v4
36 with: 42 with:
@@ -31,6 +31,12 @@ jobs: @@ -31,6 +31,12 @@ jobs:
31 with: 31 with:
32 fetch-depth: 0 32 fetch-depth: 0
33 33
  34 + - name: Update version
  35 + shell: bash
  36 + run: |
  37 + ./new-release.sh
  38 + git diff .
  39 +
34 # https://github.com/actions/setup-java 40 # https://github.com/actions/setup-java
35 - uses: actions/setup-java@v4 41 - uses: actions/setup-java@v4
36 with: 42 with:
@@ -31,6 +31,12 @@ jobs: @@ -31,6 +31,12 @@ jobs:
31 with: 31 with:
32 fetch-depth: 0 32 fetch-depth: 0
33 33
  34 + - name: Update version
  35 + shell: bash
  36 + run: |
  37 + ./new-release.sh
  38 + git diff .
  39 +
34 # https://github.com/actions/setup-java 40 # https://github.com/actions/setup-java
35 - uses: actions/setup-java@v4 41 - uses: actions/setup-java@v4
36 with: 42 with:
@@ -31,6 +31,12 @@ jobs: @@ -31,6 +31,12 @@ jobs:
31 with: 31 with:
32 fetch-depth: 0 32 fetch-depth: 0
33 33
  34 + - name: Update version
  35 + shell: bash
  36 + run: |
  37 + ./new-release.sh
  38 + git diff .
  39 +
34 # https://github.com/actions/setup-java 40 # https://github.com/actions/setup-java
35 - uses: actions/setup-java@v4 41 - uses: actions/setup-java@v4
36 with: 42 with:
@@ -31,6 +31,12 @@ jobs: @@ -31,6 +31,12 @@ jobs:
31 with: 31 with:
32 fetch-depth: 0 32 fetch-depth: 0
33 33
  34 + - name: Update version
  35 + shell: bash
  36 + run: |
  37 + ./new-release.sh
  38 + git diff .
  39 +
34 # https://github.com/actions/setup-java 40 # https://github.com/actions/setup-java
35 - uses: actions/setup-java@v4 41 - uses: actions/setup-java@v4
36 with: 42 with:
@@ -31,6 +31,12 @@ jobs: @@ -31,6 +31,12 @@ jobs:
31 with: 31 with:
32 fetch-depth: 0 32 fetch-depth: 0
33 33
  34 + - name: Update version
  35 + shell: bash
  36 + run: |
  37 + ./new-release.sh
  38 + git diff .
  39 +
34 # https://github.com/actions/setup-java 40 # https://github.com/actions/setup-java
35 - uses: actions/setup-java@v4 41 - uses: actions/setup-java@v4
36 with: 42 with:
@@ -31,6 +31,12 @@ jobs: @@ -31,6 +31,12 @@ jobs:
31 with: 31 with:
32 fetch-depth: 0 32 fetch-depth: 0
33 33
  34 + - name: Update version
  35 + shell: bash
  36 + run: |
  37 + ./new-release.sh
  38 + git diff .
  39 +
34 # https://github.com/actions/setup-java 40 # https://github.com/actions/setup-java
35 - uses: actions/setup-java@v4 41 - uses: actions/setup-java@v4
36 with: 42 with:
@@ -31,6 +31,12 @@ jobs: @@ -31,6 +31,12 @@ jobs:
31 with: 31 with:
32 fetch-depth: 0 32 fetch-depth: 0
33 33
  34 + - name: Update version
  35 + shell: bash
  36 + run: |
  37 + ./new-release.sh
  38 + git diff .
  39 +
34 # https://github.com/actions/setup-java 40 # https://github.com/actions/setup-java
35 - uses: actions/setup-java@v4 41 - uses: actions/setup-java@v4
36 with: 42 with:
@@ -31,6 +31,12 @@ jobs: @@ -31,6 +31,12 @@ jobs:
31 with: 31 with:
32 fetch-depth: 0 32 fetch-depth: 0
33 33
  34 + - name: Update version
  35 + shell: bash
  36 + run: |
  37 + ./new-release.sh
  38 + git diff .
  39 +
34 # https://github.com/actions/setup-java 40 # https://github.com/actions/setup-java
35 - uses: actions/setup-java@v4 41 - uses: actions/setup-java@v4
36 with: 42 with:
@@ -31,6 +31,12 @@ jobs: @@ -31,6 +31,12 @@ jobs:
31 with: 31 with:
32 fetch-depth: 0 32 fetch-depth: 0
33 33
  34 + - name: Update version
  35 + shell: bash
  36 + run: |
  37 + ./new-release.sh
  38 + git diff .
  39 +
34 # https://github.com/actions/setup-java 40 # https://github.com/actions/setup-java
35 - uses: actions/setup-java@v4 41 - uses: actions/setup-java@v4
36 with: 42 with:
@@ -31,6 +31,12 @@ jobs: @@ -31,6 +31,12 @@ jobs:
31 with: 31 with:
32 fetch-depth: 0 32 fetch-depth: 0
33 33
  34 + - name: Update version
  35 + shell: bash
  36 + run: |
  37 + ./new-release.sh
  38 + git diff .
  39 +
34 # https://github.com/actions/setup-java 40 # https://github.com/actions/setup-java
35 - uses: actions/setup-java@v4 41 - uses: actions/setup-java@v4
36 with: 42 with:
@@ -44,6 +44,12 @@ jobs: @@ -44,6 +44,12 @@ jobs:
44 with: 44 with:
45 fetch-depth: 0 45 fetch-depth: 0
46 46
  47 + - name: Update version
  48 + shell: bash
  49 + run: |
  50 + ./new-release.sh
  51 + git diff .
  52 +
47 - name: ccache 53 - name: ccache
48 uses: hendrikmuhs/ccache-action@v1.2 54 uses: hendrikmuhs/ccache-action@v1.2
49 with: 55 with:
@@ -26,6 +26,12 @@ jobs: @@ -26,6 +26,12 @@ jobs:
26 with: 26 with:
27 fetch-depth: 0 27 fetch-depth: 0
28 28
  29 + - name: Update version
  30 + shell: bash
  31 + run: |
  32 + ./new-release.sh
  33 + git diff .
  34 +
29 - name: ccache 35 - name: ccache
30 uses: hendrikmuhs/ccache-action@v1.2 36 uses: hendrikmuhs/ccache-action@v1.2
31 with: 37 with:
@@ -27,6 +27,12 @@ jobs: @@ -27,6 +27,12 @@ jobs:
27 steps: 27 steps:
28 - uses: actions/checkout@v4 28 - uses: actions/checkout@v4
29 29
  30 + - name: Update version
  31 + shell: bash
  32 + run: |
  33 + ./new-release.sh
  34 + git diff .
  35 +
30 # see https://cibuildwheel.readthedocs.io/en/stable/changelog/ 36 # see https://cibuildwheel.readthedocs.io/en/stable/changelog/
31 # for a list of versions 37 # for a list of versions
32 - name: Build wheels 38 - name: Build wheels
@@ -25,6 +25,12 @@ jobs: @@ -25,6 +25,12 @@ jobs:
25 with: 25 with:
26 fetch-depth: 0 26 fetch-depth: 0
27 27
  28 + - name: Update version
  29 + shell: bash
  30 + run: |
  31 + ./new-release.sh
  32 + git diff .
  33 +
28 - name: Setup Python 34 - name: Setup Python
29 uses: actions/setup-python@v5 35 uses: actions/setup-python@v5
30 with: 36 with:
@@ -29,6 +29,12 @@ jobs: @@ -29,6 +29,12 @@ jobs:
29 steps: 29 steps:
30 - uses: actions/checkout@v4 30 - uses: actions/checkout@v4
31 31
  32 + - name: Update version
  33 + shell: bash
  34 + run: |
  35 + ./new-release.sh
  36 + git diff .
  37 +
32 # see https://cibuildwheel.readthedocs.io/en/stable/changelog/ 38 # see https://cibuildwheel.readthedocs.io/en/stable/changelog/
33 # for a list of versions 39 # for a list of versions
34 - name: Build wheels 40 - name: Build wheels
@@ -26,6 +26,12 @@ jobs: @@ -26,6 +26,12 @@ jobs:
26 steps: 26 steps:
27 - uses: actions/checkout@v4 27 - uses: actions/checkout@v4
28 28
  29 + - name: Update version
  30 + shell: bash
  31 + run: |
  32 + ./new-release.sh
  33 + git diff .
  34 +
29 - name: Set up QEMU 35 - name: Set up QEMU
30 uses: docker/setup-qemu-action@v2 36 uses: docker/setup-qemu-action@v2
31 with: 37 with:
@@ -26,6 +26,12 @@ jobs: @@ -26,6 +26,12 @@ jobs:
26 steps: 26 steps:
27 - uses: actions/checkout@v4 27 - uses: actions/checkout@v4
28 28
  29 + - name: Update version
  30 + shell: bash
  31 + run: |
  32 + ./new-release.sh
  33 + git diff .
  34 +
29 - name: Setup Python ${{ matrix.python-version }} 35 - name: Setup Python ${{ matrix.python-version }}
30 uses: actions/setup-python@v5 36 uses: actions/setup-python@v5
31 with: 37 with:
@@ -28,6 +28,12 @@ jobs: @@ -28,6 +28,12 @@ jobs:
28 steps: 28 steps:
29 - uses: actions/checkout@v4 29 - uses: actions/checkout@v4
30 30
  31 + - name: Update version
  32 + shell: bash
  33 + run: |
  34 + ./new-release.sh
  35 + git diff .
  36 +
31 # see https://cibuildwheel.readthedocs.io/en/stable/changelog/ 37 # see https://cibuildwheel.readthedocs.io/en/stable/changelog/
32 # for a list of versions 38 # for a list of versions
33 - name: Build wheels 39 - name: Build wheels
@@ -26,6 +26,12 @@ jobs: @@ -26,6 +26,12 @@ jobs:
26 steps: 26 steps:
27 - uses: actions/checkout@v4 27 - uses: actions/checkout@v4
28 28
  29 + - name: Update version
  30 + shell: bash
  31 + run: |
  32 + ./new-release.sh
  33 + git diff .
  34 +
29 - name: Build wheels 35 - name: Build wheels
30 uses: pypa/cibuildwheel@v2.21.3 36 uses: pypa/cibuildwheel@v2.21.3
31 env: 37 env:
@@ -26,6 +26,12 @@ jobs: @@ -26,6 +26,12 @@ jobs:
26 steps: 26 steps:
27 - uses: actions/checkout@v4 27 - uses: actions/checkout@v4
28 28
  29 + - name: Update version
  30 + shell: bash
  31 + run: |
  32 + ./new-release.sh
  33 + git diff .
  34 +
29 - name: Build wheels 35 - name: Build wheels
30 uses: pypa/cibuildwheel@v2.21.3 36 uses: pypa/cibuildwheel@v2.21.3
31 env: 37 env:
@@ -26,6 +26,12 @@ jobs: @@ -26,6 +26,12 @@ jobs:
26 steps: 26 steps:
27 - uses: actions/checkout@v4 27 - uses: actions/checkout@v4
28 28
  29 + - name: Update version
  30 + shell: bash
  31 + run: |
  32 + ./new-release.sh
  33 + git diff .
  34 +
29 # see https://cibuildwheel.readthedocs.io/en/stable/changelog/ 35 # see https://cibuildwheel.readthedocs.io/en/stable/changelog/
30 # for a list of versions 36 # for a list of versions
31 - name: Build wheels 37 - name: Build wheels
@@ -26,6 +26,12 @@ jobs: @@ -26,6 +26,12 @@ jobs:
26 steps: 26 steps:
27 - uses: actions/checkout@v4 27 - uses: actions/checkout@v4
28 28
  29 + - name: Update version
  30 + shell: bash
  31 + run: |
  32 + ./new-release.sh
  33 + git diff .
  34 +
29 # see https://cibuildwheel.readthedocs.io/en/stable/changelog/ 35 # see https://cibuildwheel.readthedocs.io/en/stable/changelog/
30 # for a list of versions 36 # for a list of versions
31 - name: Build wheels 37 - name: Build wheels
@@ -26,6 +26,12 @@ jobs: @@ -26,6 +26,12 @@ jobs:
26 steps: 26 steps:
27 - uses: actions/checkout@v4 27 - uses: actions/checkout@v4
28 28
  29 + - name: Update version
  30 + shell: bash
  31 + run: |
  32 + ./new-release.sh
  33 + git diff .
  34 +
29 - name: Setup Python ${{ matrix.python-version }} 35 - name: Setup Python ${{ matrix.python-version }}
30 uses: actions/setup-python@v5 36 uses: actions/setup-python@v5
31 with: 37 with:
@@ -26,6 +26,12 @@ jobs: @@ -26,6 +26,12 @@ jobs:
26 steps: 26 steps:
27 - uses: actions/checkout@v4 27 - uses: actions/checkout@v4
28 28
  29 + - name: Update version
  30 + shell: bash
  31 + run: |
  32 + ./new-release.sh
  33 + git diff .
  34 +
29 - name: Setup Python ${{ matrix.python-version }} 35 - name: Setup Python ${{ matrix.python-version }}
30 uses: actions/setup-python@v5 36 uses: actions/setup-python@v5
31 with: 37 with:
@@ -43,6 +43,12 @@ jobs: @@ -43,6 +43,12 @@ jobs:
43 steps: 43 steps:
44 - uses: actions/checkout@v4 44 - uses: actions/checkout@v4
45 45
  46 + - name: Update version
  47 + shell: bash
  48 + run: |
  49 + ./new-release.sh
  50 + git diff .
  51 +
46 - name: Build iOS shared 52 - name: Build iOS shared
47 if: matrix.with_tts == 'ON' 53 if: matrix.with_tts == 'ON'
48 shell: bash 54 shell: bash
@@ -44,6 +44,12 @@ jobs: @@ -44,6 +44,12 @@ jobs:
44 with: 44 with:
45 fetch-depth: 0 45 fetch-depth: 0
46 46
  47 + - name: Update version
  48 + shell: bash
  49 + run: |
  50 + ./new-release.sh
  51 + git diff .
  52 +
47 - name: ccache 53 - name: ccache
48 uses: hendrikmuhs/ccache-action@v1.2 54 uses: hendrikmuhs/ccache-action@v1.2
49 with: 55 with:
@@ -42,6 +42,12 @@ jobs: @@ -42,6 +42,12 @@ jobs:
42 with: 42 with:
43 fetch-depth: 0 43 fetch-depth: 0
44 44
  45 + - name: Update version
  46 + shell: bash
  47 + run: |
  48 + ./new-release.sh
  49 + git diff .
  50 +
45 - name: ccache 51 - name: ccache
46 uses: hendrikmuhs/ccache-action@v1.2 52 uses: hendrikmuhs/ccache-action@v1.2
47 with: 53 with:
@@ -33,6 +33,12 @@ jobs: @@ -33,6 +33,12 @@ jobs:
33 with: 33 with:
34 fetch-depth: 0 34 fetch-depth: 0
35 35
  36 + - name: Update version
  37 + shell: bash
  38 + run: |
  39 + ./new-release.sh
  40 + git diff .
  41 +
36 - name: Setup Python ${{ matrix.python-version }} 42 - name: Setup Python ${{ matrix.python-version }}
37 uses: actions/setup-python@v5 43 uses: actions/setup-python@v5
38 with: 44 with:
@@ -41,6 +41,12 @@ jobs: @@ -41,6 +41,12 @@ jobs:
41 with: 41 with:
42 fetch-depth: 0 42 fetch-depth: 0
43 43
  44 + - name: Update version
  45 + shell: bash
  46 + run: |
  47 + ./new-release.sh
  48 + git diff .
  49 +
44 - name: ccache 50 - name: ccache
45 uses: hendrikmuhs/ccache-action@v1.2 51 uses: hendrikmuhs/ccache-action@v1.2
46 with: 52 with:
@@ -25,6 +25,12 @@ jobs: @@ -25,6 +25,12 @@ jobs:
25 with: 25 with:
26 fetch-depth: 0 26 fetch-depth: 0
27 27
  28 + - name: Update version
  29 + shell: bash
  30 + run: |
  31 + ./new-release.sh
  32 + git diff .
  33 +
28 - name: Build sherpa-onnx 34 - name: Build sherpa-onnx
29 shell: bash 35 shell: bash
30 run: | 36 run: |
@@ -27,6 +27,12 @@ jobs: @@ -27,6 +27,12 @@ jobs:
27 with: 27 with:
28 fetch-depth: 0 28 fetch-depth: 0
29 29
  30 + - name: Update version
  31 + shell: bash
  32 + run: |
  33 + ./new-release.sh
  34 + git diff .
  35 +
30 - name: Display NDK HOME 36 - name: Display NDK HOME
31 shell: bash 37 shell: bash
32 run: | 38 run: |
@@ -30,10 +30,16 @@ jobs: @@ -30,10 +30,16 @@ jobs:
30 index: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19"] 30 index: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19"]
31 31
32 steps: 32 steps:
33 - - uses: actions/checkout@v3 33 + - uses: actions/checkout@v4
34 with: 34 with:
35 fetch-depth: 0 35 fetch-depth: 0
36 36
  37 + - name: Update version
  38 + shell: bash
  39 + run: |
  40 + ./new-release.sh
  41 + git diff .
  42 +
37 - name: Install deps 43 - name: Install deps
38 shell: bash 44 shell: bash
39 run: | 45 run: |
@@ -235,6 +241,12 @@ jobs: @@ -235,6 +241,12 @@ jobs:
235 with: 241 with:
236 fetch-depth: 0 242 fetch-depth: 0
237 243
  244 + - name: Update version
  245 + shell: bash
  246 + run: |
  247 + ./new-release.sh
  248 + git diff .
  249 +
238 - name: Retrieve artifact from ubuntu-latest 250 - name: Retrieve artifact from ubuntu-latest
239 uses: actions/download-artifact@v3 251 uses: actions/download-artifact@v3
240 with: 252 with:
@@ -28,6 +28,12 @@ jobs: @@ -28,6 +28,12 @@ jobs:
28 with: 28 with:
29 fetch-depth: 0 29 fetch-depth: 0
30 30
  31 + - name: Update version
  32 + shell: bash
  33 + run: |
  34 + ./new-release.sh
  35 + git diff .
  36 +
31 - name: Install Python dependencies 37 - name: Install Python dependencies
32 shell: bash 38 shell: bash
33 run: | 39 run: |
@@ -134,6 +140,12 @@ jobs: @@ -134,6 +140,12 @@ jobs:
134 with: 140 with:
135 fetch-depth: 0 141 fetch-depth: 0
136 142
  143 + - name: Update version
  144 + shell: bash
  145 + run: |
  146 + ./new-release.sh
  147 + git diff .
  148 +
137 - name: Install Python dependencies 149 - name: Install Python dependencies
138 shell: bash 150 shell: bash
139 run: | 151 run: |
@@ -27,6 +27,12 @@ jobs: @@ -27,6 +27,12 @@ jobs:
27 with: 27 with:
28 fetch-depth: 0 28 fetch-depth: 0
29 29
  30 + - name: Update version
  31 + shell: bash
  32 + run: |
  33 + ./new-release.sh
  34 + git diff .
  35 +
30 - name: Install Python dependencies 36 - name: Install Python dependencies
31 shell: bash 37 shell: bash
32 run: | 38 run: |
@@ -125,6 +131,12 @@ jobs: @@ -125,6 +131,12 @@ jobs:
125 with: 131 with:
126 fetch-depth: 0 132 fetch-depth: 0
127 133
  134 + - name: Update version
  135 + shell: bash
  136 + run: |
  137 + ./new-release.sh
  138 + git diff .
  139 +
128 - name: Install Python dependencies 140 - name: Install Python dependencies
129 shell: bash 141 shell: bash
130 run: | 142 run: |
@@ -32,6 +32,12 @@ jobs: @@ -32,6 +32,12 @@ jobs:
32 with: 32 with:
33 fetch-depth: 0 33 fetch-depth: 0
34 34
  35 + - name: Update version
  36 + shell: bash
  37 + run: |
  38 + ./new-release.sh
  39 + git diff .
  40 +
35 # https://github.com/actions/setup-java 41 # https://github.com/actions/setup-java
36 - uses: actions/setup-java@v4 42 - uses: actions/setup-java@v4
37 with: 43 with:
@@ -28,6 +28,12 @@ jobs: @@ -28,6 +28,12 @@ jobs:
28 with: 28 with:
29 fetch-depth: 0 29 fetch-depth: 0
30 30
  31 + - name: Update version
  32 + shell: bash
  33 + run: |
  34 + ./new-release.sh
  35 + git diff .
  36 +
31 - name: ccache 37 - name: ccache
32 uses: hendrikmuhs/ccache-action@v1.2 38 uses: hendrikmuhs/ccache-action@v1.2
33 with: 39 with:
@@ -29,6 +29,12 @@ jobs: @@ -29,6 +29,12 @@ jobs:
29 with: 29 with:
30 fetch-depth: 0 30 fetch-depth: 0
31 31
  32 + - name: Update version
  33 + shell: bash
  34 + run: |
  35 + ./new-release.sh
  36 + git diff .
  37 +
32 - name: ccache 38 - name: ccache
33 uses: hendrikmuhs/ccache-action@v1.2 39 uses: hendrikmuhs/ccache-action@v1.2
34 with: 40 with:
@@ -42,6 +42,12 @@ jobs: @@ -42,6 +42,12 @@ jobs:
42 with: 42 with:
43 fetch-depth: 0 43 fetch-depth: 0
44 44
  45 + - name: Update version
  46 + shell: bash
  47 + run: |
  48 + ./new-release.sh
  49 + git diff .
  50 +
45 - name: ccache 51 - name: ccache
46 uses: hendrikmuhs/ccache-action@v1.2 52 uses: hendrikmuhs/ccache-action@v1.2
47 with: 53 with:
@@ -48,6 +48,12 @@ jobs: @@ -48,6 +48,12 @@ jobs:
48 with: 48 with:
49 fetch-depth: 0 49 fetch-depth: 0
50 50
  51 + - name: Update version
  52 + shell: bash
  53 + run: |
  54 + ./new-release.sh
  55 + git diff .
  56 +
51 - name: ccache 57 - name: ccache
52 uses: hendrikmuhs/ccache-action@v1.2 58 uses: hendrikmuhs/ccache-action@v1.2
53 with: 59 with:
@@ -259,6 +265,12 @@ jobs: @@ -259,6 +265,12 @@ jobs:
259 with: 265 with:
260 fetch-depth: 0 266 fetch-depth: 0
261 267
  268 + - name: Update version
  269 + shell: bash
  270 + run: |
  271 + ./new-release.sh
  272 + git diff .
  273 +
262 - name: Retrieve artifact from windows x64 274 - name: Retrieve artifact from windows x64
263 uses: actions/download-artifact@v4 275 uses: actions/download-artifact@v4
264 with: 276 with:
@@ -56,6 +56,12 @@ jobs: @@ -56,6 +56,12 @@ jobs:
56 with: 56 with:
57 fetch-depth: 0 57 fetch-depth: 0
58 58
  59 + - name: Update version
  60 + shell: bash
  61 + run: |
  62 + ./new-release.sh
  63 + git diff .
  64 +
59 - name: Build sherpa-onnx 65 - name: Build sherpa-onnx
60 uses: addnab/docker-run-action@v3 66 uses: addnab/docker-run-action@v3
61 with: 67 with:
@@ -28,6 +28,12 @@ jobs: @@ -28,6 +28,12 @@ jobs:
28 with: 28 with:
29 fetch-depth: 0 29 fetch-depth: 0
30 30
  31 + - name: Update version
  32 + shell: bash
  33 + run: |
  34 + ./new-release.sh
  35 + git diff .
  36 +
31 - uses: actions/setup-java@v4 37 - uses: actions/setup-java@v4
32 with: 38 with:
33 distribution: 'temurin' # See 'Supported distributions' for available options 39 distribution: 'temurin' # See 'Supported distributions' for available options
@@ -27,6 +27,12 @@ jobs: @@ -27,6 +27,12 @@ jobs:
27 with: 27 with:
28 fetch-depth: 0 28 fetch-depth: 0
29 29
  30 + - name: Update version
  31 + shell: bash
  32 + run: |
  33 + ./new-release.sh
  34 + git diff .
  35 +
30 - uses: actions/setup-java@v4 36 - uses: actions/setup-java@v4
31 with: 37 with:
32 distribution: 'temurin' # See 'Supported distributions' for available options 38 distribution: 'temurin' # See 'Supported distributions' for available options
@@ -74,6 +74,12 @@ jobs: @@ -74,6 +74,12 @@ jobs:
74 with: 74 with:
75 fetch-depth: 0 75 fetch-depth: 0
76 76
  77 + - name: Update version
  78 + shell: bash
  79 + run: |
  80 + ./new-release.sh
  81 + git diff .
  82 +
77 - name: Display PWD 83 - name: Display PWD
78 shell: bash 84 shell: bash
79 run: | 85 run: |
@@ -28,6 +28,12 @@ jobs: @@ -28,6 +28,12 @@ jobs:
28 with: 28 with:
29 fetch-depth: 0 29 fetch-depth: 0
30 30
  31 + - name: Update version
  32 + shell: bash
  33 + run: |
  34 + ./new-release.sh
  35 + git diff .
  36 +
31 - uses: actions/setup-java@v4 37 - uses: actions/setup-java@v4
32 with: 38 with:
33 distribution: 'temurin' # See 'Supported distributions' for available options 39 distribution: 'temurin' # See 'Supported distributions' for available options
@@ -71,6 +71,12 @@ jobs: @@ -71,6 +71,12 @@ jobs:
71 with: 71 with:
72 fetch-depth: 0 72 fetch-depth: 0
73 73
  74 + - name: Update version
  75 + shell: bash
  76 + run: |
  77 + ./new-release.sh
  78 + git diff .
  79 +
74 - name: ccache 80 - name: ccache
75 uses: hendrikmuhs/ccache-action@v1.2 81 uses: hendrikmuhs/ccache-action@v1.2
76 with: 82 with:
@@ -43,6 +43,12 @@ jobs: @@ -43,6 +43,12 @@ jobs:
43 with: 43 with:
44 fetch-depth: 0 44 fetch-depth: 0
45 45
  46 + - name: Update version
  47 + shell: bash
  48 + run: |
  49 + ./new-release.sh
  50 + git diff .
  51 +
46 - name: Display MSBuild info 52 - name: Display MSBuild info
47 shell: cmd 53 shell: cmd
48 run: | 54 run: |
@@ -27,6 +27,12 @@ jobs: @@ -27,6 +27,12 @@ jobs:
27 steps: 27 steps:
28 - uses: actions/checkout@v4 28 - uses: actions/checkout@v4
29 29
  30 + - name: Update version
  31 + shell: bash
  32 + run: |
  33 + ./new-release.sh
  34 + git diff .
  35 +
30 - name: Setup Python ${{ matrix.python-version }} 36 - name: Setup Python ${{ matrix.python-version }}
31 uses: actions/setup-python@v5 37 uses: actions/setup-python@v5
32 with: 38 with:
@@ -27,6 +27,12 @@ jobs: @@ -27,6 +27,12 @@ jobs:
27 steps: 27 steps:
28 - uses: actions/checkout@v4 28 - uses: actions/checkout@v4
29 29
  30 + - name: Update version
  31 + shell: bash
  32 + run: |
  33 + ./new-release.sh
  34 + git diff .
  35 +
30 - name: Setup Python ${{ matrix.python-version }} 36 - name: Setup Python ${{ matrix.python-version }}
31 uses: actions/setup-python@v5 37 uses: actions/setup-python@v5
32 with: 38 with:
@@ -32,6 +32,12 @@ jobs: @@ -32,6 +32,12 @@ jobs:
32 with: 32 with:
33 fetch-depth: 0 33 fetch-depth: 0
34 34
  35 + - name: Update version
  36 + shell: bash
  37 + run: |
  38 + ./new-release.sh
  39 + git diff .
  40 +
35 - name: Set up QEMU 41 - name: Set up QEMU
36 uses: docker/setup-qemu-action@v2 42 uses: docker/setup-qemu-action@v2
37 with: 43 with:
@@ -28,6 +28,12 @@ jobs: @@ -28,6 +28,12 @@ jobs:
28 with: 28 with:
29 fetch-depth: 0 29 fetch-depth: 0
30 30
  31 + - name: Update version
  32 + shell: bash
  33 + run: |
  34 + ./new-release.sh
  35 + git diff .
  36 +
31 - name: Set up QEMU 37 - name: Set up QEMU
32 uses: docker/setup-qemu-action@v2 38 uses: docker/setup-qemu-action@v2
33 with: 39 with:
@@ -28,6 +28,12 @@ jobs: @@ -28,6 +28,12 @@ jobs:
28 with: 28 with:
29 fetch-depth: 0 29 fetch-depth: 0
30 30
  31 + - name: Update version
  32 + shell: bash
  33 + run: |
  34 + ./new-release.sh
  35 + git diff .
  36 +
31 - name: Setup Python ${{ matrix.python-version }} 37 - name: Setup Python ${{ matrix.python-version }}
32 uses: actions/setup-python@v5 38 uses: actions/setup-python@v5
33 with: 39 with:
@@ -28,6 +28,12 @@ jobs: @@ -28,6 +28,12 @@ jobs:
28 with: 28 with:
29 fetch-depth: 0 29 fetch-depth: 0
30 30
  31 + - name: Update version
  32 + shell: bash
  33 + run: |
  34 + ./new-release.sh
  35 + git diff .
  36 +
31 - name: Setup Python ${{ matrix.python-version }} 37 - name: Setup Python ${{ matrix.python-version }}
32 uses: actions/setup-python@v5 38 uses: actions/setup-python@v5
33 with: 39 with:
@@ -28,6 +28,12 @@ jobs: @@ -28,6 +28,12 @@ jobs:
28 with: 28 with:
29 fetch-depth: 0 29 fetch-depth: 0
30 30
  31 + - name: Update version
  32 + shell: bash
  33 + run: |
  34 + ./new-release.sh
  35 + git diff .
  36 +
31 - name: Setup Python ${{ matrix.python-version }} 37 - name: Setup Python ${{ matrix.python-version }}
32 uses: actions/setup-python@v5 38 uses: actions/setup-python@v5
33 with: 39 with:
@@ -28,6 +28,12 @@ jobs: @@ -28,6 +28,12 @@ jobs:
28 with: 28 with:
29 fetch-depth: 0 29 fetch-depth: 0
30 30
  31 + - name: Update version
  32 + shell: bash
  33 + run: |
  34 + ./new-release.sh
  35 + git diff .
  36 +
31 - name: Setup Python ${{ matrix.python-version }} 37 - name: Setup Python ${{ matrix.python-version }}
32 uses: actions/setup-python@v5 38 uses: actions/setup-python@v5
33 with: 39 with:
@@ -144,6 +150,12 @@ jobs: @@ -144,6 +150,12 @@ jobs:
144 with: 150 with:
145 fetch-depth: 0 151 fetch-depth: 0
146 152
  153 + - name: Update version
  154 + shell: bash
  155 + run: |
  156 + ./new-release.sh
  157 + git diff .
  158 +
147 - uses: actions/setup-node@v4 159 - uses: actions/setup-node@v4
148 with: 160 with:
149 registry-url: 'https://registry.npmjs.org' 161 registry-url: 'https://registry.npmjs.org'
@@ -28,6 +28,12 @@ jobs: @@ -28,6 +28,12 @@ jobs:
28 with: 28 with:
29 fetch-depth: 0 29 fetch-depth: 0
30 30
  31 + - name: Update version
  32 + shell: bash
  33 + run: |
  34 + ./new-release.sh
  35 + git diff .
  36 +
31 - name: Setup Python ${{ matrix.python-version }} 37 - name: Setup Python ${{ matrix.python-version }}
32 uses: actions/setup-python@v5 38 uses: actions/setup-python@v5
33 with: 39 with:
@@ -28,6 +28,12 @@ jobs: @@ -28,6 +28,12 @@ jobs:
28 with: 28 with:
29 fetch-depth: 0 29 fetch-depth: 0
30 30
  31 + - name: Update version
  32 + shell: bash
  33 + run: |
  34 + ./new-release.sh
  35 + git diff .
  36 +
31 - name: Install emsdk 37 - name: Install emsdk
32 uses: mymindstorm/setup-emsdk@v14 38 uses: mymindstorm/setup-emsdk@v14
33 with: 39 with:
@@ -44,6 +44,12 @@ jobs: @@ -44,6 +44,12 @@ jobs:
44 with: 44 with:
45 fetch-depth: 0 45 fetch-depth: 0
46 46
  47 + - name: Update version
  48 + shell: bash
  49 + run: |
  50 + ./new-release.sh
  51 + git diff .
  52 +
47 - name: ccache 53 - name: ccache
48 uses: hendrikmuhs/ccache-action@v1.2 54 uses: hendrikmuhs/ccache-action@v1.2
49 with: 55 with:
@@ -46,6 +46,12 @@ jobs: @@ -46,6 +46,12 @@ jobs:
46 with: 46 with:
47 fetch-depth: 0 47 fetch-depth: 0
48 48
  49 + - name: Update version
  50 + shell: bash
  51 + run: |
  52 + ./new-release.sh
  53 + git diff .
  54 +
49 - name: ccache 55 - name: ccache
50 uses: hendrikmuhs/ccache-action@v1.2 56 uses: hendrikmuhs/ccache-action@v1.2
51 with: 57 with:
@@ -24,6 +24,12 @@ jobs: @@ -24,6 +24,12 @@ jobs:
24 steps: 24 steps:
25 - uses: actions/checkout@v4 25 - uses: actions/checkout@v4
26 26
  27 + - name: Update version
  28 + shell: bash
  29 + run: |
  30 + ./new-release.sh
  31 + git diff .
  32 +
27 - name: Fix version 33 - name: Fix version
28 shell: bash 34 shell: bash
29 run: | 35 run: |
@@ -121,6 +127,12 @@ jobs: @@ -121,6 +127,12 @@ jobs:
121 steps: 127 steps:
122 - uses: actions/checkout@v4 128 - uses: actions/checkout@v4
123 129
  130 + - name: Update version
  131 + shell: bash
  132 + run: |
  133 + ./new-release.sh
  134 + git diff .
  135 +
124 - name: ccache 136 - name: ccache
125 uses: hendrikmuhs/ccache-action@v1.2 137 uses: hendrikmuhs/ccache-action@v1.2
126 with: 138 with:
@@ -223,6 +235,12 @@ jobs: @@ -223,6 +235,12 @@ jobs:
223 steps: 235 steps:
224 - uses: actions/checkout@v4 236 - uses: actions/checkout@v4
225 237
  238 + - name: Update version
  239 + shell: bash
  240 + run: |
  241 + ./new-release.sh
  242 + git diff .
  243 +
226 - name: Fix version 244 - name: Fix version
227 shell: bash 245 shell: bash
228 run: | 246 run: |
@@ -307,6 +325,12 @@ jobs: @@ -307,6 +325,12 @@ jobs:
307 steps: 325 steps:
308 - uses: actions/checkout@v4 326 - uses: actions/checkout@v4
309 327
  328 + - name: Update version
  329 + shell: bash
  330 + run: |
  331 + ./new-release.sh
  332 + git diff .
  333 +
310 - name: ccache 334 - name: ccache
311 uses: hendrikmuhs/ccache-action@v1.2 335 uses: hendrikmuhs/ccache-action@v1.2
312 with: 336 with:
@@ -438,6 +462,12 @@ jobs: @@ -438,6 +462,12 @@ jobs:
438 steps: 462 steps:
439 - uses: actions/checkout@v4 463 - uses: actions/checkout@v4
440 464
  465 + - name: Update version
  466 + shell: bash
  467 + run: |
  468 + ./new-release.sh
  469 + git diff .
  470 +
441 - name: ccache 471 - name: ccache
442 uses: hendrikmuhs/ccache-action@v1.2 472 uses: hendrikmuhs/ccache-action@v1.2
443 with: 473 with:
@@ -517,6 +547,12 @@ jobs: @@ -517,6 +547,12 @@ jobs:
517 steps: 547 steps:
518 - uses: actions/checkout@v4 548 - uses: actions/checkout@v4
519 549
  550 + - name: Update version
  551 + shell: bash
  552 + run: |
  553 + ./new-release.sh
  554 + git diff .
  555 +
520 - name: Setup Flutter SDK 556 - name: Setup Flutter SDK
521 uses: flutter-actions/setup-flutter@v3 557 uses: flutter-actions/setup-flutter@v3
522 with: 558 with:
@@ -15,6 +15,12 @@ jobs: @@ -15,6 +15,12 @@ jobs:
15 steps: 15 steps:
16 - uses: actions/checkout@v4 16 - uses: actions/checkout@v4
17 17
  18 + - name: Update version
  19 + shell: bash
  20 + run: |
  21 + ./new-release.sh
  22 + git diff .
  23 +
18 - name: Add SSH key 24 - name: Add SSH key
19 run: | 25 run: |
20 mkdir -p ~/.ssh/ 26 mkdir -p ~/.ssh/
@@ -45,6 +45,12 @@ jobs: @@ -45,6 +45,12 @@ jobs:
45 with: 45 with:
46 fetch-depth: 0 46 fetch-depth: 0
47 47
  48 + - name: Update version
  49 + shell: bash
  50 + run: |
  51 + ./new-release.sh
  52 + git diff .
  53 +
48 - name: ccache 54 - name: ccache
49 uses: hendrikmuhs/ccache-action@v1.2 55 uses: hendrikmuhs/ccache-action@v1.2
50 with: 56 with:
@@ -49,6 +49,12 @@ jobs: @@ -49,6 +49,12 @@ jobs:
49 with: 49 with:
50 fetch-depth: 0 50 fetch-depth: 0
51 51
  52 + - name: Update version
  53 + shell: bash
  54 + run: |
  55 + ./new-release.sh
  56 + git diff .
  57 +
52 - name: ccache 58 - name: ccache
53 uses: hendrikmuhs/ccache-action@v1.2 59 uses: hendrikmuhs/ccache-action@v1.2
54 with: 60 with:
@@ -43,6 +43,12 @@ jobs: @@ -43,6 +43,12 @@ jobs:
43 with: 43 with:
44 fetch-depth: 0 44 fetch-depth: 0
45 45
  46 + - name: Update version
  47 + shell: bash
  48 + run: |
  49 + ./new-release.sh
  50 + git diff .
  51 +
46 - name: ccache 52 - name: ccache
47 uses: hendrikmuhs/ccache-action@v1.2 53 uses: hendrikmuhs/ccache-action@v1.2
48 with: 54 with:
@@ -105,6 +111,12 @@ jobs: @@ -105,6 +111,12 @@ jobs:
105 make -j4 111 make -j4
106 ls -lh lib 112 ls -lh lib
107 113
  114 + - name: Run java version test
  115 + shell: bash
  116 + run: |
  117 + cd ./java-api-examples
  118 + ./run-version-test.sh
  119 +
108 - name: Run java test (Non-streaming SenseVoice with homophone replacer) 120 - name: Run java test (Non-streaming SenseVoice with homophone replacer)
109 shell: bash 121 shell: bash
110 run: | 122 run: |
@@ -60,6 +60,12 @@ jobs: @@ -60,6 +60,12 @@ jobs:
60 with: 60 with:
61 fetch-depth: 0 61 fetch-depth: 0
62 62
  63 + - name: Update version
  64 + shell: bash
  65 + run: |
  66 + ./new-release.sh
  67 + git diff .
  68 +
63 - name: Display OS version 69 - name: Display OS version
64 shell: bash 70 shell: bash
65 run: | 71 run: |
@@ -55,6 +55,12 @@ jobs: @@ -55,6 +55,12 @@ jobs:
55 with: 55 with:
56 fetch-depth: 0 56 fetch-depth: 0
57 57
  58 + - name: Update version
  59 + shell: bash
  60 + run: |
  61 + ./new-release.sh
  62 + git diff .
  63 +
58 - name: Display OS version 64 - name: Display OS version
59 shell: bash 65 shell: bash
60 run: | 66 run: |
@@ -30,6 +30,12 @@ jobs: @@ -30,6 +30,12 @@ jobs:
30 with: 30 with:
31 fetch-depth: 0 31 fetch-depth: 0
32 32
  33 + - name: Update version
  34 + shell: bash
  35 + run: |
  36 + ./new-release.sh
  37 + git diff .
  38 +
33 - name: ccache 39 - name: ccache
34 uses: hendrikmuhs/ccache-action@v1.2 40 uses: hendrikmuhs/ccache-action@v1.2
35 with: 41 with:
@@ -25,6 +25,12 @@ jobs: @@ -25,6 +25,12 @@ jobs:
25 with: 25 with:
26 fetch-depth: 0 26 fetch-depth: 0
27 27
  28 + - name: Update version
  29 + shell: bash
  30 + run: |
  31 + ./new-release.sh
  32 + git diff .
  33 +
28 - name: ccache 34 - name: ccache
29 uses: hendrikmuhs/ccache-action@v1.2 35 uses: hendrikmuhs/ccache-action@v1.2
30 with: 36 with:
@@ -46,6 +46,12 @@ jobs: @@ -46,6 +46,12 @@ jobs:
46 with: 46 with:
47 fetch-depth: 0 47 fetch-depth: 0
48 48
  49 + - name: Update version
  50 + shell: bash
  51 + run: |
  52 + ./new-release.sh
  53 + git diff .
  54 +
49 - name: ccache 55 - name: ccache
50 uses: hendrikmuhs/ccache-action@v1.2 56 uses: hendrikmuhs/ccache-action@v1.2
51 with: 57 with:
@@ -80,6 +80,12 @@ jobs: @@ -80,6 +80,12 @@ jobs:
80 with: 80 with:
81 fetch-depth: 0 81 fetch-depth: 0
82 82
  83 + - name: Update version
  84 + shell: bash
  85 + run: |
  86 + ./new-release.sh
  87 + git diff .
  88 +
83 - name: Setup Python ${{ matrix.python-version }} 89 - name: Setup Python ${{ matrix.python-version }}
84 uses: actions/setup-python@v5 90 uses: actions/setup-python@v5
85 with: 91 with:
@@ -30,6 +30,12 @@ jobs: @@ -30,6 +30,12 @@ jobs:
30 with: 30 with:
31 fetch-depth: 0 31 fetch-depth: 0
32 32
  33 + - name: Update version
  34 + shell: bash
  35 + run: |
  36 + ./new-release.sh
  37 + git diff .
  38 +
33 - name: Setup Flutter SDK 39 - name: Setup Flutter SDK
34 uses: flutter-actions/setup-flutter@v3 40 uses: flutter-actions/setup-flutter@v3
35 with: 41 with:
@@ -39,6 +39,12 @@ jobs: @@ -39,6 +39,12 @@ jobs:
39 with: 39 with:
40 fetch-depth: 0 40 fetch-depth: 0
41 41
  42 + - name: Update version
  43 + shell: bash
  44 + run: |
  45 + ./new-release.sh
  46 + git diff .
  47 +
42 - name: ccache 48 - name: ccache
43 uses: hendrikmuhs/ccache-action@v1.2 49 uses: hendrikmuhs/ccache-action@v1.2
44 with: 50 with:
@@ -32,6 +32,12 @@ jobs: @@ -32,6 +32,12 @@ jobs:
32 with: 32 with:
33 fetch-depth: 0 33 fetch-depth: 0
34 34
  35 + - name: Update version
  36 + shell: bash
  37 + run: |
  38 + ./new-release.sh
  39 + git diff .
  40 +
35 - name: Free space 41 - name: Free space
36 if: matrix.os == 'ubuntu-latest' 42 if: matrix.os == 'ubuntu-latest'
37 shell: bash 43 shell: bash
@@ -45,6 +45,12 @@ jobs: @@ -45,6 +45,12 @@ jobs:
45 with: 45 with:
46 fetch-depth: 0 46 fetch-depth: 0
47 47
  48 + - name: Update version
  49 + shell: bash
  50 + run: |
  51 + ./new-release.sh
  52 + git diff .
  53 +
48 - name: ccache 54 - name: ccache
49 uses: hendrikmuhs/ccache-action@v1.2 55 uses: hendrikmuhs/ccache-action@v1.2
50 with: 56 with:
@@ -138,6 +144,12 @@ jobs: @@ -138,6 +144,12 @@ jobs:
138 with: 144 with:
139 fetch-depth: 0 145 fetch-depth: 0
140 146
  147 + - name: Update version
  148 + shell: bash
  149 + run: |
  150 + ./new-release.sh
  151 + git diff .
  152 +
141 - name: Setup Python ${{ matrix.python-version }} 153 - name: Setup Python ${{ matrix.python-version }}
142 uses: actions/setup-python@v5 154 uses: actions/setup-python@v5
143 with: 155 with:
@@ -45,6 +45,12 @@ jobs: @@ -45,6 +45,12 @@ jobs:
45 with: 45 with:
46 go-version: '>=1.17' 46 go-version: '>=1.17'
47 47
  48 + - name: Update version
  49 + shell: bash
  50 + run: |
  51 + ./new-release.sh
  52 + git diff .
  53 +
48 - name: Display go version 54 - name: Display go version
49 shell: bash 55 shell: bash
50 run: | 56 run: |
@@ -40,6 +40,12 @@ jobs: @@ -40,6 +40,12 @@ jobs:
40 with: 40 with:
41 fetch-depth: 0 41 fetch-depth: 0
42 42
  43 + - name: Update version
  44 + shell: bash
  45 + run: |
  46 + ./new-release.sh
  47 + git diff .
  48 +
43 - name: ccache 49 - name: ccache
44 uses: hendrikmuhs/ccache-action@v1.2 50 uses: hendrikmuhs/ccache-action@v1.2
45 with: 51 with:
@@ -46,6 +46,12 @@ jobs: @@ -46,6 +46,12 @@ jobs:
46 with: 46 with:
47 fetch-depth: 0 47 fetch-depth: 0
48 48
  49 + - name: Update version
  50 + shell: bash
  51 + run: |
  52 + ./new-release.sh
  53 + git diff .
  54 +
49 - name: Setup Python ${{ matrix.python-version }} 55 - name: Setup Python ${{ matrix.python-version }}
50 uses: actions/setup-python@v5 56 uses: actions/setup-python@v5
51 with: 57 with:
@@ -47,6 +47,12 @@ jobs: @@ -47,6 +47,12 @@ jobs:
47 with: 47 with:
48 fetch-depth: 0 48 fetch-depth: 0
49 49
  50 + - name: Update version
  51 + shell: bash
  52 + run: |
  53 + ./new-release.sh
  54 + git diff .
  55 +
50 - name: Set up QEMU 56 - name: Set up QEMU
51 uses: docker/setup-qemu-action@v2 57 uses: docker/setup-qemu-action@v2
52 with: 58 with:
@@ -50,6 +50,12 @@ jobs: @@ -50,6 +50,12 @@ jobs:
50 with: 50 with:
51 fetch-depth: 0 51 fetch-depth: 0
52 52
  53 + - name: Update version
  54 + shell: bash
  55 + run: |
  56 + ./new-release.sh
  57 + git diff .
  58 +
53 - uses: actions/setup-node@v4 59 - uses: actions/setup-node@v4
54 with: 60 with:
55 registry-url: 'https://registry.npmjs.org' 61 registry-url: 'https://registry.npmjs.org'
@@ -48,6 +48,12 @@ jobs: @@ -48,6 +48,12 @@ jobs:
48 with: 48 with:
49 fetch-depth: 0 49 fetch-depth: 0
50 50
  51 + - name: Update version
  52 + shell: bash
  53 + run: |
  54 + ./new-release.sh
  55 + git diff .
  56 +
51 - uses: actions/setup-node@v4 57 - uses: actions/setup-node@v4
52 with: 58 with:
53 registry-url: 'https://registry.npmjs.org' 59 registry-url: 'https://registry.npmjs.org'
@@ -33,6 +33,12 @@ jobs: @@ -33,6 +33,12 @@ jobs:
33 with: 33 with:
34 fetch-depth: 0 34 fetch-depth: 0
35 35
  36 + - name: Update version
  37 + shell: bash
  38 + run: |
  39 + ./new-release.sh
  40 + git diff .
  41 +
36 - name: Setup Python ${{ matrix.python-version }} 42 - name: Setup Python ${{ matrix.python-version }}
37 uses: actions/setup-python@v5 43 uses: actions/setup-python@v5
38 with: 44 with:
@@ -46,6 +46,12 @@ jobs: @@ -46,6 +46,12 @@ jobs:
46 with: 46 with:
47 fetch-depth: 0 47 fetch-depth: 0
48 48
  49 + - name: Update version
  50 + shell: bash
  51 + run: |
  52 + ./new-release.sh
  53 + git diff .
  54 +
49 - name: ccache 55 - name: ccache
50 uses: hendrikmuhs/ccache-action@v1.2 56 uses: hendrikmuhs/ccache-action@v1.2
51 with: 57 with:
@@ -81,6 +81,12 @@ jobs: @@ -81,6 +81,12 @@ jobs:
81 with: 81 with:
82 fetch-depth: 0 82 fetch-depth: 0
83 83
  84 + - name: Update version
  85 + shell: bash
  86 + run: |
  87 + ./new-release.sh
  88 + git diff .
  89 +
84 - name: Setup Python ${{ matrix.python-version }} 90 - name: Setup Python ${{ matrix.python-version }}
85 uses: actions/setup-python@v5 91 uses: actions/setup-python@v5
86 with: 92 with:
@@ -41,6 +41,12 @@ jobs: @@ -41,6 +41,12 @@ jobs:
41 with: 41 with:
42 fetch-depth: 0 42 fetch-depth: 0
43 43
  44 + - name: Update version
  45 + shell: bash
  46 + run: |
  47 + ./new-release.sh
  48 + git diff .
  49 +
44 - name: ccache 50 - name: ccache
45 uses: hendrikmuhs/ccache-action@v1.2 51 uses: hendrikmuhs/ccache-action@v1.2
46 with: 52 with:
@@ -42,6 +42,12 @@ jobs: @@ -42,6 +42,12 @@ jobs:
42 with: 42 with:
43 fetch-depth: 0 43 fetch-depth: 0
44 44
  45 + - name: Update version
  46 + shell: bash
  47 + run: |
  48 + ./new-release.sh
  49 + git diff .
  50 +
45 - name: ccache 51 - name: ccache
46 uses: hendrikmuhs/ccache-action@v1.2 52 uses: hendrikmuhs/ccache-action@v1.2
47 with: 53 with:
@@ -42,6 +42,12 @@ jobs: @@ -42,6 +42,12 @@ jobs:
42 with: 42 with:
43 fetch-depth: 0 43 fetch-depth: 0
44 44
  45 + - name: Update version
  46 + shell: bash
  47 + run: |
  48 + ./new-release.sh
  49 + git diff .
  50 +
45 - name: ccache 51 - name: ccache
46 uses: hendrikmuhs/ccache-action@v1.2 52 uses: hendrikmuhs/ccache-action@v1.2
47 with: 53 with:
@@ -26,6 +26,12 @@ jobs: @@ -26,6 +26,12 @@ jobs:
26 with: 26 with:
27 fetch-depth: 0 27 fetch-depth: 0
28 28
  29 + - name: Update version
  30 + shell: bash
  31 + run: |
  32 + ./new-release.sh
  33 + git diff .
  34 +
29 - name: Install emsdk 35 - name: Install emsdk
30 uses: mymindstorm/setup-emsdk@v14 36 uses: mymindstorm/setup-emsdk@v14
31 with: 37 with:
@@ -25,6 +25,13 @@ jobs: @@ -25,6 +25,13 @@ jobs:
25 - uses: actions/checkout@v4 25 - uses: actions/checkout@v4
26 with: 26 with:
27 fetch-depth: 0 27 fetch-depth: 0
  28 +
  29 + - name: Update version
  30 + shell: bash
  31 + run: |
  32 + ./new-release.sh
  33 + git diff .
  34 +
28 - name: Install emsdk 35 - name: Install emsdk
29 uses: mymindstorm/setup-emsdk@v14 36 uses: mymindstorm/setup-emsdk@v14
30 with: 37 with:
@@ -26,6 +26,12 @@ jobs: @@ -26,6 +26,12 @@ jobs:
26 with: 26 with:
27 fetch-depth: 0 27 fetch-depth: 0
28 28
  29 + - name: Update version
  30 + shell: bash
  31 + run: |
  32 + ./new-release.sh
  33 + git diff .
  34 +
29 - name: Install emsdk 35 - name: Install emsdk
30 uses: mymindstorm/setup-emsdk@v14 36 uses: mymindstorm/setup-emsdk@v14
31 with: 37 with:
@@ -26,6 +26,12 @@ jobs: @@ -26,6 +26,12 @@ jobs:
26 with: 26 with:
27 fetch-depth: 0 27 fetch-depth: 0
28 28
  29 + - name: Update version
  30 + shell: bash
  31 + run: |
  32 + ./new-release.sh
  33 + git diff .
  34 +
29 - name: Install emsdk 35 - name: Install emsdk
30 uses: mymindstorm/setup-emsdk@v14 36 uses: mymindstorm/setup-emsdk@v14
31 with: 37 with:
@@ -27,6 +27,12 @@ jobs: @@ -27,6 +27,12 @@ jobs:
27 with: 27 with:
28 fetch-depth: 0 28 fetch-depth: 0
29 29
  30 + - name: Update version
  31 + shell: bash
  32 + run: |
  33 + ./new-release.sh
  34 + git diff .
  35 +
30 - name: Install emsdk 36 - name: Install emsdk
31 uses: mymindstorm/setup-emsdk@v14 37 uses: mymindstorm/setup-emsdk@v14
32 with: 38 with:
@@ -27,6 +27,12 @@ jobs: @@ -27,6 +27,12 @@ jobs:
27 with: 27 with:
28 fetch-depth: 0 28 fetch-depth: 0
29 29
  30 + - name: Update version
  31 + shell: bash
  32 + run: |
  33 + ./new-release.sh
  34 + git diff .
  35 +
30 - name: Install emsdk 36 - name: Install emsdk
31 uses: mymindstorm/setup-emsdk@v14 37 uses: mymindstorm/setup-emsdk@v14
32 with: 38 with:
@@ -29,6 +29,12 @@ jobs: @@ -29,6 +29,12 @@ jobs:
29 with: 29 with:
30 fetch-depth: 0 30 fetch-depth: 0
31 31
  32 + - name: Update version
  33 + shell: bash
  34 + run: |
  35 + ./new-release.sh
  36 + git diff .
  37 +
32 - name: Install Python dependencies 38 - name: Install Python dependencies
33 shell: bash 39 shell: bash
34 run: | 40 run: |
@@ -26,6 +26,12 @@ jobs: @@ -26,6 +26,12 @@ jobs:
26 with: 26 with:
27 fetch-depth: 0 27 fetch-depth: 0
28 28
  29 + - name: Update version
  30 + shell: bash
  31 + run: |
  32 + ./new-release.sh
  33 + git diff .
  34 +
29 - name: Install emsdk 35 - name: Install emsdk
30 uses: mymindstorm/setup-emsdk@v14 36 uses: mymindstorm/setup-emsdk@v14
31 with: 37 with:
@@ -26,6 +26,12 @@ jobs: @@ -26,6 +26,12 @@ jobs:
26 with: 26 with:
27 fetch-depth: 0 27 fetch-depth: 0
28 28
  29 + - name: Update version
  30 + shell: bash
  31 + run: |
  32 + ./new-release.sh
  33 + git diff .
  34 +
29 - name: Install emsdk 35 - name: Install emsdk
30 uses: mymindstorm/setup-emsdk@v14 36 uses: mymindstorm/setup-emsdk@v14
31 with: 37 with:
@@ -26,6 +26,12 @@ jobs: @@ -26,6 +26,12 @@ jobs:
26 with: 26 with:
27 fetch-depth: 0 27 fetch-depth: 0
28 28
  29 + - name: Update version
  30 + shell: bash
  31 + run: |
  32 + ./new-release.sh
  33 + git diff .
  34 +
29 - name: Install emsdk 35 - name: Install emsdk
30 uses: mymindstorm/setup-emsdk@v14 36 uses: mymindstorm/setup-emsdk@v14
31 with: 37 with:
@@ -40,6 +40,12 @@ jobs: @@ -40,6 +40,12 @@ jobs:
40 with: 40 with:
41 fetch-depth: 0 41 fetch-depth: 0
42 42
  43 + - name: Update version
  44 + shell: bash
  45 + run: |
  46 + ./new-release.sh
  47 + git diff .
  48 +
43 - name: Configure CMake 49 - name: Configure CMake
44 shell: bash 50 shell: bash
45 run: | 51 run: |
@@ -50,6 +50,12 @@ jobs: @@ -50,6 +50,12 @@ jobs:
50 with: 50 with:
51 fetch-depth: 0 51 fetch-depth: 0
52 52
  53 + - name: Update version
  54 + shell: bash
  55 + run: |
  56 + ./new-release.sh
  57 + git diff .
  58 +
53 - name: Configure CMake 59 - name: Configure CMake
54 shell: bash 60 shell: bash
55 run: | 61 run: |
@@ -52,6 +52,12 @@ jobs: @@ -52,6 +52,12 @@ jobs:
52 with: 52 with:
53 fetch-depth: 0 53 fetch-depth: 0
54 54
  55 + - name: Update version
  56 + shell: bash
  57 + run: |
  58 + ./new-release.sh
  59 + git diff .
  60 +
55 - name: Configure CMake 61 - name: Configure CMake
56 shell: bash 62 shell: bash
57 run: | 63 run: |
@@ -27,6 +27,12 @@ jobs: @@ -27,6 +27,12 @@ jobs:
27 with: 27 with:
28 fetch-depth: 0 28 fetch-depth: 0
29 29
  30 + - name: Update version
  31 + shell: bash
  32 + run: |
  33 + ./new-release.sh
  34 + git diff .
  35 +
30 - uses: actions/setup-java@v4 36 - uses: actions/setup-java@v4
31 with: 37 with:
32 distribution: 'temurin' # See 'Supported distributions' for available options 38 distribution: 'temurin' # See 'Supported distributions' for available options
@@ -64,6 +64,12 @@ jobs: @@ -64,6 +64,12 @@ jobs:
64 with: 64 with:
65 fetch-depth: 0 65 fetch-depth: 0
66 66
  67 + - name: Update version
  68 + shell: bash
  69 + run: |
  70 + ./new-release.sh
  71 + git diff .
  72 +
67 - name: Configure CMake 73 - name: Configure CMake
68 shell: bash 74 shell: bash
69 run: | 75 run: |
@@ -52,6 +52,12 @@ jobs: @@ -52,6 +52,12 @@ jobs:
52 with: 52 with:
53 fetch-depth: 0 53 fetch-depth: 0
54 54
  55 + - name: Update version
  56 + shell: bash
  57 + run: |
  58 + ./new-release.sh
  59 + git diff .
  60 +
55 - name: Configure CMake 61 - name: Configure CMake
56 shell: bash 62 shell: bash
57 run: | 63 run: |
@@ -64,6 +64,12 @@ jobs: @@ -64,6 +64,12 @@ jobs:
64 with: 64 with:
65 fetch-depth: 0 65 fetch-depth: 0
66 66
  67 + - name: Update version
  68 + shell: bash
  69 + run: |
  70 + ./new-release.sh
  71 + git diff .
  72 +
67 - name: Configure CMake 73 - name: Configure CMake
68 shell: bash 74 shell: bash
69 run: | 75 run: |
  1 +../../../../../../../../../../sherpa-onnx/kotlin-api/VersionInfo.kt
@@ -68,6 +68,7 @@ def get_binaries(): @@ -68,6 +68,7 @@ def get_binaries():
68 "sherpa-onnx-vad-microphone", 68 "sherpa-onnx-vad-microphone",
69 "sherpa-onnx-vad-microphone-offline-asr", 69 "sherpa-onnx-vad-microphone-offline-asr",
70 "sherpa-onnx-vad-with-offline-asr", 70 "sherpa-onnx-vad-with-offline-asr",
  71 + "sherpa-onnx-version",
71 ] 72 ]
72 73
73 if enable_alsa(): 74 if enable_alsa():
@@ -9,6 +9,10 @@ import './init.dart'; @@ -9,6 +9,10 @@ import './init.dart';
9 void main(List<String> arguments) async { 9 void main(List<String> arguments) async {
10 await initSherpaOnnx(); 10 await initSherpaOnnx();
11 11
  12 + print('sherpa-onnx version: ${sherpa_onnx.getVersion()}');
  13 + print('sherpa-onnx gitSha1: ${sherpa_onnx.getGitSha1()}');
  14 + print('sherpa-onnx gitDate: ${sherpa_onnx.getGitDate()}');
  15 +
12 final parser = ArgParser() 16 final parser = ArgParser()
13 ..addOption('model', help: 'Path to the SenseVoice model') 17 ..addOption('model', help: 'Path to the SenseVoice model')
14 ..addOption('tokens', help: 'Path to tokens.txt') 18 ..addOption('tokens', help: 'Path to tokens.txt')
@@ -37,6 +37,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "kokoro-tts-play", "kokoro-t @@ -37,6 +37,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "kokoro-tts-play", "kokoro-t
37 EndProject 37 EndProject
38 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "speech-enhancement-gtcrn", "speech-enhancement-gtcrn\speech-enhancement-gtcrn.csproj", "{DF2569C6-6011-4716-9538-F9E9069E00EB}" 38 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "speech-enhancement-gtcrn", "speech-enhancement-gtcrn\speech-enhancement-gtcrn.csproj", "{DF2569C6-6011-4716-9538-F9E9069E00EB}"
39 EndProject 39 EndProject
  40 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "version-test", "version-test\version-test.csproj", "{E57711E5-6546-4BA0-B627-79C94F415BC5}"
  41 +EndProject
40 Global 42 Global
41 GlobalSection(SolutionConfigurationPlatforms) = preSolution 43 GlobalSection(SolutionConfigurationPlatforms) = preSolution
42 Debug|Any CPU = Debug|Any CPU 44 Debug|Any CPU = Debug|Any CPU
@@ -111,6 +113,10 @@ Global @@ -111,6 +113,10 @@ Global
111 {DF2569C6-6011-4716-9538-F9E9069E00EB}.Debug|Any CPU.Build.0 = Debug|Any CPU 113 {DF2569C6-6011-4716-9538-F9E9069E00EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
112 {DF2569C6-6011-4716-9538-F9E9069E00EB}.Release|Any CPU.ActiveCfg = Release|Any CPU 114 {DF2569C6-6011-4716-9538-F9E9069E00EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
113 {DF2569C6-6011-4716-9538-F9E9069E00EB}.Release|Any CPU.Build.0 = Release|Any CPU 115 {DF2569C6-6011-4716-9538-F9E9069E00EB}.Release|Any CPU.Build.0 = Release|Any CPU
  116 + {E57711E5-6546-4BA0-B627-79C94F415BC5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
  117 + {E57711E5-6546-4BA0-B627-79C94F415BC5}.Debug|Any CPU.Build.0 = Debug|Any CPU
  118 + {E57711E5-6546-4BA0-B627-79C94F415BC5}.Release|Any CPU.ActiveCfg = Release|Any CPU
  119 + {E57711E5-6546-4BA0-B627-79C94F415BC5}.Release|Any CPU.Build.0 = Release|Any CPU
114 EndGlobalSection 120 EndGlobalSection
115 GlobalSection(SolutionProperties) = preSolution 121 GlobalSection(SolutionProperties) = preSolution
116 HideSolutionNode = FALSE 122 HideSolutionNode = FALSE
  1 +// Copyright (c) 2025 Xiaomi Corporation
  2 +using SherpaOnnx;
  3 +
  4 +class VersionTestDemo
  5 +{
  6 + static void Main(string[] args)
  7 + {
  8 + var version = VersionInfo.Version;
  9 + var gitSha1 = VersionInfo.GitSha1;
  10 + var gitDate = VersionInfo.GitDate;
  11 +
  12 + Console.WriteLine("sherpa-onnx version: {0}", version);
  13 + Console.WriteLine("sherpa-onnx gitSha1: {0}", gitSha1);
  14 + Console.WriteLine("sherpa-onnx gitDate: {0}", gitDate);
  15 + }
  16 +}
  1 +#!/usr/bin/env bash
  2 +
  3 +set -ex
  4 +
  5 +dotnet run
  1 +<Project Sdk="Microsoft.NET.Sdk">
  2 +
  3 + <PropertyGroup>
  4 + <OutputType>Exe</OutputType>
  5 + <TargetFramework>net8.0</TargetFramework>
  6 + <RootNamespace>version_test</RootNamespace>
  7 + <ImplicitUsings>enable</ImplicitUsings>
  8 + <Nullable>enable</Nullable>
  9 + </PropertyGroup>
  10 +
  11 + <ItemGroup>
  12 + <ProjectReference Include="..\Common\Common.csproj" />
  13 + </ItemGroup>
  14 +
  15 +</Project>
@@ -17,6 +17,7 @@ export 'src/online_stream.dart'; @@ -17,6 +17,7 @@ export 'src/online_stream.dart';
17 export 'src/speaker_identification.dart'; 17 export 'src/speaker_identification.dart';
18 export 'src/tts.dart'; 18 export 'src/tts.dart';
19 export 'src/vad.dart'; 19 export 'src/vad.dart';
  20 +export 'src/version.dart';
20 export 'src/wave_reader.dart'; 21 export 'src/wave_reader.dart';
21 export 'src/wave_writer.dart'; 22 export 'src/wave_writer.dart';
22 23
@@ -1250,6 +1250,15 @@ typedef SherpaOnnxFreeWaveNative = Void Function(Pointer<SherpaOnnxWave>); @@ -1250,6 +1250,15 @@ typedef SherpaOnnxFreeWaveNative = Void Function(Pointer<SherpaOnnxWave>);
1250 1250
1251 typedef SherpaOnnxFreeWave = void Function(Pointer<SherpaOnnxWave>); 1251 typedef SherpaOnnxFreeWave = void Function(Pointer<SherpaOnnxWave>);
1252 1252
  1253 +typedef SherpaOnnxGetVersionStr = Pointer<Utf8> Function();
  1254 +typedef SherpaOnnxGetVersionStrNative = SherpaOnnxGetVersionStr;
  1255 +
  1256 +typedef SherpaOnnxGetGitSha1Native = Pointer<Utf8> Function();
  1257 +typedef SherpaOnnxGetGitSha1 = SherpaOnnxGetGitSha1Native;
  1258 +
  1259 +typedef SherpaOnnxGetGitDateNative = Pointer<Utf8> Function();
  1260 +typedef SherpaOnnxGetGitDate = SherpaOnnxGetGitDateNative;
  1261 +
1253 class SherpaOnnxBindings { 1262 class SherpaOnnxBindings {
1254 static SherpaOnnxCreateOfflineSpeechDenoiser? 1263 static SherpaOnnxCreateOfflineSpeechDenoiser?
1255 sherpaOnnxCreateOfflineSpeechDenoiser; 1264 sherpaOnnxCreateOfflineSpeechDenoiser;
@@ -1459,6 +1468,10 @@ class SherpaOnnxBindings { @@ -1459,6 +1468,10 @@ class SherpaOnnxBindings {
1459 1468
1460 static SherpaOnnxFreeWave? freeWave; 1469 static SherpaOnnxFreeWave? freeWave;
1461 1470
  1471 + static SherpaOnnxGetVersionStr? getVersionStr;
  1472 + static SherpaOnnxGetGitSha1? getGitSha1;
  1473 + static SherpaOnnxGetGitDate? getGitDate;
  1474 +
1462 static void init(DynamicLibrary dynamicLibrary) { 1475 static void init(DynamicLibrary dynamicLibrary) {
1463 sherpaOnnxCreateOfflineSpeechDenoiser ??= dynamicLibrary 1476 sherpaOnnxCreateOfflineSpeechDenoiser ??= dynamicLibrary
1464 .lookup<NativeFunction<SherpaOnnxCreateOfflineSpeechDenoiserNative>>( 1477 .lookup<NativeFunction<SherpaOnnxCreateOfflineSpeechDenoiserNative>>(
@@ -2050,5 +2063,20 @@ class SherpaOnnxBindings { @@ -2050,5 +2063,20 @@ class SherpaOnnxBindings {
2050 freeWave ??= dynamicLibrary 2063 freeWave ??= dynamicLibrary
2051 .lookup<NativeFunction<SherpaOnnxFreeWaveNative>>('SherpaOnnxFreeWave') 2064 .lookup<NativeFunction<SherpaOnnxFreeWaveNative>>('SherpaOnnxFreeWave')
2052 .asFunction(); 2065 .asFunction();
  2066 +
  2067 + getVersionStr ??= dynamicLibrary
  2068 + .lookup<NativeFunction<SherpaOnnxGetVersionStrNative>>(
  2069 + 'SherpaOnnxGetVersionStr')
  2070 + .asFunction();
  2071 +
  2072 + getGitSha1 ??= dynamicLibrary
  2073 + .lookup<NativeFunction<SherpaOnnxGetGitSha1Native>>(
  2074 + 'SherpaOnnxGetGitSha1')
  2075 + .asFunction();
  2076 +
  2077 + getGitDate ??= dynamicLibrary
  2078 + .lookup<NativeFunction<SherpaOnnxGetGitDateNative>>(
  2079 + 'SherpaOnnxGetGitDate')
  2080 + .asFunction();
2053 } 2081 }
2054 } 2082 }
  1 +// Copyright (c) 2025 Xiaomi Corporation
  2 +import 'dart:ffi';
  3 +import 'package:ffi/ffi.dart';
  4 +import './sherpa_onnx_bindings.dart';
  5 +
  6 +String getVersion() {
  7 + Pointer<Utf8> version = SherpaOnnxBindings.getVersionStr?.call() ?? nullptr;
  8 + if (version == nullptr) {
  9 + return '';
  10 + }
  11 +
  12 + return version.toDartString();
  13 +}
  14 +
  15 +String getGitSha1() {
  16 + Pointer<Utf8> gitSha1 = SherpaOnnxBindings.getGitSha1?.call() ?? nullptr;
  17 + if (gitSha1 == nullptr) {
  18 + return '';
  19 + }
  20 +
  21 + return gitSha1.toDartString();
  22 +}
  23 +
  24 +String getGitDate() {
  25 + Pointer<Utf8> gitDate = SherpaOnnxBindings.getGitDate?.call() ?? nullptr;
  26 + if (gitDate == nullptr) {
  27 + return '';
  28 + }
  29 +
  30 + return gitDate.toDartString();
  31 +}
@@ -12,6 +12,10 @@ import ( @@ -12,6 +12,10 @@ import (
12 ) 12 )
13 13
14 func main() { 14 func main() {
  15 + log.Printf("sherpa-onnx version: %v\n", sherpa.GetVersion())
  16 + log.Printf("sherpa-onnx gitSha1: %v\n", sherpa.GetGitSha1())
  17 + log.Printf("sherpa-onnx gitDate: %v\n", sherpa.GetGitDate())
  18 +
15 log.SetFlags(log.LstdFlags | log.Lmicroseconds) 19 log.SetFlags(log.LstdFlags | log.Lmicroseconds)
16 20
17 config := sherpa.OnlineRecognizerConfig{} 21 config := sherpa.OnlineRecognizerConfig{}
@@ -53,6 +53,7 @@ add_library(sherpa_onnx SHARED @@ -53,6 +53,7 @@ add_library(sherpa_onnx SHARED
53 streaming-asr.cc 53 streaming-asr.cc
54 utils.cc 54 utils.cc
55 vad.cc 55 vad.cc
  56 + version.cc
56 wave-reader.cc 57 wave-reader.cc
57 wave-writer.cc 58 wave-writer.cc
58 ) 59 )
@@ -29,6 +29,8 @@ void InitNonStreamingSpeakerDiarization(Napi::Env env, Napi::Object exports); @@ -29,6 +29,8 @@ void InitNonStreamingSpeakerDiarization(Napi::Env env, Napi::Object exports);
29 29
30 void InitNonStreamingSpeechDenoiser(Napi::Env env, Napi::Object exports); 30 void InitNonStreamingSpeechDenoiser(Napi::Env env, Napi::Object exports);
31 31
  32 +void InitVersion(Napi::Env env, Napi::Object exports);
  33 +
32 #if __OHOS__ 34 #if __OHOS__
33 void InitUtils(Napi::Env env, Napi::Object exports); 35 void InitUtils(Napi::Env env, Napi::Object exports);
34 #endif 36 #endif
@@ -47,6 +49,7 @@ Napi::Object Init(Napi::Env env, Napi::Object exports) { @@ -47,6 +49,7 @@ Napi::Object Init(Napi::Env env, Napi::Object exports) {
47 InitKeywordSpotting(env, exports); 49 InitKeywordSpotting(env, exports);
48 InitNonStreamingSpeakerDiarization(env, exports); 50 InitNonStreamingSpeakerDiarization(env, exports);
49 InitNonStreamingSpeechDenoiser(env, exports); 51 InitNonStreamingSpeechDenoiser(env, exports);
  52 + InitVersion(env, exports);
50 53
51 #if __OHOS__ 54 #if __OHOS__
52 InitUtils(env, exports); 55 InitUtils(env, exports);
  1 +// scripts/node-addon-api/src/version.cc
  2 +//
  3 +// Copyright (c) 2025 Xiaomi Corporation
  4 +#include <sstream>
  5 +
  6 +#include "napi.h" // NOLINT
  7 +#include "sherpa-onnx/c-api/c-api.h"
  8 +
  9 +void InitVersion(Napi::Env env, Napi::Object exports) {
  10 + Napi::String version = Napi::String::New(env, SherpaOnnxGetVersionStr());
  11 + Napi::String git_sha1 = Napi::String::New(env, SherpaOnnxGetGitSha1());
  12 + Napi::String git_date = Napi::String::New(env, SherpaOnnxGetGitDate());
  13 +
  14 + exports.Set(Napi::String::New(env, "version"), version);
  15 + exports.Set(Napi::String::New(env, "gitSha1"), git_sha1);
  16 + exports.Set(Napi::String::New(env, "gitDate"), git_date);
  17 +}
  1 +// Copyright 2025 Xiaomi Corporation
  2 +
  3 +import com.k2fsa.sherpa.onnx.*;
  4 +
  5 +public class VersionTest {
  6 + public static void main(String[] args) {
  7 + System.out.printf("sherpa-onnx version: %s\n", VersionInfo.getVersion());
  8 + System.out.printf("sherpa-onnx gitSha1: %s\n", VersionInfo.getGitSha1());
  9 + System.out.printf("sherpa-onnx gitDate: %s\n", VersionInfo.getGitDate());
  10 + }
  11 +}
  1 +#!/usr/bin/env bash
  2 +
  3 +set -ex
  4 +
  5 +if [[ ! -f ../build/lib/libsherpa-onnx-jni.dylib && ! -f ../build/lib/libsherpa-onnx-jni.so ]]; then
  6 + mkdir -p ../build
  7 + pushd ../build
  8 + cmake \
  9 + -DSHERPA_ONNX_ENABLE_PYTHON=OFF \
  10 + -DSHERPA_ONNX_ENABLE_TESTS=OFF \
  11 + -DSHERPA_ONNX_ENABLE_CHECK=OFF \
  12 + -DBUILD_SHARED_LIBS=ON \
  13 + -DSHERPA_ONNX_ENABLE_PORTAUDIO=OFF \
  14 + -DSHERPA_ONNX_ENABLE_JNI=ON \
  15 + ..
  16 +
  17 + make -j4
  18 + ls -lh lib
  19 + popd
  20 +fi
  21 +
  22 +if [ ! -f ../sherpa-onnx/java-api/build/sherpa-onnx.jar ]; then
  23 + pushd ../sherpa-onnx/java-api
  24 + make
  25 + popd
  26 +fi
  27 +
  28 +java \
  29 + -Djava.library.path=$PWD/../build/lib \
  30 + -cp ../sherpa-onnx/java-api/build/sherpa-onnx.jar \
  31 + ./VersionTest.java
  32 +
  1 +../sherpa-onnx/kotlin-api/VersionInfo.kt
@@ -25,6 +25,18 @@ if [[ ! -f ../build/lib/libsherpa-onnx-jni.dylib && ! -f ../build/lib/libsherpa @@ -25,6 +25,18 @@ if [[ ! -f ../build/lib/libsherpa-onnx-jni.dylib && ! -f ../build/lib/libsherpa
25 fi 25 fi
26 26
27 export LD_LIBRARY_PATH=$PWD/build/lib:$LD_LIBRARY_PATH 27 export LD_LIBRARY_PATH=$PWD/build/lib:$LD_LIBRARY_PATH
  28 +echo $LD_LIBRARY_PATH
  29 +
  30 +function testVersion() {
  31 + out_filename=test_version.jar
  32 + kotlinc-jvm -include-runtime -d $out_filename \
  33 + test_version.kt \
  34 + VersionInfo.kt
  35 +
  36 + ls -lh $out_filename
  37 +
  38 + java -Djava.library.path=../build/lib -jar $out_filename
  39 +}
28 40
29 function testSpeakerEmbeddingExtractor() { 41 function testSpeakerEmbeddingExtractor() {
30 if [ ! -f ./3dspeaker_speech_eres2net_large_sv_zh-cn_3dspeaker_16k.onnx ]; then 42 if [ ! -f ./3dspeaker_speech_eres2net_large_sv_zh-cn_3dspeaker_16k.onnx ]; then
@@ -436,6 +448,7 @@ function testOfflineSenseVoiceWithHr() { @@ -436,6 +448,7 @@ function testOfflineSenseVoiceWithHr() {
436 ls -lh $out_filename 448 ls -lh $out_filename
437 java -Djava.library.path=../build/lib -jar $out_filename 449 java -Djava.library.path=../build/lib -jar $out_filename
438 } 450 }
  451 +testVersion
439 452
440 testOfflineSenseVoiceWithHr 453 testOfflineSenseVoiceWithHr
441 testOfflineSpeechDenoiser 454 testOfflineSpeechDenoiser
  1 +package com.k2fsa.sherpa.onnx
  2 +
  3 +fun main() {
  4 + println("sherpa-onnx version: ${VersionInfo.version}");
  5 + println("sherpa-onnx gitSha1: ${VersionInfo.gitSha1}");
  6 + println("sherpa-onnx gitDate: ${VersionInfo.gitDate}");
  7 +}
  8 +
@@ -2,6 +2,13 @@ @@ -2,6 +2,13 @@
2 2
3 set -ex 3 set -ex
4 4
  5 +sed -i.bak 's/1\.12\.0/1\.12\.1/g' ./sherpa-onnx/csrc/version.cc
  6 +sha1=$(git describe --match=NeVeRmAtCh --always --abbrev=8)
  7 +date=$(git log -1 --format=%ad --date=local)
  8 +
  9 +sed -i.bak "s/ static const char \*sha1.*/ static const char \*sha1 = \"$sha1\";/g" ./sherpa-onnx/csrc/version.cc
  10 +sed -i.bak "s/ static const char \*date.*/ static const char \*date = \"$date\";/g" ./sherpa-onnx/csrc/version.cc
  11 +
5 sed -i.bak 's/1\.12\.0/1\.12\.1/g' ./build-ios-shared.sh 12 sed -i.bak 's/1\.12\.0/1\.12\.1/g' ./build-ios-shared.sh
6 sed -i.bak 's/1\.12\.0/1\.12\.1/g' ./pom.xml 13 sed -i.bak 's/1\.12\.0/1\.12\.1/g' ./pom.xml
7 sed -i.bak 's/1\.12\.0/1\.12\.1/g' ./jitpack.yml 14 sed -i.bak 's/1\.12\.0/1\.12\.1/g' ./jitpack.yml
1 // Copyright (c) 2024 Xiaomi Corporation 1 // Copyright (c) 2024 Xiaomi Corporation
2 const sherpa_onnx = require('sherpa-onnx-node'); 2 const sherpa_onnx = require('sherpa-onnx-node');
  3 +console.log(`verison : ${sherpa_onnx.version}`);
  4 +console.log(`git sha1: ${sherpa_onnx.gitSha1}`);
  5 +console.log(`git date: ${sherpa_onnx.gitDate}`);
3 6
4 // Please download test files from 7 // Please download test files from
5 // https://github.com/k2-fsa/sherpa-onnx/releases/tag/asr-models 8 // https://github.com/k2-fsa/sherpa-onnx/releases/tag/asr-models
1 // Copyright (c) 2023 Xiaomi Corporation (authors: Fangjun Kuang) 1 // Copyright (c) 2023 Xiaomi Corporation (authors: Fangjun Kuang)
2 // 2 //
3 const sherpa_onnx = require('sherpa-onnx'); 3 const sherpa_onnx = require('sherpa-onnx');
  4 +console.log(`verison : ${sherpa_onnx.version}`);
  5 +console.log(`git sha1: ${sherpa_onnx.gitSha1}`);
  6 +console.log(`git date: ${sherpa_onnx.gitDate}`);
4 7
5 function createOfflineRecognizer() { 8 function createOfflineRecognizer() {
6 let modelConfig = { 9 let modelConfig = {
@@ -8,3 +8,4 @@ paraformer_itn @@ -8,3 +8,4 @@ paraformer_itn
8 sense_voice 8 sense_voice
9 telespeech_ctc 9 telespeech_ctc
10 moonshine 10 moonshine
  11 +dolphin_ctc
@@ -62,6 +62,9 @@ begin @@ -62,6 +62,9 @@ begin
62 Duration := Length(Wave.Samples) / Wave.SampleRate; 62 Duration := Length(Wave.Samples) / Wave.SampleRate;
63 RealTimeFactor := Elapsed / Duration; 63 RealTimeFactor := Elapsed / Duration;
64 64
  65 + WriteLn(Format('sherpa-onnx version: %s', [SherpaOnnxGetVersionStr()]));
  66 + WriteLn(Format('sherpa-onnx gitSha1: %s', [SherpaOnnxGetGitSha1()]));
  67 + WriteLn(Format('sherpa-onnx gitDate: %s', [SherpaOnnxGetGitDate()]));
65 WriteLn(RecognitionResult.ToString); 68 WriteLn(RecognitionResult.ToString);
66 WriteLn(Format('NumThreads %d', [Config.ModelConfig.NumThreads])); 69 WriteLn(Format('NumThreads %d', [Config.ModelConfig.NumThreads]));
67 WriteLn(Format('Elapsed %.3f s', [Elapsed])); 70 WriteLn(Format('Elapsed %.3f s', [Elapsed]));
  1 +/// Copyright (c) 2025 Xiaomi Corporation (authors: Fangjun Kuang)
  2 +using System;
  3 +using System.Runtime.InteropServices;
  4 +using System.Text;
  5 +
  6 +
  7 +namespace SherpaOnnx
  8 +{
  9 + public class VersionInfo
  10 + {
  11 + public static String Version
  12 + {
  13 + get
  14 + {
  15 + IntPtr p = SherpaOnnxGetVersionStr();
  16 +
  17 + string s = "";
  18 + int length = 0;
  19 +
  20 + unsafe
  21 + {
  22 + byte* b = (byte*)p;
  23 + if (b != null)
  24 + {
  25 + while (*b != 0)
  26 + {
  27 + ++b;
  28 + length += 1;
  29 + }
  30 + }
  31 + }
  32 +
  33 + if (length > 0)
  34 + {
  35 + byte[] stringBuffer = new byte[length];
  36 + Marshal.Copy(p, stringBuffer, 0, length);
  37 + s = Encoding.UTF8.GetString(stringBuffer);
  38 + }
  39 +
  40 + return s;
  41 + }
  42 + }
  43 +
  44 + public static String GitSha1
  45 + {
  46 + get
  47 + {
  48 + IntPtr p = SherpaOnnxGetGitSha1();
  49 +
  50 + string s = "";
  51 + int length = 0;
  52 +
  53 + unsafe
  54 + {
  55 + byte* b = (byte*)p;
  56 + if (b != null)
  57 + {
  58 + while (*b != 0)
  59 + {
  60 + ++b;
  61 + length += 1;
  62 + }
  63 + }
  64 + }
  65 +
  66 + if (length > 0)
  67 + {
  68 + byte[] stringBuffer = new byte[length];
  69 + Marshal.Copy(p, stringBuffer, 0, length);
  70 + s = Encoding.UTF8.GetString(stringBuffer);
  71 + }
  72 +
  73 + return s;
  74 + }
  75 + }
  76 +
  77 + public static String GitDate
  78 + {
  79 + get
  80 + {
  81 + IntPtr p = SherpaOnnxGetGitDate();
  82 +
  83 + string s = "";
  84 + int length = 0;
  85 +
  86 + unsafe
  87 + {
  88 + byte* b = (byte*)p;
  89 + if (b != null)
  90 + {
  91 + while (*b != 0)
  92 + {
  93 + ++b;
  94 + length += 1;
  95 + }
  96 + }
  97 + }
  98 +
  99 + if (length > 0)
  100 + {
  101 + byte[] stringBuffer = new byte[length];
  102 + Marshal.Copy(p, stringBuffer, 0, length);
  103 + s = Encoding.UTF8.GetString(stringBuffer);
  104 + }
  105 +
  106 + return s;
  107 + }
  108 + }
  109 +
  110 +
  111 + [DllImport(Dll.Filename)]
  112 + private static extern IntPtr SherpaOnnxGetVersionStr();
  113 +
  114 + [DllImport(Dll.Filename)]
  115 + private static extern IntPtr SherpaOnnxGetGitSha1();
  116 +
  117 + [DllImport(Dll.Filename)]
  118 + private static extern IntPtr SherpaOnnxGetGitDate();
  119 + }
  120 +}
@@ -2027,3 +2027,15 @@ func (audio *DenoisedAudio) Save(filename string) bool { @@ -2027,3 +2027,15 @@ func (audio *DenoisedAudio) Save(filename string) bool {
2027 func (sd *OfflineSpeechDenoiser) SampleRate() int { 2027 func (sd *OfflineSpeechDenoiser) SampleRate() int {
2028 return int(C.SherpaOnnxOfflineSpeechDenoiserGetSampleRate(sd.impl)) 2028 return int(C.SherpaOnnxOfflineSpeechDenoiserGetSampleRate(sd.impl))
2029 } 2029 }
  2030 +
  2031 +func GetVersion() string {
  2032 + return C.GoString(C.SherpaOnnxGetVersionStr())
  2033 +}
  2034 +
  2035 +func GetGitSha1() string {
  2036 + return C.GoString(C.SherpaOnnxGetGitSha1())
  2037 +}
  2038 +
  2039 +func GetGitDate() string {
  2040 + return C.GoString(C.SherpaOnnxGetGitDate())
  2041 +}
@@ -28,6 +28,7 @@ set(srcs @@ -28,6 +28,7 @@ set(srcs
28 src/spoken-language-identification.cc 28 src/spoken-language-identification.cc
29 src/streaming-asr.cc 29 src/streaming-asr.cc
30 src/vad.cc 30 src/vad.cc
  31 + src/version.cc
31 src/wave-reader.cc 32 src/wave-reader.cc
32 src/wave-writer.cc 33 src/wave-writer.cc
33 ) 34 )
@@ -26,12 +26,14 @@ for (const p of possible_paths) { @@ -26,12 +26,14 @@ for (const p of possible_paths) {
26 } 26 }
27 27
28 if (!found) { 28 if (!found) {
29 - let addon_path = `${process.env.PWD}/node_modules/sherpa-onnx-${platform_arch}`; 29 + let addon_path =
  30 + `${process.env.PWD}/node_modules/sherpa-onnx-${platform_arch}`;
30 const pnpmIndex = __dirname.indexOf(`node_modules${path.sep}.pnpm`); 31 const pnpmIndex = __dirname.indexOf(`node_modules${path.sep}.pnpm`);
31 if (pnpmIndex !== -1) { 32 if (pnpmIndex !== -1) {
32 const parts = __dirname.slice(pnpmIndex).split(path.sep); 33 const parts = __dirname.slice(pnpmIndex).split(path.sep);
33 parts.pop(); 34 parts.pop();
34 - addon_path = `${process.env.PWD}/${parts.join('/')}/sherpa-onnx-${platform_arch}`; 35 + addon_path =
  36 + `${process.env.PWD}/${parts.join('/')}/sherpa-onnx-${platform_arch}`;
35 } 37 }
36 38
37 let msg = `Could not find sherpa-onnx-node. Tried\n\n ${ 39 let msg = `Could not find sherpa-onnx-node. Tried\n\n ${
@@ -28,4 +28,7 @@ module.exports = { @@ -28,4 +28,7 @@ module.exports = {
28 KeywordSpotter: kws.KeywordSpotter, 28 KeywordSpotter: kws.KeywordSpotter,
29 OfflineSpeakerDiarization: sd.OfflineSpeakerDiarization, 29 OfflineSpeakerDiarization: sd.OfflineSpeakerDiarization,
30 OfflineSpeechDenoiser: speech_denoiser.OfflineSpeechDenoiser, 30 OfflineSpeechDenoiser: speech_denoiser.OfflineSpeechDenoiser,
  31 + version: addon.version,
  32 + gitSha1: addon.gitSha1,
  33 + gitDate: addon.gitDate,
31 } 34 }
  1 +../../../harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/version.cc
@@ -60,6 +60,21 @@ function createOfflineSpeechDenoiser(config) { @@ -60,6 +60,21 @@ function createOfflineSpeechDenoiser(config) {
60 wasmModule, config); 60 wasmModule, config);
61 } 61 }
62 62
  63 +function getVersion() {
  64 + const v = wasmModule._SherpaOnnxGetVersionStr();
  65 + return wasmModule.UTF8ToString(v);
  66 +}
  67 +
  68 +function getGitSha1() {
  69 + const v = wasmModule._SherpaOnnxGetGitSha1();
  70 + return wasmModule.UTF8ToString(v);
  71 +}
  72 +
  73 +function getGitDate() {
  74 + const v = wasmModule._SherpaOnnxGetGitDate();
  75 + return wasmModule.UTF8ToString(v);
  76 +}
  77 +
63 // Note: online means streaming and offline means non-streaming here. 78 // Note: online means streaming and offline means non-streaming here.
64 // Both of them don't require internet connection. 79 // Both of them don't require internet connection.
65 module.exports = { 80 module.exports = {
@@ -74,4 +89,7 @@ module.exports = { @@ -74,4 +89,7 @@ module.exports = {
74 createVad, 89 createVad,
75 createOfflineSpeakerDiarization, 90 createOfflineSpeakerDiarization,
76 createOfflineSpeechDenoiser, 91 createOfflineSpeechDenoiser,
  92 + version: getVersion(),
  93 + gitSha1: getGitSha1(),
  94 + gitDate: getGitDate(),
77 }; 95 };
@@ -32,6 +32,7 @@ @@ -32,6 +32,7 @@
32 #include "sherpa-onnx/csrc/speaker-embedding-manager.h" 32 #include "sherpa-onnx/csrc/speaker-embedding-manager.h"
33 #include "sherpa-onnx/csrc/spoken-language-identification.h" 33 #include "sherpa-onnx/csrc/spoken-language-identification.h"
34 #include "sherpa-onnx/csrc/text-utils.h" 34 #include "sherpa-onnx/csrc/text-utils.h"
  35 +#include "sherpa-onnx/csrc/version.h"
35 #include "sherpa-onnx/csrc/voice-activity-detector.h" 36 #include "sherpa-onnx/csrc/voice-activity-detector.h"
36 #include "sherpa-onnx/csrc/wave-reader.h" 37 #include "sherpa-onnx/csrc/wave-reader.h"
37 #include "sherpa-onnx/csrc/wave-writer.h" 38 #include "sherpa-onnx/csrc/wave-writer.h"
@@ -44,6 +45,10 @@ @@ -44,6 +45,10 @@
44 #include "sherpa-onnx/csrc/offline-speaker-diarization.h" 45 #include "sherpa-onnx/csrc/offline-speaker-diarization.h"
45 #endif 46 #endif
46 47
  48 +const char *SherpaOnnxGetVersionStr() { return sherpa_onnx::GetVersionStr(); }
  49 +const char *SherpaOnnxGetGitSha1() { return sherpa_onnx::GetGitSha1(); }
  50 +const char *SherpaOnnxGetGitDate() { return sherpa_onnx::GetGitDate(); }
  51 +
47 struct SherpaOnnxOnlineRecognizer { 52 struct SherpaOnnxOnlineRecognizer {
48 std::unique_ptr<sherpa_onnx::OnlineRecognizer> impl; 53 std::unique_ptr<sherpa_onnx::OnlineRecognizer> impl;
49 }; 54 };
@@ -1369,9 +1374,8 @@ int64_t SherpaOnnxWaveFileSize(int32_t n_samples) { @@ -1369,9 +1374,8 @@ int64_t SherpaOnnxWaveFileSize(int32_t n_samples) {
1369 return sherpa_onnx::WaveFileSize(n_samples); 1374 return sherpa_onnx::WaveFileSize(n_samples);
1370 } 1375 }
1371 1376
1372 -SHERPA_ONNX_API void SherpaOnnxWriteWaveToBuffer(const float *samples,  
1373 - int32_t n, int32_t sample_rate,  
1374 - char *buffer) { 1377 +void SherpaOnnxWriteWaveToBuffer(const float *samples, int32_t n,
  1378 + int32_t sample_rate, char *buffer) {
1375 sherpa_onnx::WriteWave(buffer, sample_rate, samples, n); 1379 sherpa_onnx::WriteWave(buffer, sample_rate, samples, n);
1376 } 1380 }
1377 1381
@@ -47,6 +47,30 @@ extern "C" { @@ -47,6 +47,30 @@ extern "C" {
47 #define SHERPA_ONNX_API SHERPA_ONNX_IMPORT 47 #define SHERPA_ONNX_API SHERPA_ONNX_IMPORT
48 #endif 48 #endif
49 49
  50 +// Please don't free the returned pointer.
  51 +// Please don't modify the memory pointed by the returned pointer.
  52 +//
  53 +// The memory pointed by the returned pointer is statically allocated.
  54 +//
  55 +// Example return value: "1.12.1"
  56 +SHERPA_ONNX_API const char *SherpaOnnxGetVersionStr();
  57 +
  58 +// Please don't free the returned pointer.
  59 +// Please don't modify the memory pointed by the returned pointer.
  60 +//
  61 +// The memory pointed by the returned pointer is statically allocated.
  62 +//
  63 +// Example return value: "6982b86c"
  64 +SHERPA_ONNX_API const char *SherpaOnnxGetGitSha1();
  65 +
  66 +// Please don't free the returned pointer.
  67 +// Please don't modify the memory pointed by the returned pointer.
  68 +//
  69 +// The memory pointed by the returned pointer is statically allocated.
  70 +//
  71 +// Example return value: "Fri Jun 20 11:22:52 2025"
  72 +SHERPA_ONNX_API const char *SherpaOnnxGetGitDate();
  73 +
50 /// Please refer to 74 /// Please refer to
51 /// https://k2-fsa.github.io/sherpa/onnx/pretrained_models/index.html 75 /// https://k2-fsa.github.io/sherpa/onnx/pretrained_models/index.html
52 /// to download pre-trained models. That is, you can find encoder-xxx.onnx 76 /// to download pre-trained models. That is, you can find encoder-xxx.onnx
@@ -717,4 +717,10 @@ int32_t LinearResampler::GetOutputSamplingRate() const { @@ -717,4 +717,10 @@ int32_t LinearResampler::GetOutputSamplingRate() const {
717 return SherpaOnnxLinearResamplerResampleGetOutputSampleRate(p_); 717 return SherpaOnnxLinearResamplerResampleGetOutputSampleRate(p_);
718 } 718 }
719 719
  720 +std::string GetVersionStr() { return SherpaOnnxGetVersionStr(); }
  721 +
  722 +std::string GetGitSha1() { return SherpaOnnxGetGitSha1(); }
  723 +
  724 +std::string GetGitDate() { return SherpaOnnxGetGitDate(); }
  725 +
720 } // namespace sherpa_onnx::cxx 726 } // namespace sherpa_onnx::cxx
@@ -615,6 +615,10 @@ class SHERPA_ONNX_API LinearResampler @@ -615,6 +615,10 @@ class SHERPA_ONNX_API LinearResampler
615 explicit LinearResampler(const SherpaOnnxLinearResampler *p); 615 explicit LinearResampler(const SherpaOnnxLinearResampler *p);
616 }; 616 };
617 617
  618 +std::string GetVersionStr();
  619 +std::string GetGitSha1();
  620 +std::string GetGitDate();
  621 +
618 } // namespace sherpa_onnx::cxx 622 } // namespace sherpa_onnx::cxx
619 623
620 #endif // SHERPA_ONNX_C_API_CXX_API_H_ 624 #endif // SHERPA_ONNX_C_API_CXX_API_H_
@@ -129,6 +129,7 @@ set(sources @@ -129,6 +129,7 @@ set(sources
129 utils.cc 129 utils.cc
130 vad-model-config.cc 130 vad-model-config.cc
131 vad-model.cc 131 vad-model.cc
  132 + version.cc
132 voice-activity-detector.cc 133 voice-activity-detector.cc
133 wave-reader.cc 134 wave-reader.cc
134 wave-writer.cc 135 wave-writer.cc
@@ -337,6 +338,7 @@ if(SHERPA_ONNX_ENABLE_BINARY) @@ -337,6 +338,7 @@ if(SHERPA_ONNX_ENABLE_BINARY)
337 add_executable(sherpa-onnx-offline-punctuation sherpa-onnx-offline-punctuation.cc) 338 add_executable(sherpa-onnx-offline-punctuation sherpa-onnx-offline-punctuation.cc)
338 add_executable(sherpa-onnx-offline-source-separation sherpa-onnx-offline-source-separation.cc) 339 add_executable(sherpa-onnx-offline-source-separation sherpa-onnx-offline-source-separation.cc)
339 add_executable(sherpa-onnx-online-punctuation sherpa-onnx-online-punctuation.cc) 340 add_executable(sherpa-onnx-online-punctuation sherpa-onnx-online-punctuation.cc)
  341 + add_executable(sherpa-onnx-version sherpa-onnx-version.cc version.cc)
340 add_executable(sherpa-onnx-vad sherpa-onnx-vad.cc) 342 add_executable(sherpa-onnx-vad sherpa-onnx-vad.cc)
341 343
342 if(SHERPA_ONNX_ENABLE_TTS) 344 if(SHERPA_ONNX_ENABLE_TTS)
@@ -396,6 +398,7 @@ if(SHERPA_ONNX_ENABLE_BINARY) @@ -396,6 +398,7 @@ if(SHERPA_ONNX_ENABLE_BINARY)
396 install( 398 install(
397 TARGETS 399 TARGETS
398 ${main_exes} 400 ${main_exes}
  401 + sherpa-onnx-version
399 DESTINATION 402 DESTINATION
400 bin 403 bin
401 ) 404 )
  1 +// sherpa-onnx/csrc/sherpa-onnx-version.cc
  2 +//
  3 +// Copyright (c) 2025 Xiaomi Corporation
  4 +
  5 +#include <stdio.h>
  6 +
  7 +#include <cstdint>
  8 +
  9 +#include "sherpa-onnx/csrc/version.h"
  10 +
  11 +int32_t main() {
  12 + printf("sherpa-onnx version : %s\n", sherpa_onnx::GetVersionStr());
  13 + printf("sherpa-onnx Git SHA1: %s\n", sherpa_onnx::GetGitSha1());
  14 + printf("sherpa-onnx Git date: %s\n", sherpa_onnx::GetGitDate());
  15 +
  16 + return 0;
  17 +}
@@ -312,7 +312,8 @@ static std::vector<std::string> MergeCharactersIntoWords( @@ -312,7 +312,8 @@ static std::vector<std::string> MergeCharactersIntoWords(
312 while (i < n) { 312 while (i < n) {
313 const auto &w = words[i]; 313 const auto &w = words[i];
314 if (w.size() >= 3 || (w.size() == 2 && !IsSpecial(w)) || 314 if (w.size() >= 3 || (w.size() == 2 && !IsSpecial(w)) ||
315 - (w.size() == 1 && (IsPunct(w[0]) || std::isspace(static_cast<uint8_t>(w[0]))))) { 315 + (w.size() == 1 &&
  316 + (IsPunct(w[0]) || std::isspace(static_cast<uint8_t>(w[0]))))) {
316 if (prev != -1) { 317 if (prev != -1) {
317 std::string t; 318 std::string t;
318 for (; prev < i; ++prev) { 319 for (; prev < i; ++prev) {
  1 +// sherpa-onnx/csrc/version.h
  2 +//
  3 +// Copyright 2025 Xiaomi Corporation
  4 +
  5 +#include "sherpa-onnx/csrc/version.h"
  6 +
  7 +namespace sherpa_onnx {
  8 +
  9 +const char *GetGitDate() {
  10 + static const char *date = "Fri Jun 20 11:22:52 2025";
  11 + return date;
  12 +}
  13 +
  14 +const char *GetGitSha1() {
  15 + static const char *sha1 = "6982b86c";
  16 + return sha1;
  17 +}
  18 +
  19 +const char *GetVersionStr() {
  20 + static const char *version = "1.12.1";
  21 + return version;
  22 +}
  23 +
  24 +} // namespace sherpa_onnx
  1 +// sherpa-onnx/csrc/version.h
  2 +//
  3 +// Copyright 2025 Xiaomi Corporation
  4 +#ifndef SHERPA_ONNX_CSRC_VERSION_H_
  5 +#define SHERPA_ONNX_CSRC_VERSION_H_
  6 +
  7 +namespace sherpa_onnx {
  8 +
  9 +// Please don't free the returned pointer.
  10 +// Please don't modify the memory pointed by the returned pointer.
  11 +//
  12 +// The memory pointed by the returned pointer is statically allocated.
  13 +const char *GetVersionStr();
  14 +
  15 +// Please don't free the returned pointer.
  16 +// Please don't modify the memory pointed by the returned pointer.
  17 +//
  18 +// The memory pointed by the returned pointer is statically allocated.
  19 +const char *GetGitSha1();
  20 +
  21 +// Please don't free the returned pointer.
  22 +// Please don't modify the memory pointed by the returned pointer.
  23 +//
  24 +// The memory pointed by the returned pointer is statically allocated.
  25 +const char *GetGitDate();
  26 +
  27 +} // namespace sherpa_onnx
  28 +
  29 +#endif // SHERPA_ONNX_CSRC_VERSION_H_
@@ -8,6 +8,7 @@ package_dir := com/k2fsa/sherpa/onnx @@ -8,6 +8,7 @@ package_dir := com/k2fsa/sherpa/onnx
8 8
9 java_files := LibraryLoader.java 9 java_files := LibraryLoader.java
10 10
  11 +java_files += VersionInfo.java
11 java_files += WaveReader.java 12 java_files += WaveReader.java
12 java_files += WaveWriter.java 13 java_files += WaveWriter.java
13 java_files += EndpointRule.java 14 java_files += EndpointRule.java
  1 +package com.k2fsa.sherpa.onnx;
  2 +
  3 +public class VersionInfo {
  4 +
  5 + public static String getVersion() {
  6 + LibraryLoader.maybeLoad();
  7 + return getVersionStr2();
  8 + }
  9 +
  10 + public static String getGitSha1() {
  11 + LibraryLoader.maybeLoad();
  12 + return getGitSha12();
  13 + }
  14 +
  15 + public static String getGitDate() {
  16 + LibraryLoader.maybeLoad();
  17 + return getGitDate2();
  18 + }
  19 +
  20 + private static native String getVersionStr2();
  21 + private static native String getGitSha12();
  22 + private static native String getGitDate2();
  23 +}
@@ -24,6 +24,7 @@ set(sources @@ -24,6 +24,7 @@ set(sources
24 speaker-embedding-extractor.cc 24 speaker-embedding-extractor.cc
25 speaker-embedding-manager.cc 25 speaker-embedding-manager.cc
26 spoken-language-identification.cc 26 spoken-language-identification.cc
  27 + version.cc
27 voice-activity-detector.cc 28 voice-activity-detector.cc
28 wave-reader.cc 29 wave-reader.cc
29 wave-writer.cc 30 wave-writer.cc
  1 +// sherpa-onnx/jni/version.cc
  2 +//
  3 +// Copyright (c) 2025 Xiaomi Corporation
  4 +#include "sherpa-onnx/csrc/version.h"
  5 +
  6 +#include "sherpa-onnx/jni/common.h"
  7 +
  8 +namespace sherpa_onnx {
  9 +
  10 +SHERPA_ONNX_EXTERN_C
  11 +JNIEXPORT jstring JNICALL
  12 +Java_com_k2fsa_sherpa_onnx_VersionInfo_00024Companion_getVersionStr2(
  13 + JNIEnv *env, jclass /*cls*/) {
  14 + return env->NewStringUTF(GetVersionStr());
  15 +}
  16 +
  17 +SHERPA_ONNX_EXTERN_C
  18 +JNIEXPORT jstring JNICALL
  19 +Java_com_k2fsa_sherpa_onnx_VersionInfo_00024Companion_getGitSha12(
  20 + JNIEnv *env, jclass /*cls*/) {
  21 + return env->NewStringUTF(GetGitSha1());
  22 +}
  23 +
  24 +SHERPA_ONNX_EXTERN_C
  25 +JNIEXPORT jstring JNICALL
  26 +Java_com_k2fsa_sherpa_onnx_VersionInfo_00024Companion_getGitDate2(
  27 + JNIEnv *env, jclass /*cls*/) {
  28 + return env->NewStringUTF(GetGitDate());
  29 +}
  30 +
  31 +SHERPA_ONNX_EXTERN_C
  32 +JNIEXPORT jstring JNICALL Java_com_k2fsa_sherpa_onnx_VersionInfo_getVersionStr2(
  33 + JNIEnv *env, jclass /*cls*/) {
  34 + return env->NewStringUTF(GetVersionStr());
  35 +}
  36 +
  37 +SHERPA_ONNX_EXTERN_C
  38 +JNIEXPORT jstring JNICALL Java_com_k2fsa_sherpa_onnx_VersionInfo_getGitSha12(
  39 + JNIEnv *env, jclass /*cls*/) {
  40 + return env->NewStringUTF(GetGitSha1());
  41 +}
  42 +
  43 +SHERPA_ONNX_EXTERN_C
  44 +JNIEXPORT jstring JNICALL Java_com_k2fsa_sherpa_onnx_VersionInfo_getGitDate2(
  45 + JNIEnv *env, jclass /*cls*/) {
  46 + return env->NewStringUTF(GetGitDate());
  47 +}
  48 +
  49 +} // namespace sherpa_onnx
  1 +package com.k2fsa.sherpa.onnx
  2 +
  3 +class VersionInfo {
  4 + companion object {
  5 + init {
  6 + System.loadLibrary("sherpa-onnx-jni")
  7 + }
  8 +
  9 + val version: String
  10 + get() = getVersionStr2()
  11 +
  12 + val gitSha1: String
  13 + get() = getGitSha12()
  14 +
  15 + val gitDate: String
  16 + get() = getGitDate2()
  17 +
  18 + external fun getVersionStr2(): String
  19 + external fun getGitSha12(): String
  20 + external fun getGitDate2(): String
  21 + }
  22 +}
@@ -578,6 +578,10 @@ type @@ -578,6 +578,10 @@ type
578 function SherpaOnnxWriteWave(Filename: AnsiString; 578 function SherpaOnnxWriteWave(Filename: AnsiString;
579 Samples: array of Single; SampleRate: Integer): Boolean; 579 Samples: array of Single; SampleRate: Integer): Boolean;
580 580
  581 + function SherpaOnnxGetVersionStr(): AnsiString;
  582 + function SherpaOnnxGetGitSha1(): AnsiString;
  583 + function SherpaOnnxGetGitDate(): AnsiString;
  584 +
581 implementation 585 implementation
582 586
583 uses 587 uses
@@ -951,6 +955,30 @@ function SherpaOnnxCreateLinearResampler(SampleRateInHz: cint32; @@ -951,6 +955,30 @@ function SherpaOnnxCreateLinearResampler(SampleRateInHz: cint32;
951 NumZeros: cint32): Pointer; cdecl; 955 NumZeros: cint32): Pointer; cdecl;
952 external SherpaOnnxLibName; 956 external SherpaOnnxLibName;
953 957
  958 +function SherpaOnnxGetVersionStrWrapper(): PAnsiChar; cdecl;
  959 + external SherpaOnnxLibName name 'SherpaOnnxGetVersionStr';
  960 +
  961 +function SherpaOnnxGetGitSha1Wrapper(): PAnsiChar; cdecl;
  962 + external SherpaOnnxLibName name 'SherpaOnnxGetGitSha1';
  963 +
  964 +function SherpaOnnxGetGitDateWrapper(): PAnsiChar; cdecl;
  965 + external SherpaOnnxLibName name 'SherpaOnnxGetGitDate';
  966 +
  967 +function SherpaOnnxGetVersionStr(): AnsiString;
  968 +begin
  969 + Result := SherpaOnnxGetVersionStrWrapper();
  970 +end;
  971 +
  972 +function SherpaOnnxGetGitSha1(): AnsiString;
  973 +begin
  974 + Result := SherpaOnnxGetGitSha1Wrapper();
  975 +end;
  976 +
  977 +function SherpaOnnxGetGitDate(): AnsiString;
  978 +begin
  979 + Result := SherpaOnnxGetGitDateWrapper();
  980 +end;
  981 +
954 procedure SherpaOnnxDestroyLinearResampler(P: Pointer); cdecl; 982 procedure SherpaOnnxDestroyLinearResampler(P: Pointer); cdecl;
955 external SherpaOnnxLibName; 983 external SherpaOnnxLibName;
956 984
@@ -53,6 +53,7 @@ set(srcs @@ -53,6 +53,7 @@ set(srcs
53 tensorrt-config.cc 53 tensorrt-config.cc
54 vad-model-config.cc 54 vad-model-config.cc
55 vad-model.cc 55 vad-model.cc
  56 + version.cc
56 voice-activity-detector.cc 57 voice-activity-detector.cc
57 wave-writer.cc 58 wave-writer.cc
58 ) 59 )
@@ -4,6 +4,7 @@ @@ -4,6 +4,7 @@
4 4
5 #include "sherpa-onnx/csrc/offline-source-separation.h" 5 #include "sherpa-onnx/csrc/offline-source-separation.h"
6 6
  7 +#include <algorithm>
7 #include <string> 8 #include <string>
8 9
9 #include "sherpa-onnx/python/csrc/offline-source-separation-model-config.h" 10 #include "sherpa-onnx/python/csrc/offline-source-separation-model-config.h"
1 -// sherpa-onnx/python/csrc/offline-source-separation-config.h 1 +// sherpa-onnx/python/csrc/offline-source-separation.h
2 // 2 //
3 // Copyright (c) 2025 Xiaomi Corporation 3 // Copyright (c) 2025 Xiaomi Corporation
4 4
5 -#ifndef SHERPA_ONNX_PYTHON_CSRC_OFFLINE_SOURCE_SEPARATION_CONFIG_H_  
6 -#define SHERPA_ONNX_PYTHON_CSRC_OFFLINE_SOURCE_SEPARATION_CONFIG_H_ 5 +#ifndef SHERPA_ONNX_PYTHON_CSRC_OFFLINE_SOURCE_SEPARATION_H_
  6 +#define SHERPA_ONNX_PYTHON_CSRC_OFFLINE_SOURCE_SEPARATION_H_
7 7
8 #include "sherpa-onnx/python/csrc/sherpa-onnx.h" 8 #include "sherpa-onnx/python/csrc/sherpa-onnx.h"
9 9
@@ -13,4 +13,4 @@ void PybindOfflineSourceSeparation(py::module *m); @@ -13,4 +13,4 @@ void PybindOfflineSourceSeparation(py::module *m);
13 13
14 } 14 }
15 15
16 -#endif // SHERPA_ONNX_PYTHON_CSRC_OFFLINE_SOURCE_SEPARATION_CONFIG_H_ 16 +#endif // SHERPA_ONNX_PYTHON_CSRC_OFFLINE_SOURCE_SEPARATION_H_
@@ -31,6 +31,7 @@ @@ -31,6 +31,7 @@
31 #include "sherpa-onnx/python/csrc/spoken-language-identification.h" 31 #include "sherpa-onnx/python/csrc/spoken-language-identification.h"
32 #include "sherpa-onnx/python/csrc/vad-model-config.h" 32 #include "sherpa-onnx/python/csrc/vad-model-config.h"
33 #include "sherpa-onnx/python/csrc/vad-model.h" 33 #include "sherpa-onnx/python/csrc/vad-model.h"
  34 +#include "sherpa-onnx/python/csrc/version.h"
34 #include "sherpa-onnx/python/csrc/voice-activity-detector.h" 35 #include "sherpa-onnx/python/csrc/voice-activity-detector.h"
35 #include "sherpa-onnx/python/csrc/wave-writer.h" 36 #include "sherpa-onnx/python/csrc/wave-writer.h"
36 37
@@ -112,6 +113,7 @@ PYBIND11_MODULE(_sherpa_onnx, m) { @@ -112,6 +113,7 @@ PYBIND11_MODULE(_sherpa_onnx, m) {
112 PybindAlsa(&m); 113 PybindAlsa(&m);
113 PybindOfflineSpeechDenoiser(&m); 114 PybindOfflineSpeechDenoiser(&m);
114 PybindOfflineSourceSeparation(&m); 115 PybindOfflineSourceSeparation(&m);
  116 + PybindVersion(&m);
115 } 117 }
116 118
117 } // namespace sherpa_onnx 119 } // namespace sherpa_onnx
  1 +// sherpa-onnx/python/csrc/version.cc
  2 +//
  3 +// Copyright (c) 2025 Xiaomi Corporation
  4 +
  5 +#include "sherpa-onnx/python/csrc/version.h"
  6 +
  7 +#include <string>
  8 +
  9 +#include "sherpa-onnx/csrc/version.h"
  10 +
  11 +namespace sherpa_onnx {
  12 +
  13 +void PybindVersion(py::module *m) {
  14 + m->attr("version") = std::string(GetVersionStr());
  15 +
  16 + m->attr("git_sha1") = std::string(GetGitSha1());
  17 +
  18 + m->attr("git_date") = std::string(GetGitDate());
  19 +}
  20 +
  21 +} // namespace sherpa_onnx
  1 +// sherpa-onnx/python/csrc/version.h
  2 +//
  3 +// Copyright (c) 2025 Xiaomi Corporation
  4 +
  5 +#ifndef SHERPA_ONNX_PYTHON_CSRC_VERSION_H_
  6 +#define SHERPA_ONNX_PYTHON_CSRC_VERSION_H_
  7 +
  8 +#include "sherpa-onnx/python/csrc/sherpa-onnx.h"
  9 +
  10 +namespace sherpa_onnx {
  11 +
  12 +void PybindVersion(py::module *m);
  13 +
  14 +}
  15 +
  16 +#endif // SHERPA_ONNX_PYTHON_CSRC_VERSION_H_
@@ -49,6 +49,9 @@ from _sherpa_onnx import ( @@ -49,6 +49,9 @@ from _sherpa_onnx import (
49 VadModel, 49 VadModel,
50 VadModelConfig, 50 VadModelConfig,
51 VoiceActivityDetector, 51 VoiceActivityDetector,
  52 + git_date,
  53 + git_sha1,
  54 + version,
52 write_wave, 55 write_wave,
53 ) 56 )
54 57
@@ -1448,3 +1448,15 @@ class SherpaOnnxOfflineSpeechDenoiserWrapper { @@ -1448,3 +1448,15 @@ class SherpaOnnxOfflineSpeechDenoiserWrapper {
1448 return Int(SherpaOnnxOfflineSpeechDenoiserGetSampleRate(impl)) 1448 return Int(SherpaOnnxOfflineSpeechDenoiserGetSampleRate(impl))
1449 } 1449 }
1450 } 1450 }
  1451 +
  1452 +func getSherpaOnnxVersion() -> String {
  1453 + return String(cString: SherpaOnnxGetVersionStr())
  1454 +}
  1455 +
  1456 +func getSherpaOnnxGitSha1() -> String {
  1457 + return String(cString: SherpaOnnxGetGitSha1())
  1458 +}
  1459 +
  1460 +func getSherpaOnnxGitDate() -> String {
  1461 + return String(cString: SherpaOnnxGetGitDate())
  1462 +}
  1 +#!/usr/bin/env bash
  2 +
  3 +set -ex
  4 +
  5 +if [ ! -d ../build-swift-macos ]; then
  6 + echo "Please run ../build-swift-macos.sh first!"
  7 + exit 1
  8 +fi
  9 +
  10 +if [ ! -e ./test-version ]; then
  11 + # Note: We use -lc++ to link against libc++ instead of libstdc++
  12 + swiftc \
  13 + -lc++ \
  14 + -I ../build-swift-macos/install/include \
  15 + -import-objc-header ./SherpaOnnx-Bridging-Header.h \
  16 + ./test-version.swift ./SherpaOnnx.swift \
  17 + -L ../build-swift-macos/install/lib/ \
  18 + -l sherpa-onnx \
  19 + -l onnxruntime \
  20 + -o ./test-version
  21 +
  22 + strip ./test-version
  23 +else
  24 + echo "./test-version exists - skip building"
  25 +fi
  26 +
  27 +export DYLD_LIBRARY_PATH=$PWD/../build-swift-macos/install/lib:$DYLD_LIBRARY_PATH
  28 +./test-version
  1 +func run() {
  2 + let version = getSherpaOnnxVersion()
  3 + let gitSha1 = getSherpaOnnxGitSha1()
  4 + let gitDate = getSherpaOnnxGitDate()
  5 + print("sherpa-onnx version: \(version)")
  6 + print("sherpa-onnx gitSha1: \(gitSha1)")
  7 + print("sherpa-onnx gitDate: \(gitDate)")
  8 +}
  9 +
  10 +@main
  11 +struct App {
  12 + static func main() {
  13 + run()
  14 + }
  15 +}
@@ -94,6 +94,10 @@ set(exported_functions @@ -94,6 +94,10 @@ set(exported_functions
94 SherpaOnnxDestroyOfflineSpeechDenoiser 94 SherpaOnnxDestroyOfflineSpeechDenoiser
95 SherpaOnnxOfflineSpeechDenoiserGetSampleRate 95 SherpaOnnxOfflineSpeechDenoiserGetSampleRate
96 SherpaOnnxOfflineSpeechDenoiserRun 96 SherpaOnnxOfflineSpeechDenoiserRun
  97 + # version
  98 + SherpaOnnxGetGitDate
  99 + SherpaOnnxGetGitSha1
  100 + SherpaOnnxGetVersionStr
97 ) 101 )
98 102
99 103