TTS skill for AI agents — synthesize, play, save speech via tts-plugin-bridge
Project description
vox4ai-skill-lib
Website • Report Bug • Contributing
🚀 Overview
Python ライブラリとしての TTS Skill — AI agent や CLI から tts-plugin-bridge の TTS Engine を統一的に操作します。
📦 Installation
uv add vox4ai-skill-lib
🛠 Usage
🧩 TTSSkill(推奨)
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 関数(簡易呼び出し用)
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 として受け付けます。
コンテキストマネージャ対応:
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vox4ai_skill_lib-0.1.0.tar.gz.
File metadata
- Download URL: vox4ai_skill_lib-0.1.0.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9ba607165755d92f4ef481708e78c019b476e583c27d275eb5cf6dd4c8d5595
|
|
| MD5 |
f2e355fa21e396f2ff4175b93fa484f3
|
|
| BLAKE2b-256 |
7a7ca1f5419f6866d9533ef004bf905c7f3672a4fdc9e8833cb7bb5fdfb2d29a
|
File details
Details for the file vox4ai_skill_lib-0.1.0-py3-none-any.whl.
File metadata
- Download URL: vox4ai_skill_lib-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6402bb645d3d1864d78298f5010eaf03008e9a4bd65ee16ce728a38ca6979890
|
|
| MD5 |
07ead643ebfcb5cb576714d62bfd8764
|
|
| BLAKE2b-256 |
761d49f370751a9ec6d111a05c23e9c095325bd4a9ad526e47ec9036239e312b
|