ClawSkills logoClawSkills

MLX Audio Server

本地 24x7 OpenAI 兼容 API 服务器,用于 STT/TTS,由您的 Mac 上的 MLX 驱动。

介绍

# MLX Audio Server

由 Mac 上的 MLX 驱动,提供全天候(24x7)本地运行的 STT/TTS OpenAI 兼容 API 服务器。

[mlx-audio](https://github.com/Blaizzy/mlx-audio):基于 Apple MLX 框架构建的最佳音频处理库,在 Apple Silicon 上提供快速高效的文本转语音(TTS)、语音转文本(STT)和语音转语音(STS)功能。

[guoqiao/tap/mlx-audio-server](https://github.com/guoqiao/homebrew-tap/blob/main/Formula/mlx-audio-server.rb):Homebrew Formula,用于通过 `brew` 安装 `mlx-audio`,并在 macOS 上以 LaunchAgent 服务形式运行 `mlx_audio.server`。

## 要求

- `mlx`:搭载 Apple Silicon 的 macOS - `brew`:用于在依赖项缺失时进行安装

## 安装

```bash bash ${baseDir}/install.sh ``` 此脚本将会: - 如果缺失,通过 brew 安装 ffmpeg/jq。 - 从 `guoqiao/tap` 安装 homebrew formula `mlx-audio-server` - 为 `mlx-audio-server` 启动 brew 服务

## 用法

STT/语音转文本(默认模型:**mlx-community/glm-asr-nano-2512-8bit**): ```bash # input will be converted to wav with ffmpeg, if not yet. # output will be transcript text only. bash ${baseDir}/run_stt.sh <audio_or_video_path> ```

TTS/文本转语音(默认模型:**mlx-community/Qwen3-TTS-12Hz-1.7B-VoiceDesign-bf16**): ```bash # audio will be saved into a tmp dir, with default name `speech.wav`, and print to stdout. bash ${baseDir}/run_tts.sh "Hello, Human!" # or you can specify a output dir bash ${baseDir}/run_tts.sh "Hello, Human!" ./output # output will be audio path only. ``` 您可以直接使用这两个脚本,也可以将其作为示例或参考。

更多产品