Metadata-Version: 2.5
Name: yuppie-tts
Version: 0.1.0
Summary: Text-to-Speech library (edge-tts) — synthesize text to MP3 bytes, no API key
Project-URL: Homepage, https://github.com/yuppie1949/yuppie-mcp-tts
Project-URL: Repository, https://github.com/yuppie1949/yuppie-mcp-tts
Author-email: yuppie <yidaowanli@gmail.com>
License-Expression: MIT
Keywords: edge-tts,text-to-speech,tts
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Requires-Dist: edge-tts>=6.1.0
Provides-Extra: dev
Requires-Dist: mypy>=1.10.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: ruff>=0.4.0; extra == 'dev'
Description-Content-Type: text/markdown

# yuppie-tts

Text-to-Speech 纯 Python 库（基于 [edge-tts](https://github.com/rany2/edge-tts)，微软 Edge 免费 TTS 引擎），**无 MCP 依赖**。

从 `yuppie-mcp-tts` 仓库拆出的纯库包：如果你只想在自己的 Python 项目里合成语音，不想引入 MCP 及其版本约束，直接用这个包。

## 安装

```bash
uv add yuppie-tts        # 或 pip install yuppie-tts
```

## 快速开始

```python
import asyncio
from yuppie_tts import synthesize, AVAILABLE_VOICES

async def main():
    audio = await synthesize("你好世界", voice="zh-CN-XiaoxiaoNeural", speed=1.0)
    with open("/tmp/output.mp3", "wb") as f:
        f.write(audio)

print(len(AVAILABLE_VOICES), "个可用嗓音")  # 55
asyncio.run(main())
```

## API

- `yuppie_tts.synthesize(text, voice="en-US-JennyNeural", speed=1.0) -> bytes` — 异步合成，返回 MP3 音频字节；失败抛异常
- `yuppie_tts.AVAILABLE_VOICES` — 50+ 可用嗓音（中英文等多语种）
- `yuppie_tts.DEFAULT_VOICE` — 默认嗓音 `en-US-JennyNeural`

## 与 MCP Server 的关系

同一仓库的 `packages/yuppie-mcp-tts` 是本库的 MCP 壳（把 TTS 工具注册为 MCP 工具），PyPI 分发（`uvx yuppie-mcp-tts`），依赖本包。两者版本独立演进。

## 依赖

Python ≥ 3.10；仅 edge-tts。无 pydantic、无 mcp。
