Skip to content

Commit b2361dc

Browse files
committed
tts: update doc
Signed-off-by: blob42 <[email protected]>
1 parent 2448370 commit b2361dc

File tree

1 file changed

+36
-5
lines changed

1 file changed

+36
-5
lines changed

docs/content/docs/features/text-to-audio.md

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ Coqui works without any configuration, to test it, you can run the following cur
4848

4949
You can use the env variable COQUI_LANGUAGE to set the language used by the coqui backend.
5050

51+
You can also use config files to configure tts models (see section below on how to use config files).
52+
5153
### Bark
5254

5355
[Bark](https://github.com/suno-ai/bark) allows to generate audio from text prompts.
@@ -150,11 +152,12 @@ name: cloned-voice
150152
backend: vall-e-x
151153
parameters:
152154
model: "cloned-voice"
153-
vall-e:
154-
# The path to the audio file to be cloned
155-
# relative to the models directory
156-
# Max 15s
157-
audio_path: "audio-sample.wav"
155+
tts:
156+
vall-e:
157+
# The path to the audio file to be cloned
158+
# relative to the models directory
159+
# Max 15s
160+
audio_path: "audio-sample.wav"
158161
```
159162
160163
Then you can specify the model name in the requests:
@@ -165,3 +168,31 @@ curl http://localhost:8080/tts -H "Content-Type: application/json" -d '{
165168
"input":"Hello!"
166169
}' | aplay
167170
```
171+
172+
### Using config files
173+
174+
You can also use a `config-file` to specify TTS models and their parameters.
175+
176+
In the following example we define a custom config to load the `xtts_v2` model, and specify a voice and language.
177+
178+
```yaml
179+
180+
name: xtts_v2
181+
backend: coqui
182+
parameters:
183+
language: fr
184+
model: tts_models/multilingual/multi-dataset/xtts_v2
185+
186+
tts:
187+
voice: Ana Florence
188+
```
189+
190+
With this config, you can now use the following curl command to generate a text-to-speech audio file:
191+
```bash
192+
curl -L http://localhost:8080/tts \
193+
-H "Content-Type: application/json" \
194+
-d '{
195+
"model": "xtts_v2",
196+
"input": "Bonjour, je suis Ana Florence. Comment puis-je vous aider?"
197+
}' | aplay
198+
```

0 commit comments

Comments
 (0)