Skip to content

添加OpenAI TTS API兼容接口支持 #2327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Chopin68
Copy link

添加OpenAI TTS API兼容接口支持

功能描述

本PR为GPT-SoVITS添加了与OpenAI TTS API兼容的接口,使开发者可以用与OpenAI相同的API格式调用GPT-SoVITS进行语音合成。

主要变更

  • 实现了与OpenAI兼容的POST /v1/audio/speech接口
  • 添加了模型管理器(api_model_manager.py)用于管理多个声音模型
  • 添加了详细的API使用说明文档

技术实现

  • 使用FastAPI实现RESTful API接口
  • 遵循OpenAI TTS API的请求和响应格式
  • 支持多种音频格式输出(mp3, wav, ogg)
  • 支持参考音频上传和管理

测试方法

可以使用以下命令测试API:
curl -X POST http://localhost:15000/v1/audio/speech -H "Content-Type: application/json" -d '{"model": "tts-1", "input": "测试文本", "voice": "模型名称", "response_format": "mp3"}'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant