Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,6 @@ endif()
include(kaldi-native-fbank)
include(kaldi-decoder)
include(onnxruntime)
include(cppinyin)
include(simple-sentencepiece)
set(ONNXRUNTIME_DIR ${onnxruntime_SOURCE_DIR})
message(STATUS "ONNXRUNTIME_DIR: ${ONNXRUNTIME_DIR}")
Expand All @@ -398,6 +397,8 @@ if(SHERPA_ONNX_ENABLE_WEBSOCKET)
endif()

if(SHERPA_ONNX_ENABLE_TTS)
include(cppinyin)

include(espeak-ng-for-piper)
set(ESPEAK_NG_DIR ${espeak_ng_SOURCE_DIR})
message(STATUS "ESPEAK_NG_DIR: ${ESPEAK_NG_DIR}")
Expand Down
4 changes: 3 additions & 1 deletion build-ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ cmake --build build/os64 --target install
echo "Generate xcframework"

mkdir -p "build/simulator/lib"
for f in libkaldi-native-fbank-core.a libkissfft-float.a libsherpa-onnx-c-api.a libsherpa-onnx-core.a \
for f in libcppinyin_core.a libkaldi-native-fbank-core.a libkissfft-float.a libsherpa-onnx-c-api.a libsherpa-onnx-core.a \
libsherpa-onnx-fstfar.a libssentencepiece_core.a \
libsherpa-onnx-fst.a libsherpa-onnx-kaldifst-core.a libkaldi-decoder-core.a \
libucd.a libpiper_phonemize.a libespeak-ng.a; do
Expand All @@ -139,6 +139,7 @@ done
# Merge archive first, because the following xcodebuild create xcframework
# cannot accept multi archive with the same architecture.
libtool -static -o build/simulator/sherpa-onnx.a \
build/simulator/lib/libcppinyin_core.a \
build/simulator/lib/libkaldi-native-fbank-core.a \
build/simulator/lib/libkissfft-float.a \
build/simulator/lib/libsherpa-onnx-c-api.a \
Expand All @@ -153,6 +154,7 @@ libtool -static -o build/simulator/sherpa-onnx.a \
build/simulator/lib/libssentencepiece_core.a

libtool -static -o build/os64/sherpa-onnx.a \
build/os64/lib/libcppinyin_core.a \
build/os64/lib/libkaldi-native-fbank-core.a \
build/os64/lib/libkissfft-float.a \
build/os64/lib/libsherpa-onnx-c-api.a \
Expand Down
1 change: 1 addition & 0 deletions build-swift-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ make install
rm -fv ./install/include/cargs.h

