File size: 1,367 Bytes
821e7f0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
---

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](https://huggingface.co/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:**
```json

{

  "text": "Bawo ni"

}

```

**Response:**
```json

{

  "audio": "UklGRiQAAABXQVZFZm10...",

  "cached": false

}

```

The `audio` field contains base64-encoded WAV audio.

### GET /health

Check service health.

**Response:**
```json

{

  "status": "healthy",

  "model": "facebook/mms-tts-yor"

}

```

## Usage Example

```python

import requests

import base64



response = requests.post(

    "https://huggingface.co/proxy/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)