Release v1.9.30 (#1016)
This commit is contained in:
@@ -6,7 +6,7 @@ on:
|
||||
branches:
|
||||
- master
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
paths:
|
||||
- '.github/workflows/aarch64-linux-gnu-shared.yaml'
|
||||
- 'CMakeLists.txt'
|
||||
|
||||
@@ -6,7 +6,7 @@ on:
|
||||
branches:
|
||||
- master
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
paths:
|
||||
- '.github/workflows/aarch64-linux-gnu-static.yaml'
|
||||
- 'CMakeLists.txt'
|
||||
|
||||
2
.github/workflows/android.yaml
vendored
2
.github/workflows/android.yaml
vendored
@@ -12,7 +12,7 @@ on:
|
||||
- 'sherpa-onnx/jni/*'
|
||||
- 'build-android*.sh'
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
2
.github/workflows/apk-asr-2pass.yaml
vendored
2
.github/workflows/apk-asr-2pass.yaml
vendored
@@ -3,7 +3,7 @@ name: apk-asr-2pass
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
|
||||
2
.github/workflows/apk-asr.yaml
vendored
2
.github/workflows/apk-asr.yaml
vendored
@@ -3,7 +3,7 @@ name: apk-asr
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ name: apk-audio-tagging-wearos
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
|
||||
2
.github/workflows/apk-audio-tagging.yaml
vendored
2
.github/workflows/apk-audio-tagging.yaml
vendored
@@ -3,7 +3,7 @@ name: apk-audio-tagging
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
|
||||
2
.github/workflows/apk-kws.yaml
vendored
2
.github/workflows/apk-kws.yaml
vendored
@@ -3,7 +3,7 @@ name: apk-kws
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ name: apk-speaker-identification
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ name: apk-slid
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
|
||||
2
.github/workflows/apk-tts-engine.yaml
vendored
2
.github/workflows/apk-tts-engine.yaml
vendored
@@ -3,7 +3,7 @@ name: apk-tts-engine
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
|
||||
2
.github/workflows/apk-tts.yaml
vendored
2
.github/workflows/apk-tts.yaml
vendored
@@ -3,7 +3,7 @@ name: apk-tts
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
|
||||
2
.github/workflows/apk-vad-asr.yaml
vendored
2
.github/workflows/apk-vad-asr.yaml
vendored
@@ -3,7 +3,7 @@ name: apk-vad-asr
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
|
||||
2
.github/workflows/apk-vad.yaml
vendored
2
.github/workflows/apk-vad.yaml
vendored
@@ -3,7 +3,7 @@ name: apk-vad
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
|
||||
2
.github/workflows/arm-linux-gnueabihf.yaml
vendored
2
.github/workflows/arm-linux-gnueabihf.yaml
vendored
@@ -13,7 +13,7 @@ on:
|
||||
- 'sherpa-onnx/c-api/*'
|
||||
- 'toolchains/arm-linux-gnueabihf.toolchain.cmake'
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
2
.github/workflows/build-wheels-aarch64.yaml
vendored
2
.github/workflows/build-wheels-aarch64.yaml
vendored
@@ -3,7 +3,7 @@ name: build-wheels-aarch64
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
|
||||
2
.github/workflows/build-wheels-armv7l.yaml
vendored
2
.github/workflows/build-wheels-armv7l.yaml
vendored
@@ -3,7 +3,7 @@ name: build-wheels-armv7l
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
|
||||
2
.github/workflows/build-wheels-linux.yaml
vendored
2
.github/workflows/build-wheels-linux.yaml
vendored
@@ -3,7 +3,7 @@ name: build-wheels-linux
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
|
||||
@@ -3,7 +3,7 @@ name: build-wheels-macos-arm64
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
|
||||
@@ -5,7 +5,7 @@ on:
|
||||
branches:
|
||||
- wheel
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
|
||||
@@ -5,7 +5,7 @@ on:
|
||||
branches:
|
||||
- wheel
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
|
||||
2
.github/workflows/build-wheels-win32.yaml
vendored
2
.github/workflows/build-wheels-win32.yaml
vendored
@@ -3,7 +3,7 @@ name: build-wheels-win32
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
|
||||
2
.github/workflows/build-wheels-win64.yaml
vendored
2
.github/workflows/build-wheels-win64.yaml
vendored
@@ -5,7 +5,7 @@ on:
|
||||
branches:
|
||||
- wheel
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
|
||||
2
.github/workflows/build-xcframework.yaml
vendored
2
.github/workflows/build-xcframework.yaml
vendored
@@ -12,7 +12,7 @@ on:
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
- 'sherpa-onnx/c-api/*'
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
2
.github/workflows/flutter-linux.yaml
vendored
2
.github/workflows/flutter-linux.yaml
vendored
@@ -5,7 +5,7 @@ on:
|
||||
branches:
|
||||
- flutter
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
paths:
|
||||
- '.github/workflows/flutter-linux.yaml'
|
||||
- 'CMakeLists.txt'
|
||||
|
||||
2
.github/workflows/flutter-macos.yaml
vendored
2
.github/workflows/flutter-macos.yaml
vendored
@@ -5,7 +5,7 @@ on:
|
||||
branches:
|
||||
- flutter
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
paths:
|
||||
- '.github/workflows/flutter-macos.yaml'
|
||||
- 'CMakeLists.txt'
|
||||
|
||||
2
.github/workflows/flutter-windows-x64.yaml
vendored
2
.github/workflows/flutter-windows-x64.yaml
vendored
@@ -5,7 +5,7 @@ on:
|
||||
branches:
|
||||
- flutter
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
paths:
|
||||
- '.github/workflows/flutter-windows-x64.yaml'
|
||||
- 'CMakeLists.txt'
|
||||
|
||||
2
.github/workflows/linux-gpu.yaml
vendored
2
.github/workflows/linux-gpu.yaml
vendored
@@ -5,7 +5,7 @@ on:
|
||||
branches:
|
||||
- master
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
paths:
|
||||
- '.github/workflows/linux-gpu.yaml'
|
||||
- '.github/scripts/test-online-transducer.sh'
|
||||
|
||||
2
.github/workflows/linux.yaml
vendored
2
.github/workflows/linux.yaml
vendored
@@ -5,7 +5,7 @@ on:
|
||||
branches:
|
||||
- master
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
paths:
|
||||
- '.github/workflows/linux.yaml'
|
||||
- '.github/scripts/test-kws.sh'
|
||||
|
||||
2
.github/workflows/macos.yaml
vendored
2
.github/workflows/macos.yaml
vendored
@@ -5,7 +5,7 @@ on:
|
||||
branches:
|
||||
- master
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
paths:
|
||||
- '.github/workflows/macos.yaml'
|
||||
- '.github/scripts/test-kws.sh'
|
||||
|
||||
2
.github/workflows/mfc.yaml
vendored
2
.github/workflows/mfc.yaml
vendored
@@ -5,7 +5,7 @@ on:
|
||||
branches:
|
||||
- master
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
paths:
|
||||
- '.github/workflows/mfc.yaml'
|
||||
- 'CMakeLists.txt'
|
||||
|
||||
2
.github/workflows/pkg-config.yaml
vendored
2
.github/workflows/pkg-config.yaml
vendored
@@ -6,7 +6,7 @@ on:
|
||||
- master
|
||||
- pkg-config
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
paths:
|
||||
- '.github/workflows/pkg-config.yaml'
|
||||
- '.github/scripts/test-offline-tts.sh'
|
||||
|
||||
2
.github/workflows/release-dart-package.yaml
vendored
2
.github/workflows/release-dart-package.yaml
vendored
@@ -5,7 +5,7 @@ on:
|
||||
branches:
|
||||
- ci-pub-dart
|
||||
tags:
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*' # tag-pattern on pub.dev: 'v{{version}}'
|
||||
- 'dart-v[0-9]+.[0-9]+.[0-9]+*' # tag-pattern on pub.dev: 'v{{version}}'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
|
||||
2
.github/workflows/riscv64-linux.yaml
vendored
2
.github/workflows/riscv64-linux.yaml
vendored
@@ -13,7 +13,7 @@ on:
|
||||
- 'toolchains/riscv64-linux-gnu.toolchain.cmake'
|
||||
- 'build-riscv64-linux-gnu.sh'
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
2
.github/workflows/windows-arm64.yaml
vendored
2
.github/workflows/windows-arm64.yaml
vendored
@@ -5,7 +5,7 @@ on:
|
||||
branches:
|
||||
- master
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
paths:
|
||||
- '.github/workflows/windows-arm64.yaml'
|
||||
- 'CMakeLists.txt'
|
||||
|
||||
2
.github/workflows/windows-x64-cuda.yaml
vendored
2
.github/workflows/windows-x64-cuda.yaml
vendored
@@ -5,7 +5,7 @@ on:
|
||||
branches:
|
||||
- master
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
paths:
|
||||
- '.github/workflows/windows-x64-cuda.yaml'
|
||||
- '.github/scripts/test-online-transducer.sh'
|
||||
|
||||
2
.github/workflows/windows-x64-debug.yaml
vendored
2
.github/workflows/windows-x64-debug.yaml
vendored
@@ -5,7 +5,7 @@ on:
|
||||
branches:
|
||||
- master
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
paths:
|
||||
- '.github/workflows/windows-x64-debug.yaml'
|
||||
- '.github/scripts/test-online-transducer.sh'
|
||||
|
||||
2
.github/workflows/windows-x64.yaml
vendored
2
.github/workflows/windows-x64.yaml
vendored
@@ -5,7 +5,7 @@ on:
|
||||
branches:
|
||||
- master
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
paths:
|
||||
- '.github/workflows/windows-x64.yaml'
|
||||
- '.github/scripts/test-online-transducer.sh'
|
||||
|
||||
2
.github/workflows/windows-x86-debug.yaml
vendored
2
.github/workflows/windows-x86-debug.yaml
vendored
@@ -5,7 +5,7 @@ on:
|
||||
branches:
|
||||
- master
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
paths:
|
||||
- '.github/workflows/windows-x86-debug.yaml'
|
||||
- '.github/scripts/test-online-transducer.sh'
|
||||
|
||||
2
.github/workflows/windows-x86.yaml
vendored
2
.github/workflows/windows-x86.yaml
vendored
@@ -5,7 +5,7 @@ on:
|
||||
branches:
|
||||
- master
|
||||
tags:
|
||||
- '*'
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
paths:
|
||||
- '.github/workflows/windows-x86.yaml'
|
||||
- '.github/scripts/test-online-transducer.sh'
|
||||
|
||||
@@ -7,7 +7,7 @@ project(sherpa-onnx)
|
||||
# Remember to update
|
||||
# ./nodejs-addon-examples
|
||||
# ./dart-api-examples/
|
||||
set(SHERPA_ONNX_VERSION "1.9.29")
|
||||
set(SHERPA_ONNX_VERSION "1.9.30")
|
||||
|
||||
# Disable warning about
|
||||
#
|
||||
|
||||
@@ -10,7 +10,7 @@ environment:
|
||||
|
||||
# Add regular dependencies here.
|
||||
dependencies:
|
||||
sherpa_onnx: ^1.9.29
|
||||
sherpa_onnx: ^1.9.30
|
||||
path: ^1.9.0
|
||||
args: ^2.5.0
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ environment:
|
||||
|
||||
# Add regular dependencies here.
|
||||
dependencies:
|
||||
sherpa_onnx: ^1.9.29
|
||||
sherpa_onnx: ^1.9.30
|
||||
path: ^1.9.0
|
||||
args: ^2.5.0
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ environment:
|
||||
|
||||
# Add regular dependencies here.
|
||||
dependencies:
|
||||
sherpa_onnx: ^1.9.29
|
||||
sherpa_onnx: ^1.9.30
|
||||
path: ^1.9.0
|
||||
args: ^2.5.0
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ environment:
|
||||
sdk: ^3.4.0
|
||||
|
||||
dependencies:
|
||||
sherpa_onnx: ^1.9.29
|
||||
sherpa_onnx: ^1.9.30
|
||||
path: ^1.9.0
|
||||
args: ^2.5.0
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"sherpa-onnx-node": "^1.9.29"
|
||||
"sherpa-onnx-node": "^1.9.30"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ HF_MIRROR=hf.co
|
||||
linux_wheel_filename=sherpa_onnx-${SHERPA_ONNX_VERSION}-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
|
||||
linux_wheel=$src_dir/$linux_wheel_filename
|
||||
|
||||
macos_wheel_filename=sherpa_onnx-${SHERPA_ONNX_VERSION}-cp39-cp39-macosx_10_14_universal2.whl
|
||||
macos_wheel_filename=sherpa_onnx-${SHERPA_ONNX_VERSION}-cp39-cp39-macosx_11_0_universal2.whl
|
||||
macos_wheel=$src_dir/$macos_wheel_filename
|
||||
|
||||
windows_x64_wheel_filename=sherpa_onnx-${SHERPA_ONNX_VERSION}-cp38-cp38-win_amd64.whl
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
## 1.9.30
|
||||
|
||||
* Add TTS
|
||||
|
||||
## 1.9.29
|
||||
|
||||
* Publish with CI
|
||||
|
||||
@@ -25,7 +25,7 @@ final DynamicLibrary _dylib = () {
|
||||
if (_path == null) {
|
||||
return DynamicLibrary.open('libsherpa-onnx-c-api.dylib');
|
||||
} else {
|
||||
return DynamicLibrary.open('${_path}/libsherpa-onnx-c-api.dylib');
|
||||
return DynamicLibrary.open('$_path/libsherpa-onnx-c-api.dylib');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ final DynamicLibrary _dylib = () {
|
||||
if (_path == null) {
|
||||
return DynamicLibrary.open('libsherpa-onnx-c-api.so');
|
||||
} else {
|
||||
return DynamicLibrary.open('${_path}/libsherpa-onnx-c-api.so');
|
||||
return DynamicLibrary.open('$_path/libsherpa-onnx-c-api.so');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ final DynamicLibrary _dylib = () {
|
||||
if (_path == null) {
|
||||
return DynamicLibrary.open('sherpa-onnx-c-api.dll');
|
||||
} else {
|
||||
return DynamicLibrary.open('${_path}\\sherpa-onnx-c-api.dll');
|
||||
return DynamicLibrary.open('$_path\\sherpa-onnx-c-api.dll');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ class OnlineStream {
|
||||
}
|
||||
|
||||
void inputFinished() {
|
||||
SherpaOnnxBindings.onlineStreamInputFinished?.call(this.ptr);
|
||||
SherpaOnnxBindings.onlineStreamInputFinished?.call(ptr);
|
||||
}
|
||||
|
||||
Pointer<SherpaOnnxOnlineStream> ptr;
|
||||
|
||||
@@ -71,7 +71,7 @@ class SpeakerEmbeddingExtractor {
|
||||
|
||||
bool isReady(OnlineStream stream) {
|
||||
final int ready = SherpaOnnxBindings.speakerEmbeddingExtractorIsReady
|
||||
?.call(this.ptr, stream.ptr) ??
|
||||
?.call(ptr, stream.ptr) ??
|
||||
0;
|
||||
return ready == 1;
|
||||
}
|
||||
@@ -79,15 +79,15 @@ class SpeakerEmbeddingExtractor {
|
||||
Float32List compute(OnlineStream stream) {
|
||||
final Pointer<Float> embedding = SherpaOnnxBindings
|
||||
.speakerEmbeddingExtractorComputeEmbedding
|
||||
?.call(this.ptr, stream.ptr) ??
|
||||
?.call(ptr, stream.ptr) ??
|
||||
nullptr;
|
||||
|
||||
if (embedding == nullptr) {
|
||||
return Float32List(0);
|
||||
}
|
||||
|
||||
final embeddingList = embedding.asTypedList(this.dim);
|
||||
final ans = Float32List(this.dim);
|
||||
final embeddingList = embedding.asTypedList(dim);
|
||||
final ans = Float32List(dim);
|
||||
ans.setAll(0, embeddingList);
|
||||
|
||||
SherpaOnnxBindings.speakerEmbeddingExtractorDestroyEmbedding
|
||||
@@ -111,13 +111,13 @@ class SpeakerEmbeddingManager {
|
||||
}
|
||||
|
||||
void free() {
|
||||
SherpaOnnxBindings.destroySpeakerEmbeddingManager?.call(this.ptr);
|
||||
this.ptr = nullptr;
|
||||
SherpaOnnxBindings.destroySpeakerEmbeddingManager?.call(ptr);
|
||||
ptr = nullptr;
|
||||
}
|
||||
|
||||
/// Return true if added successfully; return false otherwise
|
||||
bool add({required String name, required Float32List embedding}) {
|
||||
assert(embedding.length == this.dim, '${embedding.length} vs ${this.dim}');
|
||||
assert(embedding.length == dim, '${embedding.length} vs $dim');
|
||||
|
||||
final Pointer<Utf8> namePtr = name.toNativeUtf8();
|
||||
final int n = embedding.length;
|
||||
@@ -126,9 +126,9 @@ class SpeakerEmbeddingManager {
|
||||
final pList = p.asTypedList(n);
|
||||
pList.setAll(0, embedding);
|
||||
|
||||
final int ok = SherpaOnnxBindings.speakerEmbeddingManagerAdd
|
||||
?.call(this.ptr, namePtr, p) ??
|
||||
0;
|
||||
final int ok =
|
||||
SherpaOnnxBindings.speakerEmbeddingManagerAdd?.call(ptr, namePtr, p) ??
|
||||
0;
|
||||
|
||||
calloc.free(p);
|
||||
calloc.free(namePtr);
|
||||
@@ -141,19 +141,19 @@ class SpeakerEmbeddingManager {
|
||||
final Pointer<Utf8> namePtr = name.toNativeUtf8();
|
||||
final int n = embeddingList.length;
|
||||
|
||||
final Pointer<Float> p = calloc<Float>(n * this.dim);
|
||||
final pList = p.asTypedList(n * this.dim);
|
||||
final Pointer<Float> p = calloc<Float>(n * dim);
|
||||
final pList = p.asTypedList(n * dim);
|
||||
|
||||
int offset = 0;
|
||||
for (final e in embeddingList) {
|
||||
assert(e.length == this.dim, '${e.length} vs ${this.dim}');
|
||||
assert(e.length == dim, '${e.length} vs $dim');
|
||||
|
||||
pList.setAll(offset, e);
|
||||
offset += this.dim;
|
||||
offset += dim;
|
||||
}
|
||||
|
||||
final int ok = SherpaOnnxBindings.speakerEmbeddingManagerAddListFlattened
|
||||
?.call(this.ptr, namePtr, p, n) ??
|
||||
?.call(ptr, namePtr, p, n) ??
|
||||
0;
|
||||
|
||||
calloc.free(p);
|
||||
@@ -166,7 +166,7 @@ class SpeakerEmbeddingManager {
|
||||
final Pointer<Utf8> namePtr = name.toNativeUtf8();
|
||||
|
||||
final int found = SherpaOnnxBindings.speakerEmbeddingManagerContains
|
||||
?.call(this.ptr, namePtr) ??
|
||||
?.call(ptr, namePtr) ??
|
||||
0;
|
||||
|
||||
calloc.free(namePtr);
|
||||
@@ -177,9 +177,9 @@ class SpeakerEmbeddingManager {
|
||||
bool remove(String name) {
|
||||
final Pointer<Utf8> namePtr = name.toNativeUtf8();
|
||||
|
||||
final int ok = SherpaOnnxBindings.speakerEmbeddingManagerRemove
|
||||
?.call(this.ptr, namePtr) ??
|
||||
0;
|
||||
final int ok =
|
||||
SherpaOnnxBindings.speakerEmbeddingManagerRemove?.call(ptr, namePtr) ??
|
||||
0;
|
||||
|
||||
calloc.free(namePtr);
|
||||
|
||||
@@ -188,14 +188,14 @@ class SpeakerEmbeddingManager {
|
||||
|
||||
/// Return an empty string if no speaker is found
|
||||
String search({required Float32List embedding, required double threshold}) {
|
||||
assert(embedding.length == this.dim);
|
||||
assert(embedding.length == dim);
|
||||
|
||||
final Pointer<Float> p = calloc<Float>(this.dim);
|
||||
final pList = p.asTypedList(this.dim);
|
||||
final Pointer<Float> p = calloc<Float>(dim);
|
||||
final pList = p.asTypedList(dim);
|
||||
pList.setAll(0, embedding);
|
||||
|
||||
final Pointer<Utf8> name = SherpaOnnxBindings.speakerEmbeddingManagerSearch
|
||||
?.call(this.ptr, p, threshold) ??
|
||||
?.call(ptr, p, threshold) ??
|
||||
nullptr;
|
||||
|
||||
calloc.free(p);
|
||||
@@ -215,16 +215,16 @@ class SpeakerEmbeddingManager {
|
||||
{required String name,
|
||||
required Float32List embedding,
|
||||
required double threshold}) {
|
||||
assert(embedding.length == this.dim);
|
||||
assert(embedding.length == dim);
|
||||
|
||||
final Pointer<Utf8> namePtr = name.toNativeUtf8();
|
||||
|
||||
final Pointer<Float> p = calloc<Float>(this.dim);
|
||||
final pList = p.asTypedList(this.dim);
|
||||
final Pointer<Float> p = calloc<Float>(dim);
|
||||
final pList = p.asTypedList(dim);
|
||||
pList.setAll(0, embedding);
|
||||
|
||||
final int ok = SherpaOnnxBindings.speakerEmbeddingManagerVerify
|
||||
?.call(this.ptr, namePtr, p, threshold) ??
|
||||
?.call(ptr, namePtr, p, threshold) ??
|
||||
0;
|
||||
|
||||
calloc.free(p);
|
||||
@@ -234,19 +234,17 @@ class SpeakerEmbeddingManager {
|
||||
}
|
||||
|
||||
int get numSpeakers =>
|
||||
SherpaOnnxBindings.speakerEmbeddingManagerNumSpeakers?.call(this.ptr) ??
|
||||
0;
|
||||
SherpaOnnxBindings.speakerEmbeddingManagerNumSpeakers?.call(ptr) ?? 0;
|
||||
|
||||
List<String> get allSpeakerNames {
|
||||
int n = this.numSpeakers;
|
||||
int n = numSpeakers;
|
||||
if (n == 0) {
|
||||
return <String>[];
|
||||
}
|
||||
|
||||
final Pointer<Pointer<Utf8>> names = SherpaOnnxBindings
|
||||
.speakerEmbeddingManagerGetAllSpeakers
|
||||
?.call(this.ptr) ??
|
||||
nullptr;
|
||||
final Pointer<Pointer<Utf8>> names =
|
||||
SherpaOnnxBindings.speakerEmbeddingManagerGetAllSpeakers?.call(ptr) ??
|
||||
nullptr;
|
||||
|
||||
if (names == nullptr) {
|
||||
return <String>[];
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// Copyright (c) 2024 Xiaomi Corporation
|
||||
import 'dart:convert';
|
||||
import 'dart:ffi';
|
||||
import 'dart:typed_data';
|
||||
|
||||
@@ -184,11 +183,10 @@ class OfflineTts {
|
||||
return GeneratedAudio(samples: newSamples, sampleRate: sampleRate);
|
||||
}
|
||||
|
||||
int get sampleRate =>
|
||||
SherpaOnnxBindings.offlineTtsSampleRate?.call(this.ptr) ?? 0;
|
||||
int get sampleRate => SherpaOnnxBindings.offlineTtsSampleRate?.call(ptr) ?? 0;
|
||||
|
||||
int get numSpeakers =>
|
||||
SherpaOnnxBindings.offlineTtsNumSpeakers?.call(this.ptr) ?? 0;
|
||||
SherpaOnnxBindings.offlineTtsNumSpeakers?.call(ptr) ?? 0;
|
||||
|
||||
Pointer<SherpaOnnxOfflineTts> ptr;
|
||||
OfflineTtsConfig config;
|
||||
|
||||
@@ -76,14 +76,14 @@ class CircularBuffer {
|
||||
final pList = p.asTypedList(n);
|
||||
pList.setAll(0, data);
|
||||
|
||||
SherpaOnnxBindings.circularBufferPush?.call(this.ptr, p, n);
|
||||
SherpaOnnxBindings.circularBufferPush?.call(ptr, p, n);
|
||||
|
||||
calloc.free(p);
|
||||
}
|
||||
|
||||
Float32List get({required int startIndex, required int n}) {
|
||||
final Pointer<Float> p =
|
||||
SherpaOnnxBindings.circularBufferGet?.call(this.ptr, startIndex, n) ??
|
||||
SherpaOnnxBindings.circularBufferGet?.call(ptr, startIndex, n) ??
|
||||
nullptr;
|
||||
|
||||
if (p == nullptr) {
|
||||
@@ -99,11 +99,11 @@ class CircularBuffer {
|
||||
}
|
||||
|
||||
void pop(int n) {
|
||||
SherpaOnnxBindings.circularBufferPop?.call(this.ptr, n);
|
||||
SherpaOnnxBindings.circularBufferPop?.call(ptr, n);
|
||||
}
|
||||
|
||||
void reset() {
|
||||
SherpaOnnxBindings.circularBufferReset?.call(this.ptr);
|
||||
SherpaOnnxBindings.circularBufferReset?.call(ptr);
|
||||
}
|
||||
|
||||
int get size => SherpaOnnxBindings.circularBufferSize?.call(ptr) ?? 0;
|
||||
|
||||
Reference in New Issue
Block a user