bootphon / phonemizer

Simple text to phones converter for multiple languages

Home Page:https://bootphon.github.io/phonemizer/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does not support espeak-ng on the backend.

smarter83 opened this issue · comments

Describe the bug
To use the phonemizer with espeak as described in the documentation, I installed espeak-ng.
However, when I run it from the command line, I get the following error.

$ echo "hello world" | phonemize -l en-us -b espeak
fatal error: espeak not installed on your system

When I run the code using python in vscode, I get the message "RuntimeError espeak not installed on your system".

$ phonemize --version
phonemizer-3.2.1
available backends: segments-2.2.1
uninstalled backends: espeak, espeak-mbrola, festival

When I look at the Command Line Examples in Phonemizer's documentation, it says that espeak-ng is supported when I type --version, but as shown above, only espeak is supported and espeak-ng does not appear.

Please let me know how I can fix the error and get Phonemizer running with espeak-ng.

Phonemizer version

$ phonemize --version
phonemizer-3.2.1
available backends: segments-2.2.1
uninstalled backends: espeak, espeak-mbrola, festival

System
Windows 10
Python 3.10.10 64-bit
espeak-ng-X64.msi version 1.51

To reproduce

from phonemizer.backend import EspeakBackend

en_backend = EspeakBackend(
    "en-us",
    preserve_punctuation=True,
    with_stress=True,
    language_switch="remove-flags",
    words_mismatch="ignore",
)
en_sentence = ["I love to eat pizza everyday"]
print(en_backend.phonemize(en_sentence, njobs=1, strip=True))
# An exception was thrown. RuntimeError espeak not installed on your system

Duplicate of #44.

Because your are on Windows, you may need to specify to path to libespeak-ng.dll in the PHONEMIZER_ESPEAK_LIBRARY environment variable. See #44 (comment).