Set unique_speaker and user_data parameters to null in espeak_Synth
This commit is contained in:
parent
072ca8b0ed
commit
283ab65eef
5 changed files with 40 additions and 11 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -7,4 +7,6 @@ __pycache__/
|
||||||
/download/
|
/download/
|
||||||
/gruut/
|
/gruut/
|
||||||
*.onnx
|
*.onnx
|
||||||
.dockerignore
|
.dockerignore
|
||||||
|
.coverage
|
||||||
|
coverage.xml
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
1.0.0
|
1.0.1
|
||||||
|
|
|
||||||
|
|
@ -103,18 +103,16 @@ class Phonemizer:
|
||||||
|
|
||||||
self.lib_espeak.espeak_SetPhonemeTrace(phoneme_flags, phonemes_file)
|
self.lib_espeak.espeak_SetPhonemeTrace(phoneme_flags, phonemes_file)
|
||||||
|
|
||||||
identifier = ctypes.c_uint()
|
|
||||||
user_data = ctypes.c_void_p()
|
|
||||||
text_bytes = text.encode("utf-8")
|
text_bytes = text.encode("utf-8")
|
||||||
self.lib_espeak.espeak_Synth(
|
self.lib_espeak.espeak_Synth(
|
||||||
text_bytes,
|
text_bytes,
|
||||||
0, # buflength
|
0, # buflength (unused in AUDIO_OUTPUT_SYNCHRONOUS mode)
|
||||||
0, # position
|
0, # position
|
||||||
0, # position_type
|
0, # position_type
|
||||||
0, # end_position
|
0, # end_position (no end position)
|
||||||
Phonemizer.espeakCHARS_AUTO | Phonemizer.espeakPHONEMES,
|
Phonemizer.espeakCHARS_AUTO | Phonemizer.espeakPHONEMES,
|
||||||
identifier,
|
None, # unique_speaker,
|
||||||
user_data,
|
None, # user_data,
|
||||||
)
|
)
|
||||||
self.libc.fflush(phonemes_file)
|
self.libc.fflush(phonemes_file)
|
||||||
|
|
||||||
|
|
@ -162,7 +160,7 @@ class Phonemizer:
|
||||||
|
|
||||||
def _maybe_init(self):
|
def _maybe_init(self):
|
||||||
if self.libc and self.lib_espeak:
|
if self.libc and self.lib_espeak:
|
||||||
# Already initialize
|
# Already initialized
|
||||||
return
|
return
|
||||||
|
|
||||||
self.libc = ctypes.cdll.LoadLibrary("libc.so.6")
|
self.libc = ctypes.cdll.LoadLibrary("libc.so.6")
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
black==19.10b0
|
black==19.10b0
|
||||||
coverage==5.0.4
|
coverage==5.0.4
|
||||||
flake8==3.7.9
|
flake8==3.7.9
|
||||||
mypy==0.770
|
mypy==0.910
|
||||||
pylint==2.4.4
|
pylint==2.10.2
|
||||||
pytest==5.4.1
|
pytest==5.4.1
|
||||||
pytest-cov==2.8.1
|
pytest-cov==2.8.1
|
||||||
|
|
|
||||||
29
scripts/run-tests.sh
Executable file
29
scripts/run-tests.sh
Executable file
|
|
@ -0,0 +1,29 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e pipefail
|
||||||
|
|
||||||
|
# Directory of *this* script
|
||||||
|
this_dir="$( cd "$( dirname "$0" )" && pwd )"
|
||||||
|
src_dir="$(realpath "${this_dir}/..")"
|
||||||
|
|
||||||
|
if [[ "$1" == '--no-venv' ]]; then
|
||||||
|
no_venv='1'
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z "${no_venv}" ]]; then
|
||||||
|
venv="${src_dir}/.venv"
|
||||||
|
if [[ -d "${venv}" ]]; then
|
||||||
|
source "${venv}/bin/activate"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
export PYTHONPATH="${src_dir}"
|
||||||
|
|
||||||
|
coverage run "--source=${src_dir}/espeak_phonemizer" -m pytest
|
||||||
|
coverage report -m
|
||||||
|
coverage xml
|
||||||
|
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
echo "OK"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue