-
-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Mac compatability. #9
Conversation
self.libc.open_memstream.restype = ctypes.POINTER(ctypes.c_char) | ||
self.lib_espeak = self._load_library("libespeak-ng.so", "libespeak-ng.so.1") | ||
#self.lib_espeak = self._load_library("libespeak-ng.so", "libespeak-ng.so.1") | ||
self.lib_espeak = self._load_library("libespeak.dylib", "libespeak.1.dylib") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What worked for me on MacOS was
import platform
[...]
self.lib_espeak = ctypes.cdll.LoadLibrary("libespeak-ng.{}".format("so.1" if platform.uname()[0] != "Darwin" else "dylib"))
Still need to test on linux, will do later today
This change allowed me to actually get voice working on MacOS somewhat, but I now run into the following error:
Invalid instruction 0000 for phoneme 'f?'
Invalid instruction 0000 for phoneme 'f?'
Invalid instruction 0000 for phoneme 'f?'
Invalid instruction 0000 for phoneme 'f?'
Invalid instruction 0000 for phoneme 'f?'
Invalid instruction 0000 for phoneme 'f?'
Invalid instruction 0000 for phoneme 'f?'
Invalid instruction 0000 for phoneme 'f?'
Invalid instruction 0000 for phoneme 'f?'
Invalid instruction 0000 for phoneme 'f?'
Invalid instruction 0000 for phoneme 'f?'
Invalid instruction 0000 for phoneme 'f?'
Invalid instruction 0000 for phoneme 'f?'
Invalid instruction 4801 for phoneme 'f?'
Invalid instruction 0007 for phoneme '�O�'
Invalid instruction 7878 for phoneme '�O�'
Invalid instruction 5a4b for phoneme '�O�'
Invalid instruction 0000 for phoneme '�O�'
Invalid instruction 0028 for phoneme '�O�'
Invalid instruction 0000 for phoneme '�O�'
Invalid instruction 0000 for phoneme '�O�'
Invalid instruction 0000 for phoneme '�O�'
Invalid instruction 0000 for phoneme '�O�'
Invalid instruction 0000 for phoneme '�O�'
Invalid instruction 00fa for phoneme '�O�'
Invalid instruction 000c for phoneme '�O�'
Invalid instruction 0003 for phoneme '�O�'
YMMV
Installing |
@@ -216,9 +218,11 @@ class Phonemizer: | |||
espeakVOICE = "en-us" | |||
|
|||
def __init__(self): | |||
self.libc = ctypes.cdll.LoadLibrary("libc.so.6") | |||
# self.libc = ctypes.cdll.LoadLibrary("libc.so.6") | |||
self.libc = ctypes.cdll.LoadLibrary("libc.dylib") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did self.libc = ctypes.cdll.LoadLibrary("libc.{}".format("so.6" if platform.uname()[0] != "Darwin" else "dylib"))
to support both
I've been doing some refactor locally, which I think could go into this PR. Instead of relying on manually compiled and installed libraries, my suggestion would be an init script that:
Optionally it could also prompt for installing the I'd also go for masking |
We now use the espeak-ng binary, as it resolves the segfault issues, so I am closing this, |
DRAFT:
Add Mac compatibility, I need to do some cleanup still, this is a rough implementation.