-
Notifications
You must be signed in to change notification settings - Fork 720
espeak not installed on your system #545
Description
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:
- Install
espeakvia Homebrew (brew install espeak) and verify it works by runningespeak -v zh "test"in the terminal. - Load the model
kitten-tts-mini-0.8-4bitin oMLX (or start the local server). - 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("你好,这是测试。")- 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
espeakbinary 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-ttsorvitsdo not requireespeakand work correctly; this issue is specific to models requiring the externalespeakdependency. - Restarting the oMLX server did not resolve the issue.