Skip to content

espeak-ng compatibility issue on M3 chip with Phonemizer #201

@kqkqgithub

Description

@kqkqgithub

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:

  1. Install espeak-ng using Homebrew on Apple Silicon:
    brew install espeak-ng
  2. Install Phonemizer using pip:
    pip install phonemizer
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions