⚠️ Disclaimer
This project is for learning and testing purposes only. For production environments, please use OpenAI's official TTS service.
English | 中文
TTSFM is a reverse-engineered API server that is fully compatible with OpenAI's Text-to-Speech (TTS) interface.
🎮 Try it now: Official Demo Site
ttsfm/
├── main.py # Application entry
├── server/ # Core services
│ ├── api.py # OpenAI-compatible API
│ └── handlers.py # Request handlers
├── proxy/ # Proxy system
│ └── manager.py
├── utils/ # Utility modules
│ └── config.py
├── static/ # Frontend resources
│ ├── index.html # English interface
│ ├── index_zh.html # Chinese interface
│ └── ... # JS/CSS resources
└── requirements.txt # Python dependencies
- Python ≥ 3.8
- Or Docker environment
Basic usage:
docker run -p 7000:7000 dbcccc/ttsfm:latest
Custom configuration using environment variables:
docker run -d \
-p 7000:7000 \
-e HOST=0.0.0.0 \
-e PORT=7000 \
-e VERIFY_SSL=true \
-e USE_PROXY=false \
-e PROXY_API_URL=https://proxy.scdn.io/api/get_proxy.php \
-e PROXY_PROTOCOL=http \
-e PROXY_BATCH_SIZE=5 \
-e MAX_QUEUE_SIZE=100 \
dbcccc/ttsfm:latest
Available environment variables:
HOST
: Server host (default: 0.0.0.0)PORT
: Server port (default: 7000)VERIFY_SSL
: Whether to verify SSL certificates (default: true)USE_PROXY
: Whether to use proxy pool (default: true)PROXY_API_URL
: Proxy API URL (default: https://proxy.scdn.io/api/get_proxy.php)PROXY_PROTOCOL
: Proxy protocol (default: http)PROXY_BATCH_SIZE
: Number of proxies to fetch at once (default: 5)MAX_QUEUE_SIZE
: Maximum number of tasks in queue (default: 100)
💡 Tip
MacOS users experiencing port conflicts can use alternative ports:
docker run -p 5051:7000 dbcccc/ttsfm:latest
- Download the latest release package from GitHub Releases
- Extract and enter the directory:
tar -zxvf ttsfm-vX.X.X.tar.gz
cd ttsfm-vX.X.X
- Install dependencies and launch:
pip install -r requirements.txt
cp .env.example .env # Edit config as needed
python main.py
Access http://localhost:7000
to experience the interactive demo
Endpoint | Method | Description |
---|---|---|
/v1/audio/speech |
POST | Text-to-Speech |
/api/queue-size |
GET | Query task queue |
🔍 Complete API documentation is available via the web interface after local deployment
# Basic test
python pressure_test.py
# Custom test example
python pressure_test.py -n 50 -c 10 -t long -s
Parameter Explanation:
-n
Total requests-c
Concurrency count-t
Text length (short/medium/long)-s
Save generated audio
We welcome all forms of contributions! You can participate by:
- Submitting Issues to report problems
- Creating Pull Requests to improve code
- Sharing usage experiences and suggestions
📜 Project licensed under MIT License