Spaces:
Running
on
Zero
Running
on
Zero
A newer version of the Gradio SDK is available:
6.1.0
metadata
title: VieNeu TTS
emoji: 🎙️
colorFrom: indigo
colorTo: blue
sdk: gradio
sdk_version: 4.19.2
app_file: gradio_app.py
pinned: false
license: mit
🎙️ VieNeu-TTS API Server
Vietnamese Text-to-Speech API với 10 giọng nói tự nhiên
🚀 Quick Start
1. Khởi động Server
start_server.bat
2. Test API
curl -X POST "http://127.0.0.1:8000/fast-tts" \
-H "Content-Type: application/json" \
-d '{
"text": "Xin chào, tôi là VieNeu-TTS",
"voice_choice": "Tuyên (nam miền Bắc)",
"return_base64": true
}'
3. Sử dụng trong Python
import requests
import base64
# Gửi request
response = requests.post("http://127.0.0.1:8000/fast-tts", json={
"text": "Xin chào từ VieNeu-TTS",
"voice_choice": "Ngọc (nữ miền Bắc)",
"return_base64": True
})
# Lưu audio
if response.status_code == 200:
result = response.json()
audio_bytes = base64.b64decode(result["audio_base64"])
with open("output.wav", "wb") as f:
f.write(audio_bytes)
📡 API Endpoints
| Endpoint | Method | Description |
|---|---|---|
/fast-tts |
POST | TTS nhanh (recommended) |
/tts |
POST | TTS standard |
/bulk-tts |
POST | Xử lý batch (max 50) |
/voices |
GET | Danh sách giọng nói |
/health |
GET | Health check |
/docs |
GET | API Documentation |
🎭 Giọng nói có sẵn
- Nam miền Bắc: Tuyên, Bình
- Nam miền Nam: Vĩnh, Nguyên, Sơn
- Nữ miền Bắc: Ngọc, Ly
- Nữ miền Nam: Đoan, Dung
- Đặc biệt: Nhỏ Ngọt Ngào
🔧 Cấu hình
- Server: http://127.0.0.1:8000
- GUI: Tích hợp sẵn khi chạy server
- Performance: Có thể điều chỉnh từ giao diện
- Cache: Tự động cache giọng nói
📚 Tài liệu đầy đủ
Xem API_DOCUMENTATION.md để biết chi tiết.
💡 Tips
- Dùng
/fast-ttsthay vì/tts - Set
return_base64=trueđể tránh file I/O - Cache kết quả theo text + voice + speed
- Dùng cùng giọng cho requests liên tiếp
🚀 Bắt đầu ngay với start_server.bat!