libtool -static -o ./install/lib/libsherpa-onnx.a \
./install/lib/libcppinyin_core.a \
./install/lib/libsherpa-onnx-c-api.a \
./install/lib/libsherpa-onnx-core.a \
./install/lib/libkaldi-native-fbank-core.a \
Expand Down
2 changes: 1 addition & 1 deletion c-api-examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CUR_DIR :=$(shell pwd)
CFLAGS := -I ../ -I ../build/_deps/cargs-src/include/
LDFLAGS := -L ../build/lib
LDFLAGS += -L ../build/_deps/onnxruntime-src/lib
LDFLAGS += -lsherpa-onnx-c-api -lsherpa-onnx-core -lkaldi-decoder-core -lsherpa-onnx-kaldifst-core -lsherpa-onnx-fstfar -lsherpa-onnx-fst -lkaldi-native-fbank-core -lkissfft-float -lpiper_phonemize -lespeak-ng -lucd -lcargs -lonnxruntime
LDFLAGS += -lsherpa-onnx-c-api -lsherpa-onnx-core -lkaldi-decoder-core -lsherpa-onnx-kaldifst-core -lsherpa-onnx-fstfar -lsherpa-onnx-fst -lkaldi-native-fbank-core -lkissfft-float -lpiper_phonemize -lespeak-ng -lucd -lcargs -lonnxruntime -lcppinyin_core
LDFLAGS += -framework Foundation
LDFLAGS += -lc++
LDFLAGS += -Wl,-rpath,${CUR_DIR}/../build/lib
Expand Down
2 changes: 1 addition & 1 deletion cmake/sherpa-onnx-static.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ Cflags: -I"${includedir}"
# Note: -lcargs is required only for the following file
# https://github.com/k2-fsa/sherpa-onnx/blob/master/c-api-examples/decode-file-c-api.c
# We add it here so that users don't need to specify -lcargs when compiling decode-file-c-api.c
Libs: -L"${libdir}" -lsherpa-onnx-c-api -lsherpa-onnx-core -lkaldi-decoder-core -lsherpa-onnx-kaldifst-core -lsherpa-onnx-fstfar -lsherpa-onnx-fst -lkaldi-native-fbank-core -lkissfft-float -lpiper_phonemize -lespeak-ng -lucd -lonnxruntime -lssentencepiece_core -Wl,-rpath,${libdir} @SHERPA_ONNX_PKG_WITH_CARGS@ @SHERPA_ONNX_PKG_CONFIG_EXTRA_LIBS@
Libs: -L"${libdir}" -lsherpa-onnx-c-api -lsherpa-onnx-core -lkaldi-decoder-core -lsherpa-onnx-kaldifst-core -lsherpa-onnx-fstfar -lsherpa-onnx-fst -lkaldi-native-fbank-core -lkissfft-float -lpiper_phonemize -lespeak-ng -lucd -lonnxruntime -lssentencepiece_core -lcppinyin_core -Wl,-rpath,${libdir} @SHERPA_ONNX_PKG_WITH_CARGS@ @SHERPA_ONNX_PKG_CONFIG_EXTRA_LIBS@
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
sherpa-onnx-fst.lib;
kaldi-native-fbank-core.lib;
kissfft-float.lib;
cppinyin_core.lib;
onnxruntime.lib;
piper_phonemize.lib;
espeak-ng.lib;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
sherpa-onnx-fst.lib;
kaldi-native-fbank-core.lib;
kissfft-float.lib;
cppinyin_core.lib;
onnxruntime.lib;
piper_phonemize.lib;
espeak-ng.lib;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
sherpa-onnx-fst.lib;
kaldi-native-fbank-core.lib;
kissfft-float.lib;
cppinyin_core.lib;
onnxruntime.lib;
piper_phonemize.lib;
espeak-ng.lib;
Expand Down
8 changes: 4 additions & 4 deletions sherpa-onnx/c-api/cxx-api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -354,11 +354,11 @@ OfflineRecognizerResult OfflineRecognizer::GetResult(
ans.lang = r->lang ? r->lang : "";
ans.emotion = r->emotion ? r->emotion : "";
ans.event = r->event ? r->event : "";
}

if (r->durations) {
ans.durations.resize(r->count);
std::copy(r->durations, r->durations + r->count, ans.durations.data());
if (r->durations) {
ans.durations.resize(r->count);
std::copy(r->durations, r->durations + r->count, ans.durations.data());
}
}

SherpaOnnxDestroyOfflineRecognizerResult(r);
Expand Down
5 changes: 3 additions & 2 deletions sherpa-onnx/csrc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ if(ANDROID_NDK)
endif()

target_link_libraries(sherpa-onnx-core
cppinyin_core
kaldi-native-fbank-core
kaldi-decoder-core
ssentencepiece_core
Expand Down Expand Up @@ -311,7 +310,9 @@ endif()
target_link_libraries(sherpa-onnx-core fstfar fst)

if(SHERPA_ONNX_ENABLE_TTS)
target_link_libraries(sherpa-onnx-core piper_phonemize)
target_link_libraries(sherpa-onnx-core
cppinyin_core
piper_phonemize)
endif()
target_link_libraries(sherpa-onnx-core cppjieba)

Expand Down
1 change: 1 addition & 0 deletions sherpa-onnx/pascal-api/sherpa_onnx.pas
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,7 @@ implementation
{$linklib sherpa-onnx-kaldifst-core}
{$linklib sherpa-onnx-fstfar}
{$linklib sherpa-onnx-fst}
{$linklib cppinyin_core}
{$linklib kissfft-float}
{$linklib kaldi-native-fbank-core}
{$linklib piper_phonemize}
Expand Down
Loading