Support heteronyms in Chinese TTS (#738)
This commit is contained in:
@@ -78,6 +78,7 @@ def get_binaries():
|
||||
"piper_phonemize.dll",
|
||||
"sherpa-onnx-c-api.dll",
|
||||
"sherpa-onnx-core.dll",
|
||||
"sherpa-onnx-fstfar.lib",
|
||||
"sherpa-onnx-fst.lib",
|
||||
"sherpa-onnx-kaldifst-core.lib",
|
||||
"sherpa-onnx-portaudio.dll",
|
||||
|
||||
@@ -64,12 +64,22 @@ function(download_kaldi_decoder)
|
||||
kaldifst_core
|
||||
fst
|
||||
DESTINATION ..)
|
||||
if(SHERPA_ONNX_ENABLE_TTS)
|
||||
install(TARGETS
|
||||
fstfar
|
||||
DESTINATION ..)
|
||||
endif()
|
||||
else()
|
||||
install(TARGETS
|
||||
kaldi-decoder-core
|
||||
kaldifst_core
|
||||
fst
|
||||
DESTINATION lib)
|
||||
if(SHERPA_ONNX_ENABLE_TTS)
|
||||
install(TARGETS
|
||||
fstfar
|
||||
DESTINATION lib)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WIN32 AND BUILD_SHARED_LIBS)
|
||||
@@ -78,6 +88,11 @@ function(download_kaldi_decoder)
|
||||
kaldifst_core
|
||||
fst
|
||||
DESTINATION bin)
|
||||
if(SHERPA_ONNX_ENABLE_TTS)
|
||||
install(TARGETS
|
||||
fstfar
|
||||
DESTINATION bin)
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
@@ -50,13 +50,7 @@ function(download_kaldifst)
|
||||
${kaldifst_SOURCE_DIR}/
|
||||
)
|
||||
|
||||
target_include_directories(fst
|
||||
PUBLIC
|
||||
${openfst_SOURCE_DIR}/src/include
|
||||
)
|
||||
|
||||
set_target_properties(kaldifst_core PROPERTIES OUTPUT_NAME "sherpa-onnx-kaldifst-core")
|
||||
set_target_properties(fst PROPERTIES OUTPUT_NAME "sherpa-onnx-fst")
|
||||
endfunction()
|
||||
|
||||
download_kaldifst()
|
||||
|
||||
@@ -4,7 +4,7 @@ function(download_openfst)
|
||||
include(FetchContent)
|
||||
|
||||
set(openfst_URL "https://github.com/kkm000/openfst/archive/refs/tags/win/1.6.5.1.tar.gz")
|
||||
set(openfst_URL2 "https://huggingface.co/csukuangfj/kaldi-hmm-gmm-cmake-deps/resolve/main/openfst-win-1.6.5.1.tar.gz")
|
||||
set(openfst_URL2 "https://hub.nuaa.cf/kkm000/openfst/archive/refs/tags/win/1.6.5.1.tar.gz")
|
||||
set(openfst_HASH "SHA256=02c49b559c3976a536876063369efc0e41ab374be1035918036474343877046e")
|
||||
|
||||
# If you don't have access to the Internet,
|
||||
@@ -31,7 +31,7 @@ function(download_openfst)
|
||||
set(HAVE_COMPACT OFF CACHE BOOL "" FORCE)
|
||||
set(HAVE_COMPRESS OFF CACHE BOOL "" FORCE)
|
||||
set(HAVE_CONST OFF CACHE BOOL "" FORCE)
|
||||
set(HAVE_FAR OFF CACHE BOOL "" FORCE)
|
||||
set(HAVE_FAR ON CACHE BOOL "" FORCE)
|
||||
set(HAVE_GRM OFF CACHE BOOL "" FORCE)
|
||||
set(HAVE_PDT OFF CACHE BOOL "" FORCE)
|
||||
set(HAVE_MPDT OFF CACHE BOOL "" FORCE)
|
||||
@@ -70,20 +70,21 @@ function(download_openfst)
|
||||
add_subdirectory(${openfst_SOURCE_DIR} ${openfst_BINARY_DIR} EXCLUDE_FROM_ALL)
|
||||
set(openfst_SOURCE_DIR ${openfst_SOURCE_DIR} PARENT_SCOPE)
|
||||
|
||||
# Rename libfst.so.6 to libkaldifst_fst.so.6 to avoid potential conflicts
|
||||
# when kaldifst is installed.
|
||||
set_target_properties(fst PROPERTIES OUTPUT_NAME "kaldifst_fst")
|
||||
# Rename libfst.so.6 to libsherpa-onnx-fst.so.6 to avoid potential conflicts
|
||||
# when sherpa-onnx is installed.
|
||||
set_target_properties(fst PROPERTIES OUTPUT_NAME "sherpa-onnx-fst")
|
||||
set_target_properties(fstfar PROPERTIES OUTPUT_NAME "sherpa-onnx-fstfar")
|
||||
|
||||
install(TARGETS fst
|
||||
DESTINATION lib
|
||||
target_include_directories(fst
|
||||
PUBLIC
|
||||
${openfst_SOURCE_DIR}/src/include
|
||||
)
|
||||
|
||||
if(KALDIFST_BUILD_PYTHON)
|
||||
set_target_properties(fstscript PROPERTIES OUTPUT_NAME "kaldifst_fstscript")
|
||||
install(TARGETS fstscript
|
||||
DESTINATION lib
|
||||
)
|
||||
endif()
|
||||
target_include_directories(fstfar
|
||||
PUBLIC
|
||||
${openfst_SOURCE_DIR}/src/include
|
||||
)
|
||||
# installed in ./kaldi-decoder.cmake
|
||||
endfunction()
|
||||
|
||||
download_openfst()
|
||||
|
||||
@@ -13,4 +13,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-fst -lkaldi-native-fbank-core -lpiper_phonemize -lespeak-ng -lucd -lcargs -lonnxruntime -Wl,-rpath,${libdir} @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 -lpiper_phonemize -lespeak-ng -lucd -lcargs -lonnxruntime -Wl,-rpath,${libdir} @SHERPA_ONNX_PKG_CONFIG_EXTRA_LIBS@
|
||||
|
||||
Reference in New Issue
Block a user