Skip to content

Commit 419c4d3

Browse files
Hypnus-YuanYuan Tao-Wen
authored andcommitted
docs(voice): add Doubao speech integration examples (TTS + STT)
1 parent 6bc5d72 commit 419c4d3

1 file changed

Lines changed: 43 additions & 1 deletion

File tree

  • website/docs/user-guide/features

website/docs/user-guide/features/tts.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,30 @@ tts:
185185
output_format: wav
186186
```
187187

188+
#### Example: Doubao (Chinese seed-tts-2.0)
189+
190+
For high-quality Chinese TTS via ByteDance's [seed-tts-2.0](https://www.volcengine.com/docs/6561/1257544) bidirectional-streaming API, install the [`doubao-speech`](https://pypi.org/project/doubao-speech/) PyPI package and wire it in as a command provider:
191+
192+
```bash
193+
pip install doubao-speech
194+
export VOLCENGINE_APP_ID="your-app-id"
195+
export VOLCENGINE_ACCESS_TOKEN="your-access-token"
196+
```
197+
198+
```yaml
199+
tts:
200+
provider: doubao
201+
providers:
202+
doubao:
203+
type: command
204+
command: "doubao-speech say --text-file {input_path} --out {output_path}"
205+
output_format: mp3
206+
max_text_length: 1024
207+
timeout: 30
208+
```
209+
210+
Credentials come from your shell environment (`VOLCENGINE_APP_ID` / `VOLCENGINE_ACCESS_TOKEN`) or `~/.doubao-speech/config.yaml`. Pick a voice by adding `--voice zh-female-warm` (or any other alias from `doubao-speech list-voices`) to the command. `doubao-speech` also bundles streaming ASR — see the [STT section below](#example-doubao--volcengine-asr) for Hermes integration. Source and full docs: [github.com/Hypnus-Yuan/doubao-speech](https://github.com/Hypnus-Yuan/doubao-speech).
211+
188212
#### Placeholders
189213

190214
Your command template can reference these placeholders. Hermes substitutes them at render time and shell-quotes each value for the surrounding context (bare / single-quoted / double-quoted), so paths with spaces and other shell-sensitive characters are safe.
@@ -273,7 +297,25 @@ stt:
273297

274298
**xAI Grok STT** — Requires `XAI_API_KEY`. Posts to `https://api.x.ai/v1/stt` as multipart/form-data. Good choice if you're already using xAI for chat or TTS and want one API key for everything. Auto-detection order puts it after Groq — explicitly set `stt.provider: xai` to force it.
275299

276-
**Custom local CLI fallback** — Set `HERMES_LOCAL_STT_COMMAND` if you want Hermes to call a local transcription command directly. The command template supports `{input_path}`, `{output_dir}`, `{language}`, and `{model}` placeholders.
300+
**Custom local CLI fallback** — Set `HERMES_LOCAL_STT_COMMAND` if you want Hermes to call a local transcription command directly. The command template supports `{input_path}`, `{output_dir}`, `{language}`, and `{model}` placeholders. Your command must write a `.txt` transcript somewhere under `{output_dir}`.
301+
302+
#### Example: Doubao / Volcengine ASR
303+
304+
If you use [`doubao-speech`](https://pypi.org/project/doubao-speech/) for Doubao TTS (see [above](#example-doubao-chinese-seed-tts-20)), the same package handles speech-to-text via the local-command STT surface:
305+
306+
```bash
307+
pip install doubao-speech
308+
export VOLCENGINE_APP_ID="your-app-id"
309+
export VOLCENGINE_ACCESS_TOKEN="your-access-token"
310+
export HERMES_LOCAL_STT_COMMAND='doubao-speech transcribe {input_path} --out {output_dir}/transcript.txt'
311+
```
312+
313+
```yaml
314+
stt:
315+
provider: local_command
316+
```
317+
318+
Hermes writes the incoming voice message to `{input_path}`, runs the command, and reads the `.txt` file produced under `{output_dir}`. Language is auto-detected by the Volcengine bigmodel endpoint.
277319

278320
### Fallback Behavior
279321

0 commit comments

Comments
 (0)