Add C API for offline TTS. (#373)

This commit is contained in:
Fangjun Kuang
2023-10-19 17:38:23 +08:00
committed by GitHub
parent 58ab7e77f2
commit ea7c45b60c
16 changed files with 562 additions and 24 deletions

View File

@@ -9,6 +9,7 @@ on:
- '*'
paths:
- '.github/workflows/pkg-config.yaml'
- '.github/scripts/test-offline-tts.sh'
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
@@ -19,6 +20,7 @@ on:
- master
paths:
- '.github/workflows/pkg-config.yaml'
- '.github/scripts/test-offline-tts.sh'
- 'CMakeLists.txt'
- 'cmake/**'
- 'sherpa-onnx/csrc/*'
@@ -92,9 +94,20 @@ jobs:
run: |
export PKG_CONFIG_PATH=$PWD/build/install:$PKG_CONFIG_PATH
cd c-api-examples
gcc -o decode-file-c-api $(pkg-config --cflags sherpa-onnx) ./decode-file-c-api.c $(pkg-config --libs sherpa-onnx)
./decode-file-c-api --help
gcc -o offline-tts-c-api $(pkg-config --cflags sherpa-onnx) ./offline-tts-c-api.c $(pkg-config --libs sherpa-onnx)
./offline-tts-c-api --help
- name: Test offline TTS C API
shell: bash
run: |
export PATH=$PWD/c-api-examples:$PATH
export EXE=offline-tts-c-api
.github/scripts/test-offline-tts.sh
- name: Test online transducer (C API)
shell: bash
run: |
@@ -102,3 +115,8 @@ jobs:
export EXE=decode-file-c-api
.github/scripts/test-online-transducer.sh
- uses: actions/upload-artifact@v3
with:
name: tts-generated-test-files
path: tts