You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: app/server/README.md
+46-2Lines changed: 46 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,14 @@ cat > server.json <<'JSON'
34
34
},
35
35
"session_options": {
36
36
"language": "english"
37
+
},
38
+
"default_voice_preset": {
39
+
"voice_id": "alba"
40
+
},
41
+
"voice_presets": {
42
+
"cosette": {
43
+
"voice_id": "cosette"
44
+
}
37
45
}
38
46
},
39
47
{
@@ -57,6 +65,41 @@ Set top-level `"lazy_load": true` to register all configured model ids at startu
57
65
> [!WARNING]
58
66
> Lazy loading does not unload models after a request. Once a model is first used, the server keeps that model and session in memory for reuse until the server exits.
59
67
68
+
For TTS models that need repeated voice-clone context, set a model-level `default_voice_preset` so OpenAI-compatible clients can omit `voice_ref` and `reference_text` on each request:
69
+
70
+
```json
71
+
{
72
+
"id": "omnivoice",
73
+
"family": "omnivoice",
74
+
"path": "/absolute/path/to/models/OmniVoice",
75
+
"task": "tts",
76
+
"mode": "offline",
77
+
"default_voice_preset": {
78
+
"voice_ref": "/absolute/path/to/reference.wav",
79
+
"reference_text": "Reference transcript for the reference audio."
80
+
}
81
+
}
82
+
```
83
+
84
+
For multiple server-side presets, use `voice_presets` and optionally point `default_voice_preset` at one of those preset names:
85
+
86
+
```json
87
+
{
88
+
"voice_presets": {
89
+
"assistant": {
90
+
"voice_ref": "/absolute/path/to/assistant.wav",
91
+
"reference_text": "Reference transcript for assistant."
92
+
},
93
+
"narrator": {
94
+
"voice_id": "alba"
95
+
}
96
+
},
97
+
"default_voice_preset": "assistant"
98
+
}
99
+
```
100
+
101
+
When a request sends `"voice": "assistant"`, the server uses that configured preset. When `"voice"` does not match a configured preset, it is passed through as the model-native cached voice id, preserving the previous behavior.
"input": "audio.cpp is serving this request through the framework runtime.",
93
-
"voice_ref": "/path/to/reference.wav",
94
136
"max_tokens": 96,
95
137
"seed": 1234
96
138
}'
97
139
```
98
140
141
+
If no request voice is provided and the configured model has `default_voice_preset`, the server injects that preset automatically. Request-level `voice`, `voice_ref`, and `reference_text` override the configured default.
142
+
99
143
Set `"response_format": "json"` to receive base64 WAV in a JSON response.
Lists the cached voice ids available for a TTS model, so a client can populate a voice picker instead of guessing generic names. For families that keep voice presets under `model_root/embeddings/*.safetensors` (`pocket_tts` today), this returns those ids; for other families, or an unknown/missing `model` parameter, it returns an empty list.
171
+
Lists the cached voice ids and configured server voice preset names available for a TTS model, so a client can populate a voice picker instead of guessing generic names. For families that keep voice presets under `model_root/embeddings/*.safetensors` (`pocket_tts` today), this returns those ids too; for other families with no configured presets, or an unknown/missing `model` parameter, it returns an empty list.
0 commit comments