Fangjun Kuang
Committed by GitHub

Add API to get version information (#2309)

正在显示 169 个修改的文件 包含 1480 行增加12 行删除
... ... @@ -2,7 +2,11 @@
cd dotnet-examples/
cd ./speech-enhancement-gtcrn
cd ./version-test
./run.sh
ls -lh
cd ../speech-enhancement-gtcrn
./run.sh
ls -lh
... ...
... ... @@ -7,6 +7,8 @@ echo "pwd: $PWD"
cd swift-api-examples
ls -lh
./run-test-version.sh
./run-decode-file-sense-voice-with-hr.sh
rm -rf sherpa-onnx-sense-voice-*
rm -rf dict lexicon.txt replace.fst test-hr.wav
... ...
... ... @@ -58,6 +58,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Build sherpa-onnx
if: matrix.gpu == 'ON'
shell: bash
... ...
... ... @@ -43,6 +43,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Build sherpa-onnx
uses: addnab/docker-run-action@v3
with:
... ...
... ... @@ -47,6 +47,12 @@ jobs:
with:
key: ${{ matrix.os }}-android-rknn
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Display NDK HOME
shell: bash
run: |
... ... @@ -158,6 +164,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
# https://github.com/actions/setup-java
- uses: actions/setup-java@v4
with:
... ...
... ... @@ -45,6 +45,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
... ... @@ -190,6 +196,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
# https://github.com/actions/setup-java
- uses: actions/setup-java@v4
with:
... ...
... ... @@ -42,6 +42,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
... ... @@ -184,6 +190,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
# https://github.com/actions/setup-java
- uses: actions/setup-java@v4
with:
... ...
... ... @@ -31,6 +31,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
# https://github.com/actions/setup-java
- uses: actions/setup-java@v4
with:
... ...
... ... @@ -31,6 +31,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
# https://github.com/actions/setup-java
- uses: actions/setup-java@v4
with:
... ...
... ... @@ -31,6 +31,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
# https://github.com/actions/setup-java
- uses: actions/setup-java@v4
with:
... ...
... ... @@ -31,6 +31,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
# https://github.com/actions/setup-java
- uses: actions/setup-java@v4
with:
... ...
... ... @@ -31,6 +31,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
# https://github.com/actions/setup-java
- uses: actions/setup-java@v4
with:
... ...
... ... @@ -31,6 +31,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
# https://github.com/actions/setup-java
- uses: actions/setup-java@v4
with:
... ...
... ... @@ -31,6 +31,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
# https://github.com/actions/setup-java
- uses: actions/setup-java@v4
with:
... ...
... ... @@ -31,6 +31,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
# https://github.com/actions/setup-java
- uses: actions/setup-java@v4
with:
... ...
... ... @@ -31,6 +31,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
# https://github.com/actions/setup-java
- uses: actions/setup-java@v4
with:
... ...
... ... @@ -31,6 +31,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
# https://github.com/actions/setup-java
- uses: actions/setup-java@v4
with:
... ...
... ... @@ -31,6 +31,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
# https://github.com/actions/setup-java
- uses: actions/setup-java@v4
with:
... ...
... ... @@ -31,6 +31,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
# https://github.com/actions/setup-java
- uses: actions/setup-java@v4
with:
... ...
... ... @@ -31,6 +31,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
# https://github.com/actions/setup-java
- uses: actions/setup-java@v4
with:
... ...
... ... @@ -44,6 +44,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
... ...
... ... @@ -26,6 +26,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
... ...
... ... @@ -27,6 +27,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
# see https://cibuildwheel.readthedocs.io/en/stable/changelog/
# for a list of versions
- name: Build wheels
... ...
... ... @@ -25,6 +25,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Setup Python
uses: actions/setup-python@v5
with:
... ...
... ... @@ -29,6 +29,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
# see https://cibuildwheel.readthedocs.io/en/stable/changelog/
# for a list of versions
- name: Build wheels
... ...
... ... @@ -26,6 +26,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
... ...
... ... @@ -26,6 +26,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
... ...
... ... @@ -28,6 +28,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
# see https://cibuildwheel.readthedocs.io/en/stable/changelog/
# for a list of versions
- name: Build wheels
... ...
... ... @@ -26,6 +26,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Build wheels
uses: pypa/cibuildwheel@v2.21.3
env:
... ...
... ... @@ -26,6 +26,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Build wheels
uses: pypa/cibuildwheel@v2.21.3
env:
... ...
... ... @@ -26,6 +26,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
# see https://cibuildwheel.readthedocs.io/en/stable/changelog/
# for a list of versions
- name: Build wheels
... ...
... ... @@ -26,6 +26,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
# see https://cibuildwheel.readthedocs.io/en/stable/changelog/
# for a list of versions
- name: Build wheels
... ...
... ... @@ -26,6 +26,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
... ...
... ... @@ -26,6 +26,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
... ...
... ... @@ -43,6 +43,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Build iOS shared
if: matrix.with_tts == 'ON'
shell: bash
... ...
... ... @@ -44,6 +44,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
... ...
... ... @@ -42,6 +42,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
... ...
... ... @@ -33,6 +33,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
... ...
... ... @@ -41,6 +41,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
... ...
... ... @@ -25,6 +25,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Build sherpa-onnx
shell: bash
run: |
... ...
... ... @@ -27,6 +27,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Display NDK HOME
shell: bash
run: |
... ...
... ... @@ -30,10 +30,16 @@ jobs:
index: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Install deps
shell: bash
run: |
... ... @@ -235,6 +241,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Retrieve artifact from ubuntu-latest
uses: actions/download-artifact@v3
with:
... ...
... ... @@ -28,6 +28,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Install Python dependencies
shell: bash
run: |
... ... @@ -134,6 +140,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Install Python dependencies
shell: bash
run: |
... ...
... ... @@ -27,6 +27,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Install Python dependencies
shell: bash
run: |
... ... @@ -125,6 +131,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Install Python dependencies
shell: bash
run: |
... ...
... ... @@ -32,6 +32,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
# https://github.com/actions/setup-java
- uses: actions/setup-java@v4
with:
... ...
... ... @@ -28,6 +28,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
... ...
... ... @@ -29,6 +29,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
... ...
... ... @@ -42,6 +42,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
... ...
... ... @@ -48,6 +48,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
... ... @@ -259,6 +265,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Retrieve artifact from windows x64
uses: actions/download-artifact@v4
with:
... ...
... ... @@ -56,6 +56,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Build sherpa-onnx
uses: addnab/docker-run-action@v3
with:
... ...
... ... @@ -28,6 +28,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- uses: actions/setup-java@v4
with:
distribution: 'temurin' # See 'Supported distributions' for available options
... ...
... ... @@ -27,6 +27,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- uses: actions/setup-java@v4
with:
distribution: 'temurin' # See 'Supported distributions' for available options
... ...
... ... @@ -74,6 +74,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Display PWD
shell: bash
run: |
... ...
... ... @@ -28,6 +28,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- uses: actions/setup-java@v4
with:
distribution: 'temurin' # See 'Supported distributions' for available options
... ...
... ... @@ -71,6 +71,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
... ...
... ... @@ -43,6 +43,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Display MSBuild info
shell: cmd
run: |
... ...
... ... @@ -27,6 +27,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
... ...
... ... @@ -27,6 +27,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
... ...
... ... @@ -32,6 +32,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
... ...
... ... @@ -28,6 +28,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
... ...
... ... @@ -28,6 +28,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
... ...
... ... @@ -28,6 +28,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
... ...
... ... @@ -28,6 +28,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
... ...
... ... @@ -28,6 +28,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
... ... @@ -144,6 +150,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- uses: actions/setup-node@v4
with:
registry-url: 'https://registry.npmjs.org'
... ...
... ... @@ -28,6 +28,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
... ...
... ... @@ -28,6 +28,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Install emsdk
uses: mymindstorm/setup-emsdk@v14
with:
... ...
... ... @@ -44,6 +44,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
... ...
... ... @@ -46,6 +46,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
... ...
... ... @@ -24,6 +24,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Fix version
shell: bash
run: |
... ... @@ -121,6 +127,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
... ... @@ -223,6 +235,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Fix version
shell: bash
run: |
... ... @@ -307,6 +325,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
... ... @@ -438,6 +462,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
... ... @@ -517,6 +547,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Setup Flutter SDK
uses: flutter-actions/setup-flutter@v3
with:
... ...
... ... @@ -15,6 +15,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Add SSH key
run: |
mkdir -p ~/.ssh/
... ...
... ... @@ -45,6 +45,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
... ...
... ... @@ -49,6 +49,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
... ...
... ... @@ -43,6 +43,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
... ... @@ -105,6 +111,12 @@ jobs:
make -j4
ls -lh lib
- name: Run java version test
shell: bash
run: |
cd ./java-api-examples
./run-version-test.sh
- name: Run java test (Non-streaming SenseVoice with homophone replacer)
shell: bash
run: |
... ...
... ... @@ -60,6 +60,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Display OS version
shell: bash
run: |
... ...
... ... @@ -55,6 +55,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Display OS version
shell: bash
run: |
... ...
... ... @@ -30,6 +30,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
... ...
... ... @@ -25,6 +25,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
... ...
... ... @@ -46,6 +46,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
... ...
... ... @@ -80,6 +80,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
... ...
... ... @@ -30,6 +30,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Setup Flutter SDK
uses: flutter-actions/setup-flutter@v3
with:
... ...
... ... @@ -39,6 +39,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
... ...
... ... @@ -32,6 +32,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Free space
if: matrix.os == 'ubuntu-latest'
shell: bash
... ...
... ... @@ -45,6 +45,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
... ... @@ -138,6 +144,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
... ...
... ... @@ -45,6 +45,12 @@ jobs:
with:
go-version: '>=1.17'
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Display go version
shell: bash
run: |
... ...
... ... @@ -40,6 +40,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
... ...
... ... @@ -46,6 +46,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
... ...
... ... @@ -47,6 +47,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
... ...
... ... @@ -50,6 +50,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- uses: actions/setup-node@v4
with:
registry-url: 'https://registry.npmjs.org'
... ...
... ... @@ -48,6 +48,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- uses: actions/setup-node@v4
with:
registry-url: 'https://registry.npmjs.org'
... ...
... ... @@ -33,6 +33,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
... ...
... ... @@ -46,6 +46,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
... ...
... ... @@ -81,6 +81,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
... ...
... ... @@ -41,6 +41,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
... ...
... ... @@ -42,6 +42,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
... ...
... ... @@ -42,6 +42,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
... ...
... ... @@ -26,6 +26,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Install emsdk
uses: mymindstorm/setup-emsdk@v14
with:
... ...
... ... @@ -25,6 +25,13 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Install emsdk
uses: mymindstorm/setup-emsdk@v14
with:
... ...
... ... @@ -26,6 +26,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Install emsdk
uses: mymindstorm/setup-emsdk@v14
with:
... ...
... ... @@ -26,6 +26,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Install emsdk
uses: mymindstorm/setup-emsdk@v14
with:
... ...
... ... @@ -27,6 +27,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Install emsdk
uses: mymindstorm/setup-emsdk@v14
with:
... ...
... ... @@ -27,6 +27,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Install emsdk
uses: mymindstorm/setup-emsdk@v14
with:
... ...
... ... @@ -29,6 +29,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Install Python dependencies
shell: bash
run: |
... ...
... ... @@ -26,6 +26,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Install emsdk
uses: mymindstorm/setup-emsdk@v14
with:
... ...
... ... @@ -26,6 +26,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Install emsdk
uses: mymindstorm/setup-emsdk@v14
with:
... ...
... ... @@ -26,6 +26,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Install emsdk
uses: mymindstorm/setup-emsdk@v14
with:
... ...
... ... @@ -40,6 +40,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Configure CMake
shell: bash
run: |
... ...
... ... @@ -50,6 +50,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Configure CMake
shell: bash
run: |
... ...
... ... @@ -52,6 +52,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Configure CMake
shell: bash
run: |
... ...
... ... @@ -27,6 +27,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- uses: actions/setup-java@v4
with:
distribution: 'temurin' # See 'Supported distributions' for available options
... ...
... ... @@ -64,6 +64,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Configure CMake
shell: bash
run: |
... ...
... ... @@ -52,6 +52,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Configure CMake
shell: bash
run: |
... ...
... ... @@ -64,6 +64,12 @@ jobs:
with:
fetch-depth: 0
- name: Update version
shell: bash
run: |
./new-release.sh
git diff .
- name: Configure CMake
shell: bash
run: |
... ...
../../../../../../../../../../sherpa-onnx/kotlin-api/VersionInfo.kt
\ No newline at end of file
... ...
... ... @@ -68,6 +68,7 @@ def get_binaries():
"sherpa-onnx-vad-microphone",
"sherpa-onnx-vad-microphone-offline-asr",
"sherpa-onnx-vad-with-offline-asr",
"sherpa-onnx-version",
]
if enable_alsa():
... ...
... ... @@ -9,6 +9,10 @@ import './init.dart';
void main(List<String> arguments) async {
await initSherpaOnnx();
print('sherpa-onnx version: ${sherpa_onnx.getVersion()}');
print('sherpa-onnx gitSha1: ${sherpa_onnx.getGitSha1()}');
print('sherpa-onnx gitDate: ${sherpa_onnx.getGitDate()}');
final parser = ArgParser()
..addOption('model', help: 'Path to the SenseVoice model')
..addOption('tokens', help: 'Path to tokens.txt')
... ...
... ... @@ -37,6 +37,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "kokoro-tts-play", "kokoro-t
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "speech-enhancement-gtcrn", "speech-enhancement-gtcrn\speech-enhancement-gtcrn.csproj", "{DF2569C6-6011-4716-9538-F9E9069E00EB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "version-test", "version-test\version-test.csproj", "{E57711E5-6546-4BA0-B627-79C94F415BC5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
... ... @@ -111,6 +113,10 @@ Global
{DF2569C6-6011-4716-9538-F9E9069E00EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DF2569C6-6011-4716-9538-F9E9069E00EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DF2569C6-6011-4716-9538-F9E9069E00EB}.Release|Any CPU.Build.0 = Release|Any CPU
{E57711E5-6546-4BA0-B627-79C94F415BC5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E57711E5-6546-4BA0-B627-79C94F415BC5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E57711E5-6546-4BA0-B627-79C94F415BC5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E57711E5-6546-4BA0-B627-79C94F415BC5}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
... ...
// Copyright (c) 2025 Xiaomi Corporation
using SherpaOnnx;
class VersionTestDemo
{
static void Main(string[] args)
{
var version = VersionInfo.Version;
var gitSha1 = VersionInfo.GitSha1;
var gitDate = VersionInfo.GitDate;
Console.WriteLine("sherpa-onnx version: {0}", version);
Console.WriteLine("sherpa-onnx gitSha1: {0}", gitSha1);
Console.WriteLine("sherpa-onnx gitDate: {0}", gitDate);
}
}
... ...
#!/usr/bin/env bash
set -ex
dotnet run
... ...
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>version_test</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Common\Common.csproj" />
</ItemGroup>
</Project>
... ...
... ... @@ -17,6 +17,7 @@ export 'src/online_stream.dart';
export 'src/speaker_identification.dart';
export 'src/tts.dart';
export 'src/vad.dart';
export 'src/version.dart';
export 'src/wave_reader.dart';
export 'src/wave_writer.dart';
... ...
... ... @@ -1250,6 +1250,15 @@ typedef SherpaOnnxFreeWaveNative = Void Function(Pointer<SherpaOnnxWave>);
typedef SherpaOnnxFreeWave = void Function(Pointer<SherpaOnnxWave>);
typedef SherpaOnnxGetVersionStr = Pointer<Utf8> Function();
typedef SherpaOnnxGetVersionStrNative = SherpaOnnxGetVersionStr;
typedef SherpaOnnxGetGitSha1Native = Pointer<Utf8> Function();
typedef SherpaOnnxGetGitSha1 = SherpaOnnxGetGitSha1Native;
typedef SherpaOnnxGetGitDateNative = Pointer<Utf8> Function();
typedef SherpaOnnxGetGitDate = SherpaOnnxGetGitDateNative;
class SherpaOnnxBindings {
static SherpaOnnxCreateOfflineSpeechDenoiser?
sherpaOnnxCreateOfflineSpeechDenoiser;
... ... @@ -1459,6 +1468,10 @@ class SherpaOnnxBindings {
static SherpaOnnxFreeWave? freeWave;
static SherpaOnnxGetVersionStr? getVersionStr;
static SherpaOnnxGetGitSha1? getGitSha1;
static SherpaOnnxGetGitDate? getGitDate;
static void init(DynamicLibrary dynamicLibrary) {
sherpaOnnxCreateOfflineSpeechDenoiser ??= dynamicLibrary
.lookup<NativeFunction<SherpaOnnxCreateOfflineSpeechDenoiserNative>>(
... ... @@ -2050,5 +2063,20 @@ class SherpaOnnxBindings {
freeWave ??= dynamicLibrary
.lookup<NativeFunction<SherpaOnnxFreeWaveNative>>('SherpaOnnxFreeWave')
.asFunction();
getVersionStr ??= dynamicLibrary
.lookup<NativeFunction<SherpaOnnxGetVersionStrNative>>(
'SherpaOnnxGetVersionStr')
.asFunction();
getGitSha1 ??= dynamicLibrary
.lookup<NativeFunction<SherpaOnnxGetGitSha1Native>>(
'SherpaOnnxGetGitSha1')
.asFunction();
getGitDate ??= dynamicLibrary
.lookup<NativeFunction<SherpaOnnxGetGitDateNative>>(
'SherpaOnnxGetGitDate')
.asFunction();
}
}
... ...
// Copyright (c) 2025 Xiaomi Corporation
import 'dart:ffi';
import 'package:ffi/ffi.dart';
import './sherpa_onnx_bindings.dart';
String getVersion() {
Pointer<Utf8> version = SherpaOnnxBindings.getVersionStr?.call() ?? nullptr;
if (version == nullptr) {
return '';
}
return version.toDartString();
}
String getGitSha1() {
Pointer<Utf8> gitSha1 = SherpaOnnxBindings.getGitSha1?.call() ?? nullptr;
if (gitSha1 == nullptr) {
return '';
}
return gitSha1.toDartString();
}
String getGitDate() {
Pointer<Utf8> gitDate = SherpaOnnxBindings.getGitDate?.call() ?? nullptr;
if (gitDate == nullptr) {
return '';
}
return gitDate.toDartString();
}
... ...
... ... @@ -12,6 +12,10 @@ import (
)
func main() {
log.Printf("sherpa-onnx version: %v\n", sherpa.GetVersion())
log.Printf("sherpa-onnx gitSha1: %v\n", sherpa.GetGitSha1())
log.Printf("sherpa-onnx gitDate: %v\n", sherpa.GetGitDate())
log.SetFlags(log.LstdFlags | log.Lmicroseconds)
config := sherpa.OnlineRecognizerConfig{}
... ...
... ... @@ -53,6 +53,7 @@ add_library(sherpa_onnx SHARED
streaming-asr.cc
utils.cc
vad.cc
version.cc
wave-reader.cc
wave-writer.cc
)
... ...
... ... @@ -29,6 +29,8 @@ void InitNonStreamingSpeakerDiarization(Napi::Env env, Napi::Object exports);
void InitNonStreamingSpeechDenoiser(Napi::Env env, Napi::Object exports);
void InitVersion(Napi::Env env, Napi::Object exports);
#if __OHOS__
void InitUtils(Napi::Env env, Napi::Object exports);
#endif
... ... @@ -47,6 +49,7 @@ Napi::Object Init(Napi::Env env, Napi::Object exports) {
InitKeywordSpotting(env, exports);
InitNonStreamingSpeakerDiarization(env, exports);
InitNonStreamingSpeechDenoiser(env, exports);
InitVersion(env, exports);
#if __OHOS__
InitUtils(env, exports);
... ...
// scripts/node-addon-api/src/version.cc
//
// Copyright (c) 2025 Xiaomi Corporation
#include <sstream>
#include "napi.h" // NOLINT
#include "sherpa-onnx/c-api/c-api.h"
void InitVersion(Napi::Env env, Napi::Object exports) {
Napi::String version = Napi::String::New(env, SherpaOnnxGetVersionStr());
Napi::String git_sha1 = Napi::String::New(env, SherpaOnnxGetGitSha1());
Napi::String git_date = Napi::String::New(env, SherpaOnnxGetGitDate());
exports.Set(Napi::String::New(env, "version"), version);
exports.Set(Napi::String::New(env, "gitSha1"), git_sha1);
exports.Set(Napi::String::New(env, "gitDate"), git_date);
}
... ...
// Copyright 2025 Xiaomi Corporation
import com.k2fsa.sherpa.onnx.*;
public class VersionTest {
public static void main(String[] args) {
System.out.printf("sherpa-onnx version: %s\n", VersionInfo.getVersion());
System.out.printf("sherpa-onnx gitSha1: %s\n", VersionInfo.getGitSha1());
System.out.printf("sherpa-onnx gitDate: %s\n", VersionInfo.getGitDate());
}
}
... ...
#!/usr/bin/env bash
set -ex
if [[ ! -f ../build/lib/libsherpa-onnx-jni.dylib && ! -f ../build/lib/libsherpa-onnx-jni.so ]]; then
mkdir -p ../build
pushd ../build
cmake \
-DSHERPA_ONNX_ENABLE_PYTHON=OFF \
-DSHERPA_ONNX_ENABLE_TESTS=OFF \
-DSHERPA_ONNX_ENABLE_CHECK=OFF \
-DBUILD_SHARED_LIBS=ON \
-DSHERPA_ONNX_ENABLE_PORTAUDIO=OFF \
-DSHERPA_ONNX_ENABLE_JNI=ON \
..
make -j4
ls -lh lib
popd
fi
if [ ! -f ../sherpa-onnx/java-api/build/sherpa-onnx.jar ]; then
pushd ../sherpa-onnx/java-api
make
popd
fi
java \
-Djava.library.path=$PWD/../build/lib \
-cp ../sherpa-onnx/java-api/build/sherpa-onnx.jar \
./VersionTest.java
... ...
../sherpa-onnx/kotlin-api/VersionInfo.kt
\ No newline at end of file
... ...
... ... @@ -25,6 +25,18 @@ if [[ ! -f ../build/lib/libsherpa-onnx-jni.dylib && ! -f ../build/lib/libsherpa
fi
export LD_LIBRARY_PATH=$PWD/build/lib:$LD_LIBRARY_PATH
echo $LD_LIBRARY_PATH
function testVersion() {
out_filename=test_version.jar
kotlinc-jvm -include-runtime -d $out_filename \
test_version.kt \
VersionInfo.kt
ls -lh $out_filename
java -Djava.library.path=../build/lib -jar $out_filename
}
function testSpeakerEmbeddingExtractor() {
if [ ! -f ./3dspeaker_speech_eres2net_large_sv_zh-cn_3dspeaker_16k.onnx ]; then
... ... @@ -436,6 +448,7 @@ function testOfflineSenseVoiceWithHr() {
ls -lh $out_filename
java -Djava.library.path=../build/lib -jar $out_filename
}
testVersion
testOfflineSenseVoiceWithHr
testOfflineSpeechDenoiser
... ...
package com.k2fsa.sherpa.onnx
fun main() {
println("sherpa-onnx version: ${VersionInfo.version}");
println("sherpa-onnx gitSha1: ${VersionInfo.gitSha1}");
println("sherpa-onnx gitDate: ${VersionInfo.gitDate}");
}
... ...
... ... @@ -2,6 +2,13 @@
set -ex
sed -i.bak 's/1\.12\.0/1\.12\.1/g' ./sherpa-onnx/csrc/version.cc
sha1=$(git describe --match=NeVeRmAtCh --always --abbrev=8)
date=$(git log -1 --format=%ad --date=local)
sed -i.bak "s/ static const char \*sha1.*/ static const char \*sha1 = \"$sha1\";/g" ./sherpa-onnx/csrc/version.cc
sed -i.bak "s/ static const char \*date.*/ static const char \*date = \"$date\";/g" ./sherpa-onnx/csrc/version.cc
sed -i.bak 's/1\.12\.0/1\.12\.1/g' ./build-ios-shared.sh
sed -i.bak 's/1\.12\.0/1\.12\.1/g' ./pom.xml
sed -i.bak 's/1\.12\.0/1\.12\.1/g' ./jitpack.yml
... ...
// Copyright (c) 2024 Xiaomi Corporation
const sherpa_onnx = require('sherpa-onnx-node');
console.log(`verison : ${sherpa_onnx.version}`);
console.log(`git sha1: ${sherpa_onnx.gitSha1}`);
console.log(`git date: ${sherpa_onnx.gitDate}`);
// Please download test files from
// https://github.com/k2-fsa/sherpa-onnx/releases/tag/asr-models
... ...
// Copyright (c) 2023 Xiaomi Corporation (authors: Fangjun Kuang)
//
const sherpa_onnx = require('sherpa-onnx');
console.log(`verison : ${sherpa_onnx.version}`);
console.log(`git sha1: ${sherpa_onnx.gitSha1}`);
console.log(`git date: ${sherpa_onnx.gitDate}`);
function createOfflineRecognizer() {
let modelConfig = {
... ...
... ... @@ -8,3 +8,4 @@ paraformer_itn
sense_voice
telespeech_ctc
moonshine
dolphin_ctc
... ...
... ... @@ -62,6 +62,9 @@ begin
Duration := Length(Wave.Samples) / Wave.SampleRate;
RealTimeFactor := Elapsed / Duration;
WriteLn(Format('sherpa-onnx version: %s', [SherpaOnnxGetVersionStr()]));
WriteLn(Format('sherpa-onnx gitSha1: %s', [SherpaOnnxGetGitSha1()]));
WriteLn(Format('sherpa-onnx gitDate: %s', [SherpaOnnxGetGitDate()]));
WriteLn(RecognitionResult.ToString);
WriteLn(Format('NumThreads %d', [Config.ModelConfig.NumThreads]));
WriteLn(Format('Elapsed %.3f s', [Elapsed]));
... ...
/// Copyright (c) 2025 Xiaomi Corporation (authors: Fangjun Kuang)
using System;
using System.Runtime.InteropServices;
using System.Text;
namespace SherpaOnnx
{
public class VersionInfo
{
public static String Version
{
get
{
IntPtr p = SherpaOnnxGetVersionStr();
string s = "";
int length = 0;
unsafe
{
byte* b = (byte*)p;
if (b != null)
{
while (*b != 0)
{
++b;
length += 1;
}
}
}
if (length > 0)
{
byte[] stringBuffer = new byte[length];
Marshal.Copy(p, stringBuffer, 0, length);
s = Encoding.UTF8.GetString(stringBuffer);
}
return s;
}
}
public static String GitSha1
{
get
{
IntPtr p = SherpaOnnxGetGitSha1();
string s = "";
int length = 0;
unsafe
{
byte* b = (byte*)p;
if (b != null)
{
while (*b != 0)
{
++b;
length += 1;
}
}
}
if (length > 0)
{
byte[] stringBuffer = new byte[length];
Marshal.Copy(p, stringBuffer, 0, length);
s = Encoding.UTF8.GetString(stringBuffer);
}
return s;
}
}
public static String GitDate
{
get
{
IntPtr p = SherpaOnnxGetGitDate();
string s = "";
int length = 0;
unsafe
{
byte* b = (byte*)p;
if (b != null)
{
while (*b != 0)
{
++b;
length += 1;
}
}
}
if (length > 0)
{
byte[] stringBuffer = new byte[length];
Marshal.Copy(p, stringBuffer, 0, length);
s = Encoding.UTF8.GetString(stringBuffer);
}
return s;
}
}
[DllImport(Dll.Filename)]
private static extern IntPtr SherpaOnnxGetVersionStr();
[DllImport(Dll.Filename)]
private static extern IntPtr SherpaOnnxGetGitSha1();
[DllImport(Dll.Filename)]
private static extern IntPtr SherpaOnnxGetGitDate();
}
}
... ...
... ... @@ -2027,3 +2027,15 @@ func (audio *DenoisedAudio) Save(filename string) bool {
func (sd *OfflineSpeechDenoiser) SampleRate() int {
return int(C.SherpaOnnxOfflineSpeechDenoiserGetSampleRate(sd.impl))
}
func GetVersion() string {
return C.GoString(C.SherpaOnnxGetVersionStr())
}
func GetGitSha1() string {
return C.GoString(C.SherpaOnnxGetGitSha1())
}
func GetGitDate() string {
return C.GoString(C.SherpaOnnxGetGitDate())
}
... ...
... ... @@ -28,6 +28,7 @@ set(srcs
src/spoken-language-identification.cc
src/streaming-asr.cc
src/vad.cc
src/version.cc
src/wave-reader.cc
src/wave-writer.cc
)
... ...
... ... @@ -26,12 +26,14 @@ for (const p of possible_paths) {
}
if (!found) {
let addon_path = `${process.env.PWD}/node_modules/sherpa-onnx-${platform_arch}`;
let addon_path =
`${process.env.PWD}/node_modules/sherpa-onnx-${platform_arch}`;
const pnpmIndex = __dirname.indexOf(`node_modules${path.sep}.pnpm`);
if (pnpmIndex !== -1) {
const parts = __dirname.slice(pnpmIndex).split(path.sep);
parts.pop();
addon_path = `${process.env.PWD}/${parts.join('/')}/sherpa-onnx-${platform_arch}`;
addon_path =
`${process.env.PWD}/${parts.join('/')}/sherpa-onnx-${platform_arch}`;
}
let msg = `Could not find sherpa-onnx-node. Tried\n\n ${
... ...
... ... @@ -28,4 +28,7 @@ module.exports = {
KeywordSpotter: kws.KeywordSpotter,
OfflineSpeakerDiarization: sd.OfflineSpeakerDiarization,
OfflineSpeechDenoiser: speech_denoiser.OfflineSpeechDenoiser,
version: addon.version,
gitSha1: addon.gitSha1,
gitDate: addon.gitDate,
}
... ...
../../../harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/version.cc
\ No newline at end of file
... ...
... ... @@ -60,6 +60,21 @@ function createOfflineSpeechDenoiser(config) {
wasmModule, config);
}
function getVersion() {
const v = wasmModule._SherpaOnnxGetVersionStr();
return wasmModule.UTF8ToString(v);
}
function getGitSha1() {
const v = wasmModule._SherpaOnnxGetGitSha1();
return wasmModule.UTF8ToString(v);
}
function getGitDate() {
const v = wasmModule._SherpaOnnxGetGitDate();
return wasmModule.UTF8ToString(v);
}
// Note: online means streaming and offline means non-streaming here.
// Both of them don't require internet connection.
module.exports = {
... ... @@ -74,4 +89,7 @@ module.exports = {
createVad,
createOfflineSpeakerDiarization,
createOfflineSpeechDenoiser,
version: getVersion(),
gitSha1: getGitSha1(),
gitDate: getGitDate(),
};
... ...
... ... @@ -32,6 +32,7 @@
#include "sherpa-onnx/csrc/speaker-embedding-manager.h"
#include "sherpa-onnx/csrc/spoken-language-identification.h"
#include "sherpa-onnx/csrc/text-utils.h"
#include "sherpa-onnx/csrc/version.h"
#include "sherpa-onnx/csrc/voice-activity-detector.h"
#include "sherpa-onnx/csrc/wave-reader.h"
#include "sherpa-onnx/csrc/wave-writer.h"
... ... @@ -44,6 +45,10 @@
#include "sherpa-onnx/csrc/offline-speaker-diarization.h"
#endif
const char *SherpaOnnxGetVersionStr() { return sherpa_onnx::GetVersionStr(); }
const char *SherpaOnnxGetGitSha1() { return sherpa_onnx::GetGitSha1(); }
const char *SherpaOnnxGetGitDate() { return sherpa_onnx::GetGitDate(); }
struct SherpaOnnxOnlineRecognizer {
std::unique_ptr<sherpa_onnx::OnlineRecognizer> impl;
};
... ... @@ -1369,9 +1374,8 @@ int64_t SherpaOnnxWaveFileSize(int32_t n_samples) {
return sherpa_onnx::WaveFileSize(n_samples);
}
SHERPA_ONNX_API void SherpaOnnxWriteWaveToBuffer(const float *samples,
int32_t n, int32_t sample_rate,
char *buffer) {
void SherpaOnnxWriteWaveToBuffer(const float *samples, int32_t n,
int32_t sample_rate, char *buffer) {
sherpa_onnx::WriteWave(buffer, sample_rate, samples, n);
}
... ...
... ... @@ -47,6 +47,30 @@ extern "C" {
#define SHERPA_ONNX_API SHERPA_ONNX_IMPORT
#endif
// Please don't free the returned pointer.
// Please don't modify the memory pointed by the returned pointer.
//
// The memory pointed by the returned pointer is statically allocated.
//
// Example return value: "1.12.1"
SHERPA_ONNX_API const char *SherpaOnnxGetVersionStr();
// Please don't free the returned pointer.
// Please don't modify the memory pointed by the returned pointer.
//
// The memory pointed by the returned pointer is statically allocated.
//
// Example return value: "6982b86c"
SHERPA_ONNX_API const char *SherpaOnnxGetGitSha1();
// Please don't free the returned pointer.
// Please don't modify the memory pointed by the returned pointer.
//
// The memory pointed by the returned pointer is statically allocated.
//
// Example return value: "Fri Jun 20 11:22:52 2025"
SHERPA_ONNX_API const char *SherpaOnnxGetGitDate();
/// Please refer to
/// https://k2-fsa.github.io/sherpa/onnx/pretrained_models/index.html
/// to download pre-trained models. That is, you can find encoder-xxx.onnx
... ...
... ... @@ -717,4 +717,10 @@ int32_t LinearResampler::GetOutputSamplingRate() const {
return SherpaOnnxLinearResamplerResampleGetOutputSampleRate(p_);
}
std::string GetVersionStr() { return SherpaOnnxGetVersionStr(); }
std::string GetGitSha1() { return SherpaOnnxGetGitSha1(); }
std::string GetGitDate() { return SherpaOnnxGetGitDate(); }
} // namespace sherpa_onnx::cxx
... ...
... ... @@ -615,6 +615,10 @@ class SHERPA_ONNX_API LinearResampler
explicit LinearResampler(const SherpaOnnxLinearResampler *p);
};
std::string GetVersionStr();
std::string GetGitSha1();
std::string GetGitDate();
} // namespace sherpa_onnx::cxx
#endif // SHERPA_ONNX_C_API_CXX_API_H_
... ...
... ... @@ -129,6 +129,7 @@ set(sources
utils.cc
vad-model-config.cc
vad-model.cc
version.cc
voice-activity-detector.cc
wave-reader.cc
wave-writer.cc
... ... @@ -337,6 +338,7 @@ if(SHERPA_ONNX_ENABLE_BINARY)
add_executable(sherpa-onnx-offline-punctuation sherpa-onnx-offline-punctuation.cc)
add_executable(sherpa-onnx-offline-source-separation sherpa-onnx-offline-source-separation.cc)
add_executable(sherpa-onnx-online-punctuation sherpa-onnx-online-punctuation.cc)
add_executable(sherpa-onnx-version sherpa-onnx-version.cc version.cc)
add_executable(sherpa-onnx-vad sherpa-onnx-vad.cc)
if(SHERPA_ONNX_ENABLE_TTS)
... ... @@ -396,6 +398,7 @@ if(SHERPA_ONNX_ENABLE_BINARY)
install(
TARGETS
${main_exes}
sherpa-onnx-version
DESTINATION
bin
)
... ...
// sherpa-onnx/csrc/sherpa-onnx-version.cc
//
// Copyright (c) 2025 Xiaomi Corporation
#include <stdio.h>
#include <cstdint>
#include "sherpa-onnx/csrc/version.h"
int32_t main() {
printf("sherpa-onnx version : %s\n", sherpa_onnx::GetVersionStr());
printf("sherpa-onnx Git SHA1: %s\n", sherpa_onnx::GetGitSha1());
printf("sherpa-onnx Git date: %s\n", sherpa_onnx::GetGitDate());
return 0;
}
... ...
... ... @@ -312,7 +312,8 @@ static std::vector<std::string> MergeCharactersIntoWords(
while (i < n) {
const auto &w = words[i];
if (w.size() >= 3 || (w.size() == 2 && !IsSpecial(w)) ||
(w.size() == 1 && (IsPunct(w[0]) || std::isspace(static_cast<uint8_t>(w[0]))))) {
(w.size() == 1 &&
(IsPunct(w[0]) || std::isspace(static_cast<uint8_t>(w[0]))))) {
if (prev != -1) {
std::string t;
for (; prev < i; ++prev) {
... ...
// sherpa-onnx/csrc/version.h
//
// Copyright 2025 Xiaomi Corporation
#include "sherpa-onnx/csrc/version.h"
namespace sherpa_onnx {
const char *GetGitDate() {
static const char *date = "Fri Jun 20 11:22:52 2025";
return date;
}
const char *GetGitSha1() {
static const char *sha1 = "6982b86c";
return sha1;
}
const char *GetVersionStr() {
static const char *version = "1.12.1";
return version;
}
} // namespace sherpa_onnx
... ...
// sherpa-onnx/csrc/version.h
//
// Copyright 2025 Xiaomi Corporation
#ifndef SHERPA_ONNX_CSRC_VERSION_H_
#define SHERPA_ONNX_CSRC_VERSION_H_
namespace sherpa_onnx {
// Please don't free the returned pointer.
// Please don't modify the memory pointed by the returned pointer.
//
// The memory pointed by the returned pointer is statically allocated.
const char *GetVersionStr();
// Please don't free the returned pointer.
// Please don't modify the memory pointed by the returned pointer.
//
// The memory pointed by the returned pointer is statically allocated.
const char *GetGitSha1();
// Please don't free the returned pointer.
// Please don't modify the memory pointed by the returned pointer.
//
// The memory pointed by the returned pointer is statically allocated.
const char *GetGitDate();
} // namespace sherpa_onnx
#endif // SHERPA_ONNX_CSRC_VERSION_H_
... ...
... ... @@ -8,6 +8,7 @@ package_dir := com/k2fsa/sherpa/onnx
java_files := LibraryLoader.java
java_files += VersionInfo.java
java_files += WaveReader.java
java_files += WaveWriter.java
java_files += EndpointRule.java
... ...
package com.k2fsa.sherpa.onnx;
public class VersionInfo {
public static String getVersion() {
LibraryLoader.maybeLoad();
return getVersionStr2();
}
public static String getGitSha1() {
LibraryLoader.maybeLoad();
return getGitSha12();
}
public static String getGitDate() {
LibraryLoader.maybeLoad();
return getGitDate2();
}
private static native String getVersionStr2();
private static native String getGitSha12();
private static native String getGitDate2();
}
... ...
... ... @@ -24,6 +24,7 @@ set(sources
speaker-embedding-extractor.cc
speaker-embedding-manager.cc
spoken-language-identification.cc
version.cc
voice-activity-detector.cc
wave-reader.cc
wave-writer.cc
... ...
// sherpa-onnx/jni/version.cc
//
// Copyright (c) 2025 Xiaomi Corporation
#include "sherpa-onnx/csrc/version.h"
#include "sherpa-onnx/jni/common.h"
namespace sherpa_onnx {
SHERPA_ONNX_EXTERN_C
JNIEXPORT jstring JNICALL
Java_com_k2fsa_sherpa_onnx_VersionInfo_00024Companion_getVersionStr2(
JNIEnv *env, jclass /*cls*/) {
return env->NewStringUTF(GetVersionStr());
}
SHERPA_ONNX_EXTERN_C
JNIEXPORT jstring JNICALL
Java_com_k2fsa_sherpa_onnx_VersionInfo_00024Companion_getGitSha12(
JNIEnv *env, jclass /*cls*/) {
return env->NewStringUTF(GetGitSha1());
}
SHERPA_ONNX_EXTERN_C
JNIEXPORT jstring JNICALL
Java_com_k2fsa_sherpa_onnx_VersionInfo_00024Companion_getGitDate2(
JNIEnv *env, jclass /*cls*/) {
return env->NewStringUTF(GetGitDate());
}
SHERPA_ONNX_EXTERN_C
JNIEXPORT jstring JNICALL Java_com_k2fsa_sherpa_onnx_VersionInfo_getVersionStr2(
JNIEnv *env, jclass /*cls*/) {
return env->NewStringUTF(GetVersionStr());
}
SHERPA_ONNX_EXTERN_C
JNIEXPORT jstring JNICALL Java_com_k2fsa_sherpa_onnx_VersionInfo_getGitSha12(
JNIEnv *env, jclass /*cls*/) {
return env->NewStringUTF(GetGitSha1());
}
SHERPA_ONNX_EXTERN_C
JNIEXPORT jstring JNICALL Java_com_k2fsa_sherpa_onnx_VersionInfo_getGitDate2(
JNIEnv *env, jclass /*cls*/) {
return env->NewStringUTF(GetGitDate());
}
} // namespace sherpa_onnx
... ...
package com.k2fsa.sherpa.onnx
class VersionInfo {
companion object {
init {
System.loadLibrary("sherpa-onnx-jni")
}
val version: String
get() = getVersionStr2()
val gitSha1: String
get() = getGitSha12()
val gitDate: String
get() = getGitDate2()
external fun getVersionStr2(): String
external fun getGitSha12(): String
external fun getGitDate2(): String
}
}
... ...
... ... @@ -578,6 +578,10 @@ type
function SherpaOnnxWriteWave(Filename: AnsiString;
Samples: array of Single; SampleRate: Integer): Boolean;
function SherpaOnnxGetVersionStr(): AnsiString;
function SherpaOnnxGetGitSha1(): AnsiString;
function SherpaOnnxGetGitDate(): AnsiString;
implementation
uses
... ... @@ -951,6 +955,30 @@ function SherpaOnnxCreateLinearResampler(SampleRateInHz: cint32;
NumZeros: cint32): Pointer; cdecl;
external SherpaOnnxLibName;
function SherpaOnnxGetVersionStrWrapper(): PAnsiChar; cdecl;
external SherpaOnnxLibName name 'SherpaOnnxGetVersionStr';
function SherpaOnnxGetGitSha1Wrapper(): PAnsiChar; cdecl;
external SherpaOnnxLibName name 'SherpaOnnxGetGitSha1';
function SherpaOnnxGetGitDateWrapper(): PAnsiChar; cdecl;
external SherpaOnnxLibName name 'SherpaOnnxGetGitDate';
function SherpaOnnxGetVersionStr(): AnsiString;
begin
Result := SherpaOnnxGetVersionStrWrapper();
end;
function SherpaOnnxGetGitSha1(): AnsiString;
begin
Result := SherpaOnnxGetGitSha1Wrapper();
end;
function SherpaOnnxGetGitDate(): AnsiString;
begin
Result := SherpaOnnxGetGitDateWrapper();
end;
procedure SherpaOnnxDestroyLinearResampler(P: Pointer); cdecl;
external SherpaOnnxLibName;
... ...
... ... @@ -53,6 +53,7 @@ set(srcs
tensorrt-config.cc
vad-model-config.cc
vad-model.cc
version.cc
voice-activity-detector.cc
wave-writer.cc
)
... ...
... ... @@ -4,6 +4,7 @@
#include "sherpa-onnx/csrc/offline-source-separation.h"
#include <algorithm>
#include <string>
#include "sherpa-onnx/python/csrc/offline-source-separation-model-config.h"
... ...
// sherpa-onnx/python/csrc/offline-source-separation-config.h
// sherpa-onnx/python/csrc/offline-source-separation.h
//
// Copyright (c) 2025 Xiaomi Corporation
#ifndef SHERPA_ONNX_PYTHON_CSRC_OFFLINE_SOURCE_SEPARATION_CONFIG_H_
#define SHERPA_ONNX_PYTHON_CSRC_OFFLINE_SOURCE_SEPARATION_CONFIG_H_
#ifndef SHERPA_ONNX_PYTHON_CSRC_OFFLINE_SOURCE_SEPARATION_H_
#define SHERPA_ONNX_PYTHON_CSRC_OFFLINE_SOURCE_SEPARATION_H_
#include "sherpa-onnx/python/csrc/sherpa-onnx.h"
... ... @@ -13,4 +13,4 @@ void PybindOfflineSourceSeparation(py::module *m);
}
#endif // SHERPA_ONNX_PYTHON_CSRC_OFFLINE_SOURCE_SEPARATION_CONFIG_H_
#endif // SHERPA_ONNX_PYTHON_CSRC_OFFLINE_SOURCE_SEPARATION_H_
... ...
... ... @@ -31,6 +31,7 @@
#include "sherpa-onnx/python/csrc/spoken-language-identification.h"
#include "sherpa-onnx/python/csrc/vad-model-config.h"
#include "sherpa-onnx/python/csrc/vad-model.h"
#include "sherpa-onnx/python/csrc/version.h"
#include "sherpa-onnx/python/csrc/voice-activity-detector.h"
#include "sherpa-onnx/python/csrc/wave-writer.h"
... ... @@ -112,6 +113,7 @@ PYBIND11_MODULE(_sherpa_onnx, m) {
PybindAlsa(&m);
PybindOfflineSpeechDenoiser(&m);
PybindOfflineSourceSeparation(&m);
PybindVersion(&m);
}
} // namespace sherpa_onnx
... ...
// sherpa-onnx/python/csrc/version.cc
//
// Copyright (c) 2025 Xiaomi Corporation
#include "sherpa-onnx/python/csrc/version.h"
#include <string>
#include "sherpa-onnx/csrc/version.h"
namespace sherpa_onnx {
void PybindVersion(py::module *m) {
m->attr("version") = std::string(GetVersionStr());
m->attr("git_sha1") = std::string(GetGitSha1());
m->attr("git_date") = std::string(GetGitDate());
}
} // namespace sherpa_onnx
... ...
// sherpa-onnx/python/csrc/version.h
//
// Copyright (c) 2025 Xiaomi Corporation
#ifndef SHERPA_ONNX_PYTHON_CSRC_VERSION_H_
#define SHERPA_ONNX_PYTHON_CSRC_VERSION_H_
#include "sherpa-onnx/python/csrc/sherpa-onnx.h"
namespace sherpa_onnx {
void PybindVersion(py::module *m);
}
#endif // SHERPA_ONNX_PYTHON_CSRC_VERSION_H_
... ...
... ... @@ -49,6 +49,9 @@ from _sherpa_onnx import (
VadModel,
VadModelConfig,
VoiceActivityDetector,
git_date,
git_sha1,
version,
write_wave,
)
... ...
... ... @@ -1448,3 +1448,15 @@ class SherpaOnnxOfflineSpeechDenoiserWrapper {
return Int(SherpaOnnxOfflineSpeechDenoiserGetSampleRate(impl))
}
}
func getSherpaOnnxVersion() -> String {
return String(cString: SherpaOnnxGetVersionStr())
}
func getSherpaOnnxGitSha1() -> String {
return String(cString: SherpaOnnxGetGitSha1())
}
func getSherpaOnnxGitDate() -> String {
return String(cString: SherpaOnnxGetGitDate())
}
... ...
#!/usr/bin/env bash
set -ex
if [ ! -d ../build-swift-macos ]; then
echo "Please run ../build-swift-macos.sh first!"
exit 1
fi
if [ ! -e ./test-version ]; then
# Note: We use -lc++ to link against libc++ instead of libstdc++
swiftc \
-lc++ \
-I ../build-swift-macos/install/include \
-import-objc-header ./SherpaOnnx-Bridging-Header.h \
./test-version.swift ./SherpaOnnx.swift \
-L ../build-swift-macos/install/lib/ \
-l sherpa-onnx \
-l onnxruntime \
-o ./test-version
strip ./test-version
else
echo "./test-version exists - skip building"
fi
export DYLD_LIBRARY_PATH=$PWD/../build-swift-macos/install/lib:$DYLD_LIBRARY_PATH
./test-version
... ...
func run() {
let version = getSherpaOnnxVersion()
let gitSha1 = getSherpaOnnxGitSha1()
let gitDate = getSherpaOnnxGitDate()
print("sherpa-onnx version: \(version)")
print("sherpa-onnx gitSha1: \(gitSha1)")
print("sherpa-onnx gitDate: \(gitDate)")
}
@main
struct App {
static func main() {
run()
}
}
... ...
... ... @@ -94,6 +94,10 @@ set(exported_functions
SherpaOnnxDestroyOfflineSpeechDenoiser
SherpaOnnxOfflineSpeechDenoiserGetSampleRate
SherpaOnnxOfflineSpeechDenoiserRun
# version
SherpaOnnxGetGitDate
SherpaOnnxGetGitSha1
SherpaOnnxGetVersionStr
)
... ...