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.0.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.0-py3-none-any.whl (3.1 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: illufly_tts-0.2.0.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.0.tar.gz
Algorithm Hash digest
SHA256 d55ca1b4d93ce718a29b413d43c3e31fef89b180ebcdcef35ae58e8a8cd0e74a
MD5 5a2ae6b20c45ef6242df49a04aeb7c49
BLAKE2b-256 2ce941fd867d8f44384ea032f9fe26e504a958d53988c56752df28e65051fab5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: illufly_tts-0.2.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6d84c88f5af92cdfd2ecb4c0a1ee19ac67c28ade5603e4be9476aa6090fc25ce
MD5 4363da2d6c454b2a432877787f955f7d
BLAKE2b-256 5be77598ec7d6e5fc25f62348164c6b5d4c5a1ab37f1edafa67650760950e64d

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