Metadata-Version: 2.4
Name: vox4ai-skill-lib
Version: 0.1.0
Summary: TTS skill for AI agents — synthesize, play, save speech via tts-plugin-bridge
Project-URL: Homepage, https://github.com/vox4ai/vox4ai-skill-lib
Project-URL: Repository, https://github.com/vox4ai/vox4ai-skill-lib
Project-URL: Issues, https://github.com/vox4ai/vox4ai-skill-lib/issues
Author-email: utenadev <utena.cross+pypi@gmail.com>
License: MIT
License-File: LICENSE
Keywords: agent-skill,ai-agent,speech,synthesis,tts,tts-plugin,voice
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: aiohttp
Requires-Dist: tts-plugin-bridge
Description-Content-Type: text/markdown

# vox4ai-skill-lib

<p align="center">
  <img src="https://via.placeholder.com/1200x400/1a1a1a/ffffff?text=vox4ai-skill-lib" alt="vox4ai-skill-lib Banner" width="1200">
</p>

<p align="center">
  <img src="https://img.shields.io/badge/pypi-latest-blue.svg" alt="PyPI version">
  <img src="https://img.shields.io/badge/license-MIT-green.svg" alt="License">
  <img src="https://img.shields.io/badge/python-3.10%2B-yellow.svg" alt="Python Version">
  <img src="https://img.shields.io/badge/maintained%3F-yes-brightgreen.svg" alt="Maintained">
</p>

<p align="center">
  <a href="https://github.com/vox4ai/vox4ai-skill-lib">Website</a> •
  <a href="https://github.com/vox4ai/vox4ai-skill-lib/issues">Report Bug</a> •
  <a href="https://github.com/vox4ai/vox4ai-skill-lib/contributing">Contributing</a>
</p>

---

## 🚀 Overview

Python ライブラリとしての TTS Skill — AI agent や CLI から `tts-plugin-bridge` の TTS Engine を統一的に操作します。

## 📦 Installation

```bash
uv add vox4ai-skill-lib
```

## 🛠 Usage

### 🧩 TTSSkill（推奨）

```python
import asyncio
from vox4ai_skill_lib import TTSSkill

async def main():
    async with TTSSkill(default_engine="edgetts") as skill:
        # 音声合成（Base64 で音声データ取得）
        result = await skill.synthesize(text="こんにちは")
        print(result["status"])  # "ok"

        # ファイル保存
        result = await skill.save(text="こんにちは")

        # ストリーミング再生（ffplay 優先）
        result = await skill.say(text="こんにちは")

        # モデル指定
        result = await skill.synthesize(
            text="こんにちは",
            model="ja-JP-KeitaNeural",
        )

asyncio.run(main())
```

### ⌨️ API 関数（簡易呼び出し用）

```python
import asyncio
from vox4ai_skill_lib.api import list_engines, play_text

async def main():
    await list_engines()
    await play_text("こんにちは", engine="edgetts", speed=1.0,
                    volume=None, pitch=None, style_id=None,
                    model="ja-JP-NanamiNeural", engine_kwargs={})

asyncio.run(main())
```

### 📑 TTSSkill API

| メソッド | 説明 |
|----------|------|
| `synthesize()` | 音声合成 → Base64 音声データを dict で返す |
| `save()` | `synthesize()` のエイリアス |
| `play()` | ストリーミング再生（ffplay）またはファイル再生（paplay/aplay） |
| `say()` | `play()` のエイリアス |
| `close()` | 全コネクタをクローズ |

全メソッドで `model` / `pitch` / `volume` / `style_id` / `engine` を **kwargs として受け付けます**。

コンテキストマネージャ対応:

```python
async with TTSSkill(default_engine="edgetts") as skill:
    result = await skill.synthesize(text="test")
# close() 自動呼び出し
```

### 📑 API 関数

| 関数 | 説明 |
|------|------|
| `list_engines()` | 利用可能な TTS Engine 一覧を表示 |
| `synthesize_text()` | 音声合成 + ファイル保存 / Base64 表示 |
| `play_text()` | テキスト読み上げ（ストリーミング + ファイルフォールバック） |
| `test_connection()` | TTS Engine への接続テスト |

## 📦 Dependencies

- `tts-plugin-bridge` — コアフレームワーク（protocol / factory / chunker）
- `aiohttp` — 非同期 HTTP

## 📜 License

MIT License