StyleTTS2 icon indicating copy to clipboard operation
StyleTTS2 copied to clipboard

RuntimeError: espeak not installed on your system

Open fontnet1 opened this issue 1 year ago • 8 comments


RuntimeError Traceback (most recent call last) Cell In[18], line 66 64 # load phonemizer 65 import phonemizer ---> 66 global_phonemizer = phonemizer.backend.EspeakBackend(language='en-us', preserve_punctuation=True, with_stress=True) 68 config = yaml.safe_load(open("Models/LibriTTS/config.yml")) 70 # load pretrained ASR model

File c:\Users\Abbasian\Desktop\ps VsCode\FONT4_Vnve\Lib\site-packages\phonemizer\backend\espeak\espeak.py:45, in EspeakBackend.init(self, language, punctuation_marks, preserve_punctuation, with_stress, tie, language_switch, words_mismatch, logger) 37 def init(self, language: str, 38 punctuation_marks: Optional[Union[str, Pattern]] = None, 39 preserve_punctuation: bool = False, (...) 43 words_mismatch: WordMismatch = 'ignore', 44 logger: Optional[Logger] = None): ---> 45 super().init( 46 language, punctuation_marks=punctuation_marks, 47 preserve_punctuation=preserve_punctuation, logger=logger) 49 self._espeak.set_voice(language) 50 self._with_stress = with_stress

File c:\Users\Abbasian\Desktop\ps VsCode\FONT4_Vnve\Lib\site-packages\phonemizer\backend\espeak\base.py:39, in BaseEspeakBackend.init(self, language, punctuation_marks, preserve_punctuation, logger) 35 def init(self, language: str, 36 punctuation_marks: Optional[Union[str, Pattern]] = None, 37 preserve_punctuation: bool = False, 38 logger: Optional[Logger] = None): ---> 39 super().init( 40 language, 41 punctuation_marks=punctuation_marks, 42 preserve_punctuation=preserve_punctuation, 43 logger=logger) 45 self._espeak = EspeakWrapper() 46 self.logger.debug('loaded %s', self._espeak.library_path)

File c:\Users\Abbasian\Desktop\ps VsCode\FONT4_Vnve\Lib\site-packages\phonemizer\backend\base.py:77, in BaseBackend.init(self, language, punctuation_marks, preserve_punctuation, logger) 75 # ensure the backend is installed on the system 76 if not self.is_available(): ---> 77 raise RuntimeError( # pragma: nocover 78 '{} not installed on your system'.format(self.name())) 80 self._logger = logger 81 self._logger.info( 82 'initializing backend %s-%s', 83 self.name(), '.'.join(str(v) for v in self.version()))

Screenshot (682) Screenshot (681)

fontnet1 avatar Dec 16 '24 20:12 fontnet1

image

fontnet1 avatar Dec 16 '24 20:12 fontnet1

image

fontnet1 avatar Dec 16 '24 20:12 fontnet1

Can this code also be used to teach Persian?

fontnet1 avatar Dec 16 '24 20:12 fontnet1

@fontnet1 Try to reinstall espeak and also when installed make sure you update phonemizer library to latest one with.

pip install --upgrade phonemizer

anurag12-webster avatar Dec 20 '24 15:12 anurag12-webster

ممنون

fontnet1 avatar Dec 20 '24 15:12 fontnet1

@anurag12-webster Where exactly should I install espeak-ng? I will tell you about the project through the virtual environment.

fontnet1 avatar Dec 22 '24 00:12 fontnet1

It doesn't matter where you install espeak-ng. You just have to set environmental variables properly in order to use it. For Linux I set those two:

import os

os.environ["PHONEMIZER_ESPEAK_LIBRARY"] = "/home/alsenderovich/lib/libespeak-ng.so"
os.environ["ESPEAK_DATA_PATH"] = "/home/alsenderovich/share/espeak-ng-data"

There are some discussions on github about this, you can find some advice for Windows users there: https://github.com/bootphon/phonemizer/issues/117, https://github.com/rhasspy/piper/issues/73, https://github.com/bootphon/phonemizer/issues/44

WhiteTeaDragon avatar Jan 06 '25 11:01 WhiteTeaDragon

I was having this issue, and decided to just use a cloud instance becase espeak works easier with linux, you may want to try WSL

jay2jp avatar Jan 14 '25 13:01 jay2jp