Skip to content

espeak not installed on your system #545

@Cikaros

Description

@Cikaros

Describe the bug
When attempting to generate speech using a local TTS model (kitten-tts-mini-0.8-4bit) via the oMLX API (or similar local inference server), the request fails with a 500 Internal Server Error. The error message explicitly states: 'espeak not installed on your system', even though the espeak command-line tool is verified to be installed and functional in the host terminal environment.

To Reproduce
Steps to reproduce the behavior:

  1. Install espeak via Homebrew (brew install espeak) and verify it works by running espeak -v zh "test" in the terminal.
  2. Load the model kitten-tts-mini-0.8-4bit in oMLX (or start the local server).
  3. Run the following Python script targeting the local server endpoint:
from openai import OpenAI

client = OpenAI(base_url="http://localhost:1234/v1") # Example local URL

def text_to_speech(text, output_file="output.mp3"):
    try:
        response = client.audio.speech.create(
            model="kitten-tts-mini-0.8-4bit",
            voice="expr-voice-2-f",
            input=text
        )
        response.stream_to_file(output_file)
        print(f"Success: {output_file}")
    except Exception as e:
        print(f"Error: {e}")

if __name__ == "__main__":
    text_to_speech("你好,这是测试。")
  1. Observe the exception raised.

Expected behavior
The server should successfully process the TTS request and return an audio stream (or file), as the required dependency (espeak) is present in the system PATH. The error suggests the application cannot locate or access the espeak binary/library within its execution context.

Screenshots
Terminal Output:

$ espeak -v zh "你好"
[Sound plays correctly]

# Python Script Output:
生成失败: Error code: 500 - {'error': {'message': 'espeak not installed on your system', 'type': 'server_error', 'param': None, 'code': None}}

Desktop (please complete the following information):

  • OS: macOS Sonoma / Ventura
  • Browser: N/A (Local CLI/Python Client)
  • Version: oMLX [v0.3.1, Build: 260403040024-macos15-sequoia]
  • Python Version: 3.10+

Smartphone (please complete the following information):

  • N/A

Additional context

  • The espeak binary is confirmed to exist at /opt/homebrew/bin/espeak (standard Homebrew path on Apple Silicon Macs).
  • It is suspected that the local inference server (oMLX) might be running in a sandboxed environment or with a restricted PATH that does not include the Homebrew bin directory.
  • Alternative models like piper-tts or vits do not require espeak and work correctly; this issue is specific to models requiring the external espeak dependency.
  • Restarting the oMLX server did not resolve the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions