Set unique_speaker and user_data parameters to null in espeak_Synth

This commit is contained in:
Michael Hansen 2021-10-11 15:46:41 -04:00
commit 283ab65eef
5 changed files with 40 additions and 11 deletions

4
.gitignore vendored
View file

@ -7,4 +7,6 @@ __pycache__/
/download/
/gruut/
*.onnx
.dockerignore
.dockerignore
.coverage
coverage.xml

View file

@ -1 +1 @@
1.0.0
1.0.1

View file

@ -103,18 +103,16 @@ class Phonemizer:
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")
self.lib_espeak.espeak_Synth(
text_bytes,
0, # buflength
0, # buflength (unused in AUDIO_OUTPUT_SYNCHRONOUS mode)
0, # position
0, # position_type
0, # end_position
0, # end_position (no end position)
Phonemizer.espeakCHARS_AUTO | Phonemizer.espeakPHONEMES,
identifier,
user_data,
None, # unique_speaker,
None, # user_data,
)
self.libc.fflush(phonemes_file)
@ -162,7 +160,7 @@ class Phonemizer:
def _maybe_init(self):
if self.libc and self.lib_espeak:
# Already initialize
# Already initialized
return
self.libc = ctypes.cdll.LoadLibrary("libc.so.6")

View file

@ -1,7 +1,7 @@
black==19.10b0
coverage==5.0.4
flake8==3.7.9
mypy==0.770
pylint==2.4.4
mypy==0.910
pylint==2.10.2
pytest==5.4.1
pytest-cov==2.8.1

29
scripts/run-tests.sh Executable file
View 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"