-
Notifications
You must be signed in to change notification settings - Fork 445
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
87a47d7
commit db41778
Showing
17 changed files
with
424 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
name: test-piper-phonemize | ||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: test-piper-phonemize-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
|
||
jobs: | ||
test_piper_phonemize: | ||
name: ${{ matrix.os }} ${{ matrix.build_type }} ${{ matrix.shared_lib }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
build_type: [Release, Debug] | ||
shared_lib: [ON, OFF] | ||
exclude: | ||
- os: windows-latest | ||
build_type: Debug | ||
shared_lib: OFF | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: ccache | ||
uses: hendrikmuhs/[email protected] | ||
with: | ||
key: ${{ matrix.os }}-${{ matrix.build_type }}-shared-${{ matrix.shared_lib }} | ||
|
||
- name: Configure CMake | ||
shell: bash | ||
run: | | ||
export CMAKE_CXX_COMPILER_LAUNCHER=ccache | ||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | ||
cmake --version | ||
mkdir build | ||
cd build | ||
cmake -DCMAKE_VERBOSE_MAKEFILE=ON -D SHERPA_ONNX_ENABLE_TESTS=ON -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} -D BUILD_SHARED_LIBS=${{ matrix.shared_lib }} -DCMAKE_INSTALL_PREFIX=./install .. | ||
- name: Build | ||
shell: bash | ||
run: | | ||
export CMAKE_CXX_COMPILER_LAUNCHER=ccache | ||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | ||
cmake --version | ||
cd build | ||
cmake --build . --target install --config ${{ matrix.build_type }} | ||
- name: run test | ||
if: matrix.os != 'windows-latest' | ||
shell: bash | ||
run: | | ||
cd build | ||
ls -lh install/ | ||
ls -lh install/share | ||
ls -lh install/share/espeak-ng-data/ | ||
./bin/piper-phonemize-test | ||
- name: run test | ||
if: matrix.os == 'windows-latest' | ||
shell: bash | ||
run: | | ||
cd build | ||
ls -lh install/ | ||
ls -lh install/share | ||
ls -lh install/share/espeak-ng-data/ | ||
./bin/${{ matrix.build_type }}/piper-phonemize-test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
function(download_espeak_ng_for_piper) | ||
include(FetchContent) | ||
|
||
set(espeak_ng_URL "https://github.com/csukuangfj/espeak-ng/archive/c58d2a4a88e9a291ca448f046e15c6188cbd3b3a.zip") | ||
set(espeak_ng_URL2 "") | ||
set(espeak_ng_HASH "SHA256=8a48251e6926133dd91fcf6cb210c7c2e290a9b578d269446e2d32d710b0dfa0") | ||
|
||
set(USE_ASYNC OFF CACHE BOOL "" FORCE) | ||
set(USE_MBROLA OFF CACHE BOOL "" FORCE) | ||
set(USE_LIBSONIC OFF CACHE BOOL "" FORCE) | ||
set(USE_LIBPCAUDIO OFF CACHE BOOL "" FORCE) | ||
set(USE_KLATT OFF CACHE BOOL "" FORCE) | ||
set(USE_SPEECHPLAYER OFF CACHE BOOL "" FORCE) | ||
set(EXTRA_cmn ON CACHE BOOL "" FORCE) | ||
set(EXTRA_ru ON CACHE BOOL "" FORCE) | ||
|
||
# If you don't have access to the Internet, | ||
# please pre-download kaldi-decoder | ||
set(possible_file_locations | ||
$ENV{HOME}/Downloads/espeak-ng-c58d2a4a88e9a291ca448f046e15c6188cbd3b3a.zip | ||
${PROJECT_SOURCE_DIR}/espeak-ng-c58d2a4a88e9a291ca448f046e15c6188cbd3b3a.zip | ||
${PROJECT_BINARY_DIR}/espeak-ng-c58d2a4a88e9a291ca448f046e15c6188cbd3b3a.zip | ||
/tmp/espeak-ng-c58d2a4a88e9a291ca448f046e15c6188cbd3b3a.zip | ||
/star-fj/fangjun/download/github/espeak-ng-c58d2a4a88e9a291ca448f046e15c6188cbd3b3a.zip | ||
) | ||
|
||
foreach(f IN LISTS possible_file_locations) | ||
if(EXISTS ${f}) | ||
set(espeak_ng_URL "${f}") | ||
file(TO_CMAKE_PATH "${espeak_ng_URL}" espeak_ng_URL) | ||
message(STATUS "Found local downloaded espeak-ng: ${espeak_ng_URL}") | ||
set(espeak_ng_URL2 ) | ||
break() | ||
endif() | ||
endforeach() | ||
|
||
FetchContent_Declare(espeak_ng | ||
URL | ||
${espeak_ng_URL} | ||
${espeak_ng_URL2} | ||
URL_HASH ${espeak_ng_HASH} | ||
) | ||
|
||
FetchContent_GetProperties(espeak_ng) | ||
if(NOT espeak_ng_POPULATED) | ||
message(STATUS "Downloading espeak-ng from ${espeak_ng_URL}") | ||
FetchContent_Populate(espeak_ng) | ||
endif() | ||
message(STATUS "espeak-ng is downloaded to ${espeak_ng_SOURCE_DIR}") | ||
message(STATUS "espeak-ng binary dir is ${espeak_ng_BINARY_DIR}") | ||
|
||
add_subdirectory(${espeak_ng_SOURCE_DIR} ${espeak_ng_BINARY_DIR}) | ||
set(espeak_ng_SOURCE_DIR ${espeak_ng_SOURCE_DIR} PARENT_SCOPE) | ||
|
||
if(WIN32 AND MSVC) | ||
target_compile_options(ucd PUBLIC | ||
/wd4309 | ||
) | ||
|
||
target_compile_options(espeak-ng PUBLIC | ||
/wd4005 | ||
/wd4018 | ||
/wd4067 | ||
/wd4068 | ||
/wd4090 | ||
/wd4101 | ||
/wd4244 | ||
/wd4267 | ||
/wd4996 | ||
) | ||
|
||
if(TARGET espeak-ng-bin) | ||
target_compile_options(espeak-ng-bin PRIVATE | ||
/wd4244 | ||
/wd4024 | ||
/wd4047 | ||
/wd4067 | ||
/wd4267 | ||
/wd4996 | ||
) | ||
endif() | ||
endif() | ||
|
||
if(UNIX AND NOT APPLE) | ||
target_compile_options(espeak-ng PRIVATE | ||
-Wno-unused-result | ||
-Wno-format-overflow | ||
-Wno-format-truncation | ||
-Wno-maybe-uninitialized | ||
-Wno-format | ||
) | ||
|
||
if(TARGET espeak-ng-bin) | ||
target_compile_options(espeak-ng-bin PRIVATE | ||
-Wno-unused-result | ||
) | ||
endif() | ||
endif() | ||
|
||
target_include_directories(espeak-ng | ||
INTERFACE | ||
${espeak_ng_SOURCE_DIR}/src/include | ||
${espeak_ng_SOURCE_DIR}/src/ucd-tools/src/include | ||
) | ||
|
||
if(SHERPA_ONNX_ENABLE_PYTHON AND WIN32) | ||
install(TARGETS | ||
espeak-ng | ||
DESTINATION ..) | ||
else() | ||
install(TARGETS | ||
espeak-ng | ||
DESTINATION lib) | ||
endif() | ||
|
||
if(NOT BUILD_SHARED_LIBS) | ||
install(TARGETS ucd DESTINATION lib) | ||
endif() | ||
|
||
if(WIN32 AND BUILD_SHARED_LIBS) | ||
install(TARGETS | ||
espeak-ng | ||
DESTINATION bin) | ||
endif() | ||
endfunction() | ||
|
||
download_espeak_ng_for_piper() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.