You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the eSpeak python wrapper to translate some text into phonemes. I'm finding that many of the languages listed by backend.supported_languages() are not available. So while I can phonemize using en-us, both en and en-uk fail with the error message
Error: Python: Traceback (most recent call last):
File "D:\dev\github.com\blackears\parrotLipsync\lipsync_scratch.blend\espeak_test.py", line 11, in <module>
File "C:\Program Files\Blender Foundation\Blender 4.0\4.0\python\lib\site-packages\phonemizer\backend\espeak\espeak.py", line 49, in __init__
self._espeak.set_voice(language)
File "C:\Program Files\Blender Foundation\Blender 4.0\4.0\python\lib\site-packages\phonemizer\backend\espeak\wrapper.py", line 249, in set_voice
raise RuntimeError( # pragma: nocover
RuntimeError: failed to load voice "en"
Same with French. fr-fr works, but fr and fr-ca cause an error, even though both are listed in supported_languages(). I'd like to be able to create backends with common language codes, but I have no idea how to tell which ones are available. (My script must handle a variety of languages. so I can't just pick one that works and rely on it.)
This is a test script I've been using:
from phonemizer.backend import EspeakBackend
from phonemizer.punctuation import Punctuation
from phonemizer.separator import Separator
from phonemizer.backend.espeak.wrapper import EspeakWrapper
from phonemizer.backend.espeak.wrapper import EspeakWrapper
_ESPEAK_LIBRARY = 'C:\Program Files\eSpeak NG\libespeak-ng.dll'
EspeakWrapper.set_library(_ESPEAK_LIBRARY)
# initialize the espeak backend for English
backend = EspeakBackend('en')
#backend = EspeakBackend('en-us')
#backend = EspeakBackend('fr-fr')
sup_lang = backend.supported_languages()
print(sup_lang)
# separate phones by a space and ignoring words boundaries
separator = Separator(phone=' ', word=None)
result = backend.phonemize(["alpha beta gamma delta"], separator=separator, strip=True)
print(result)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm using the eSpeak python wrapper to translate some text into phonemes. I'm finding that many of the languages listed by
backend.supported_languages()
are not available. So while I can phonemize usingen-us
, bothen
anden-uk
fail with the error messageSame with French.
fr-fr
works, butfr
andfr-ca
cause an error, even though both are listed insupported_languages()
. I'd like to be able to create backends with common language codes, but I have no idea how to tell which ones are available. (My script must handle a variety of languages. so I can't just pick one that works and rely on it.)This is a test script I've been using:
Beta Was this translation helpful? Give feedback.
All reactions