Spaces:
Sleeping
Sleeping
metadata
title: Yoruba TTS API
emoji: 🗣️
colorFrom: yellow
colorTo: red
sdk: docker
app_port: 7860
pinned: false
license: cc-by-nc-4.0
Yoruba TTS API
Text-to-Speech API for Yoruba language using the facebook/mms-tts-yor model.
Model Information
- Model: facebook/mms-tts-yor
- Architecture: VITS (Variational Inference TTS)
- Parameters: 36.3M
- License: CC-BY-NC 4.0 (non-commercial use)
API Endpoints
POST /tts
Generate speech from Yoruba text.
Request:
{
"text": "Bawo ni"
}
Response:
{
"audio": "UklGRiQAAABXQVZFZm10...",
"cached": false
}
The audio field contains base64-encoded WAV audio.
GET /health
Check service health.
Response:
{
"status": "healthy",
"model": "facebook/mms-tts-yor"
}
Usage Example
import requests
import base64
response = requests.post(
"https://YOUR-SPACE.hf.space/tts",
json={"text": "Bawo ni"}
)
audio_b64 = response.json()["audio"]
audio_bytes = base64.b64decode(audio_b64)
with open("output.wav", "wb") as f:
f.write(audio_bytes)
Limitations
- Maximum text length: 500 characters
- Audio format: WAV (16-bit PCM)
- Sample rate: Model default (~22050 Hz)