Skip to main content

Text-to-Speech module for Illufly AI

Project description

Illufly TTS - 模块化语音合成服务

高质量的模块化中文语音合成系统,支持多种部署方式。

特点

  • 模块化设计:可以按需安装客户端、服务端或完整包
  • 低资源需求:客户端几乎不需要额外依赖
  • 易于集成:可以直接复制API端点到其他应用
  • 多种部署:支持命令行、MCP协议和REST API接口

安装方式

1. 完整安装

包含所有组件,适合单机部署或完整服务:

pip install "illufly-tts[full]"

2. 仅客户端

轻量级安装,只包含客户端组件:

pip install "illufly-tts[client]"

3. 仅服务端

包含TTS核心服务:

pip install "illufly-tts[server]"

使用方式

完整服务(单机模式)

# 启动完整服务(包含API和TTS引擎)
python -m illufly_tts serve --voices-dir=./voices --device=cpu

拆分部署

# 在服务器上启动MCP服务
python -m illufly_tts server --voices-dir=./voices --device=cuda --transport=sse --port=31572

# 在客户端启动API服务
python -m illufly_tts api --server-host=tts-server-ip --server-port=31572

命令行客户端

# 通过命令行使用
python -m illufly_tts client speak --process-command="/usr/bin/python" --process-args="-m,illufly_tts,server" "你好世界"

# 获取可用语音
python -m illufly_tts client voices

集成到其他应用

from fastapi import FastAPI
from illufly_tts.api.endpoints import mount_tts_service

app = FastAPI()

# 添加自定义认证逻辑
async def get_current_user():
    # 实现你的认证逻辑
    return {"user_id": "my_user"}

# 挂载TTS服务
mount_tts_service(
    app=app,
    require_user=get_current_user,
    host="tts-server-host",  # 或使用子进程方式
    port=31572,
    prefix="/api/tts"
)

直接复制集成

如果你希望完全避免依赖,可以直接复制以下关键文件:

  1. src/illufly_tts/client/mcp_client.py - MCP客户端
  2. src/illufly_tts/api/endpoints.py - FastAPI端点

然后按照上面的集成示例整合到你的应用中。

更多信息

详细文档请参阅项目Wiki或API文档。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

illufly_tts-0.2.1.tar.gz (3.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

illufly_tts-0.2.1-py3-none-any.whl (3.1 MB view details)

Uploaded Python 3

File details

Details for the file illufly_tts-0.2.1.tar.gz.

File metadata

  • Download URL: illufly_tts-0.2.1.tar.gz
  • Upload date:
  • Size: 3.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.0 Darwin/24.3.0

File hashes

Hashes for illufly_tts-0.2.1.tar.gz
Algorithm Hash digest
SHA256 6d01033e48e768a6a2120ae6c7ef3726c12b4bf6cb7f98810661412ff352f3b9
MD5 ba75dbda7796c3da446877fe061d5bca
BLAKE2b-256 37e6270e79e2089dc7d72c9ba88cf690a1ca07722651958673670c628c04bbec

See more details on using hashes here.

File details

Details for the file illufly_tts-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: illufly_tts-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 3.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.0 Darwin/24.3.0

File hashes

Hashes for illufly_tts-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e73b005d3f2ed2c1d3ecd5564df3a0f2f452cd80b7a6fd5be9b5e33e74a67b9a
MD5 5263012c51a81c03eb65880977bb5a75
BLAKE2b-256 f2060333c0e47de2f190812e81c3669a2bde02d091c31886e6b2aad66f30b300

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page