-
Notifications
You must be signed in to change notification settings - Fork 197
Description
Description:
I encountered an architecture compatibility issue when using Phonemizer with espeak-ng on a Mac with an Apple Silicon (ARM64) chip. The error message suggests that the espeak-ng library is not compatible with the architecture.
Error Message:
# filePath: /phonemizer/backend/espeak/api.py
espeak: CDLL = ctypes.cdll.LoadLibrary(str(library))
Error: tried: '/opt/homebrew/Cellar/espeak-ng/1.52.0/bin/espeak-ng' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/espeak-ng/1.52.0/bin/espeak-ng' (no such file), '/opt/homebrew/Cellar/espeak-ng/1.52.0/bin/espeak-ng' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))
Environment:
- Operating System: macOS 15.0.1 (24A348)
- Mac Chip: Apple Silicon (Apple M3 Pro)
- Python Version: Python 3.10.16
- Phonemizer Version: phonemizer-3.3.0
- espeak Version: /opt/homebrew/bin/espeak: Mach-O 64-bit executable arm64
- espeak-ng Version: /opt/homebrew/bin/espeak-ng: Mach-O 64-bit executable arm64
Steps to Reproduce:
- Install
espeak-ngusing Homebrew on Apple Silicon:brew install espeak-ng
- Install Phonemizer using pip:
pip install phonemizer
- Run a simple phonemization script in Python:
from phonemizer import phonemize result = phonemize("Hello world!", language='en-us') print(result)
Expected Behavior:
Phonemizer should correctly load the espeak-ng library and perform phonemization without architecture-related errors.
Actual Behavior:
The espeak-ng library fails to load due to incompatible architecture, requiring x86_64 but having arm64.
Additional Information:
The issue seems to stem from a mismatch in the architecture between espeak-ng and the expected binary format. Running Rosetta 2 for emulation may not be ideal for performance-critical applications.
Possible Workaround:
Any recommendations or workarounds for ensuring compatibility with Apple Silicon would be appreciated.