---
name: php186-skill-18108
description: "在 /v1/t2a_v2 和 /ws/v1/t2a_v2 上构建并调试 SenseAudio 文字转语音集成，涵盖同步 HTTP、SSE 流、WebSocket 事件序列、十六进制等。"
---

# SenseAudio-TTS

## SenseAudio TTS

 

Use this skill for all SenseAudio speech synthesis tasks.

 

## Read First

 

- ` references/tts.md `

 

## Workflow

 

1. Pick protocol:

 

- HTTP sync for simple one-shot generation.
- SSE for incremental HTTP audio chunks.
- WebSocket for realtime incremental text-to-audio sessions.

 

2. Build minimal valid request:

 

- Auth header, model, text, ` voice_setting.voice_id `.
- Add optional tuning only if user asks.

 

3. Implement output parsing:

 

- Decode ` data.audio ` hex to bytes.
- Finalize on terminal status/event.

 

4. Harden for production:

 

- Handle auth and parameter errors.
- Add retry/backoff for transient network failures.
- Log session and trace identifiers.
