{"componentChunkName":"component---src-templates-acg-portal-new-template-tsx","path":"/Vmwbl4d4c","result":{"data":{"markdownRemark":{"html":"<h1 id=\"接口描述\"><a href=\"#%E6%8E%A5%E5%8F%A3%E6%8F%8F%E8%BF%B0\" aria-label=\"接口描述 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>接口描述</h1>\n<p>流式文本在线合成基于websocket协议，可以将输入的文本合成为二进制格式的语音数据。与发起多次短文本语音合成相比，可以获得更高的实时性，在用户输入文本的同时就能接近同步的返回合成音频数据，达到“边合成边播放”的效果。</p>\n<h2 id=\"功能说明\"><a href=\"#%E5%8A%9F%E8%83%BD%E8%AF%B4%E6%98%8E\" aria-label=\"功能说明 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>功能说明</h2>\n<ul>\n<li>建议文本不超过2000 GBK字节，即1000个汉字或者字母数字；</li>\n<li>输入的文本必须采用UTF-8编码；</li>\n<li>支持多音字通过标注自行定义发音。格式如：重(chong2)报集团。</li>\n</ul>\n<h2 id=\"示例代码\"><a href=\"#%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81\" aria-label=\"示例代码 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>示例代码</h2>\n<p>流式语音合成示例：<a href=\"https://platform-new.cdn.bcebos.com/sdk/api/TTS-ws-demo.py20250915.zip\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">TTS-ws-demo.zip</a>\n</br></p>\n<h1 id=\"接口调用主流程\"><a href=\"#%E6%8E%A5%E5%8F%A3%E8%B0%83%E7%94%A8%E4%B8%BB%E6%B5%81%E7%A8%8B\" aria-label=\"接口调用主流程 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>接口调用主流程</h1>\n<h2 id=\"交互流程\"><a href=\"#%E4%BA%A4%E4%BA%92%E6%B5%81%E7%A8%8B\" aria-label=\"交互流程 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>交互流程</h2>\n<p><img src=\"https://bce.bdstatic.com/doc/ai-cloud-share/SPEECH/image_6c7df8f.png\" alt=\"image.png\"></p>\n<h2 id=\"握手建立连接\"><a href=\"#%E6%8F%A1%E6%89%8B%E5%BB%BA%E7%AB%8B%E8%BF%9E%E6%8E%A5\" aria-label=\"握手建立连接 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>握手建立连接</h2>\n<h3 id=\"连接请求\"><a href=\"#%E8%BF%9E%E6%8E%A5%E8%AF%B7%E6%B1%82\" aria-label=\"连接请求 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>连接请求</h3>\n<p>握手阶段，客户端主动发起 websocket 连接请求</p>\n<h4 id=\"请求地址\"><a href=\"#%E8%AF%B7%E6%B1%82%E5%9C%B0%E5%9D%80\" aria-label=\"请求地址 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>请求地址</h4>\n<p>请求地址：wss://aip.baidubce.com/ws/2.0/speech/publiccloudspeech/v1/tts</p>\n<h4 id=\"请求参数\"><a href=\"#%E8%AF%B7%E6%B1%82%E5%8F%82%E6%95%B0\" aria-label=\"请求参数 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>请求参数</h4>\n<p>URL中放置请求参数，参数如下：</p>\n<table>\n<thead>\n<tr>\n<th>参数名</th>\n<th>类型</th>\n<th>参数位置</th>\n<th>是否必填</th>\n<th>备注</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>access_token</td>\n<td>string</td>\n<td>query</td>\n<td>二选一</td>\n<td><a href=\"https://ai.baidu.com/ai-doc/REFERENCE/Ck3dwjhhu\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">鉴权令牌</a></td>\n</tr>\n<tr>\n<td>Authorization</td>\n<td>string</td>\n<td>header</td>\n<td>二选一</td>\n<td><a href=\"https://ai.baidu.com/ai-doc/REFERENCE/Ck3dwjhhu#%E4%BA%8C%E3%80%81api-key%E9%89%B4%E6%9D%83%E6%9C%BA%E5%88%B6\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">鉴权API Key</a></td>\n</tr>\n<tr>\n<td>per</td>\n<td>string</td>\n<td>query</td>\n<td>必填</td>\n<td><a href=\"https://ai.baidu.com/ai-doc/SPEECH/Rluv3uq3d\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">tts发音人</a></td>\n</tr>\n</tbody>\n</table>\n<h4 id=\"请求示例\"><a href=\"#%E8%AF%B7%E6%B1%82%E7%A4%BA%E4%BE%8B\" aria-label=\"请求示例 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>请求示例</h4>\n\n    <div class=\"code-block-wrapper\">\n        <div class=\"code-block\">\n            <div class=\"code-block-header\">\n                <span class=\"code-block-name\">Text</span>\n                <button class=\"code-copy-btn\" data-tooltip-text=\"\">\n                    <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\"> <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M5.57894 3.45614C5.57894 3.38832 5.63392 3.33333 5.70175 3.33333H12.5439C12.6117 3.33333 12.6667 3.38832 12.6667 3.45614V10.2982C12.6667 10.3661 12.6117 10.4211 12.5439 10.4211H11.7544V5.70175C11.7544 4.89754 11.1025 4.24561 10.2982 4.24561H5.57894V3.45614ZM4.24561 4.24561V3.45614C4.24561 2.65194 4.89754 2 5.70175 2H12.5439C13.3481 2 14 2.65194 14 3.45614V10.2982C14 11.1025 13.3481 11.7544 12.5439 11.7544H11.7544V12.5439C11.7544 13.3481 11.1025 14 10.2982 14H3.45614C2.65194 14 2 13.3481 2 12.5439V5.70175C2 4.89754 2.65194 4.24561 3.45614 4.24561H4.24561ZM3.33333 5.70175C3.33333 5.63392 3.38832 5.57894 3.45614 5.57894H10.2982C10.3661 5.57894 10.4211 5.63392 10.4211 5.70175V12.5439C10.4211 12.6117 10.3661 12.6667 10.2982 12.6667H3.45614C3.38832 12.6667 3.33333 12.6117 3.33333 12.5439V5.70175Z\" fill=\"currentColor\"></path> </svg>\n                    复制\n                </button>\n            </div>\n            <div class=\"code-block-content\">\n                <pre class=\"language-text\"><code><span class=\"line-number\">1</span>curl --location &#039;wss://aip.baidubce.com/ws/2.0/speech/publiccloudspeech/v1/tts?access_token=xxx&amp;per=xxx&#039;</code></pre>\n            </div>\n        </div>\n    </div>\n  \n<h3 id=\"连接响应\"><a href=\"#%E8%BF%9E%E6%8E%A5%E5%93%8D%E5%BA%94\" aria-label=\"连接响应 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>连接响应</h3>\n<p>如果握手成功，会返回 101状态码，表示协议握手成功；如果握手失败，则根据不同错误类型返回不同 http status，详细说明如下：<br>\n<strong>成功：</strong>状态码101 Switching Protocols<br>\n<strong>失败：</strong>错误码及描述如下</p>\n<table>\n<thead>\n<tr>\n<th>状态码</th>\n<th>状态信息</th>\n<th>描述</th>\n<th>解决方案</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>400</td>\n<td>Bad Request</td>\n<td>参数错误、参数缺失</td>\n<td>请参考官网文档，自查token和per</td>\n</tr>\n<tr>\n<td>401</td>\n<td>Unauthorized</td>\n<td>鉴权失败</td>\n<td></td>\n</tr>\n<tr>\n<td>403</td>\n<td>Forbidden</td>\n<td>无访问权限，接口功能未开通</td>\n<td></td>\n</tr>\n<tr>\n<td>404</td>\n<td>Not Found</td>\n<td>输入的url错误</td>\n<td></td>\n</tr>\n<tr>\n<td>429</td>\n<td>Too Many Requests</td>\n<td>触发限流</td>\n<td></td>\n</tr>\n<tr>\n<td>500</td>\n<td>Internal Server Error</td>\n<td>服务器内部错误</td>\n<td></td>\n</tr>\n<tr>\n<td>502</td>\n<td>Bad Request</td>\n<td>后端服务连接失败</td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<h5 id=\"示例\"><a href=\"#%E7%A4%BA%E4%BE%8B\" aria-label=\"示例 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>示例</h5>\n\n    <div class=\"code-block-wrapper\">\n        <div class=\"code-block\">\n            <div class=\"code-block-header\">\n                <span class=\"code-block-name\">Text</span>\n                <button class=\"code-copy-btn\" data-tooltip-text=\"\">\n                    <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\"> <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M5.57894 3.45614C5.57894 3.38832 5.63392 3.33333 5.70175 3.33333H12.5439C12.6117 3.33333 12.6667 3.38832 12.6667 3.45614V10.2982C12.6667 10.3661 12.6117 10.4211 12.5439 10.4211H11.7544V5.70175C11.7544 4.89754 11.1025 4.24561 10.2982 4.24561H5.57894V3.45614ZM4.24561 4.24561V3.45614C4.24561 2.65194 4.89754 2 5.70175 2H12.5439C13.3481 2 14 2.65194 14 3.45614V10.2982C14 11.1025 13.3481 11.7544 12.5439 11.7544H11.7544V12.5439C11.7544 13.3481 11.1025 14 10.2982 14H3.45614C2.65194 14 2 13.3481 2 12.5439V5.70175C2 4.89754 2.65194 4.24561 3.45614 4.24561H4.24561ZM3.33333 5.70175C3.33333 5.63392 3.38832 5.57894 3.45614 5.57894H10.2982C10.3661 5.57894 10.4211 5.63392 10.4211 5.70175V12.5439C10.4211 12.6117 10.3661 12.6667 10.2982 12.6667H3.45614C3.38832 12.6667 3.33333 12.6117 3.33333 12.5439V5.70175Z\" fill=\"currentColor\"></path> </svg>\n                    复制\n                </button>\n            </div>\n            <div class=\"code-block-content\">\n                <pre class=\"language-text\"><code><span class=\"line-number\">1</span>429 Too Many Requests\n<span class=\"line-number\">2</span>\n<span class=\"line-number\">3</span>{\n<span class=\"line-number\">4</span>    &quot;code&quot;: 276001,\n<span class=\"line-number\">5</span>    &quot;message&quot;: &quot;Rate limit exceeded error&quot;\n<span class=\"line-number\">6</span>}</code></pre>\n            </div>\n        </div>\n    </div>\n  \n<h5 id=\"参数说明\"><a href=\"#%E5%8F%82%E6%95%B0%E8%AF%B4%E6%98%8E\" aria-label=\"参数说明 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>参数说明</h5>\n<table>\n<thead>\n<tr>\n<th>参数名</th>\n<th>类型</th>\n<th>是否必填</th>\n<th>说明</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>code</td>\n<td>int</td>\n<td>必填</td>\n<td>错误码， 使用能力引擎标准的错误码</td>\n</tr>\n<tr>\n<td>message</td>\n<td>string</td>\n<td>必填</td>\n<td>错误消息</td>\n</tr>\n</tbody>\n</table>\n<h2 id=\"初始化\"><a href=\"#%E5%88%9D%E5%A7%8B%E5%8C%96\" aria-label=\"初始化 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>初始化</h2>\n<p>握手成功后客户端和服务端会建立websocket连接，客户端通过websocket连接可以同时上传和接收数据。</p>\n<h3 id=\"客户端请求参数\"><a href=\"#%E5%AE%A2%E6%88%B7%E7%AB%AF%E8%AF%B7%E6%B1%82%E5%8F%82%E6%95%B0\" aria-label=\"客户端请求参数 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>客户端请求参数</h3>\n<ul>\n<li><strong>帧类型（Opcode）：</strong>Text</li>\n<li><strong>序列化方式：</strong>JSON</li>\n</ul>\n<h5 id=\"示例-1\"><a href=\"#%E7%A4%BA%E4%BE%8B-1\" aria-label=\"示例 1 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>示例</h5>\n\n    <div class=\"code-block-wrapper\">\n        <div class=\"code-block\">\n            <div class=\"code-block-header\">\n                <span class=\"code-block-name\">Text</span>\n                <button class=\"code-copy-btn\" data-tooltip-text=\"\">\n                    <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\"> <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M5.57894 3.45614C5.57894 3.38832 5.63392 3.33333 5.70175 3.33333H12.5439C12.6117 3.33333 12.6667 3.38832 12.6667 3.45614V10.2982C12.6667 10.3661 12.6117 10.4211 12.5439 10.4211H11.7544V5.70175C11.7544 4.89754 11.1025 4.24561 10.2982 4.24561H5.57894V3.45614ZM4.24561 4.24561V3.45614C4.24561 2.65194 4.89754 2 5.70175 2H12.5439C13.3481 2 14 2.65194 14 3.45614V10.2982C14 11.1025 13.3481 11.7544 12.5439 11.7544H11.7544V12.5439C11.7544 13.3481 11.1025 14 10.2982 14H3.45614C2.65194 14 2 13.3481 2 12.5439V5.70175C2 4.89754 2.65194 4.24561 3.45614 4.24561H4.24561ZM3.33333 5.70175C3.33333 5.63392 3.38832 5.57894 3.45614 5.57894H10.2982C10.3661 5.57894 10.4211 5.63392 10.4211 5.70175V12.5439C10.4211 12.6117 10.3661 12.6667 10.2982 12.6667H3.45614C3.38832 12.6667 3.33333 12.6117 3.33333 12.5439V5.70175Z\" fill=\"currentColor\"></path> </svg>\n                    复制\n                </button>\n            </div>\n            <div class=\"code-block-content\">\n                <pre class=\"language-text\"><code><span class=\"line-number\">1</span>{\n<span class=\"line-number\">2</span>    &quot;type&quot;: &quot;system.start&quot;,\n<span class=\"line-number\">3</span>    &quot;payload&quot;: {\n<span class=\"line-number\">4</span>        &quot;spd&quot;: 5,\n<span class=\"line-number\">5</span>        &quot;pit&quot;: 5,\n<span class=\"line-number\">6</span>        &quot;vol&quot;: 5,\n<span class=\"line-number\">7</span>        &quot;audio_ctrl&quot;: &#039;{&quot;AIGC&quot;: {&quot;ContentPropagator&quot;:&quot;XXX&quot;,&quot;PropagateID&quot;:&quot;XXX&quot;},&quot;sampling_rate&quot;:16000}&#039;,\n<span class=\"line-number\">8</span>        &quot;aue&quot;: 3\n<span class=\"line-number\">9</span>    }\n<span class=\"line-number\">10</span>}</code></pre>\n            </div>\n        </div>\n    </div>\n  \n<h5 id=\"参数说明-1\"><a href=\"#%E5%8F%82%E6%95%B0%E8%AF%B4%E6%98%8E-1\" aria-label=\"参数说明 1 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>参数说明</h5>\n<table>\n<thead>\n<tr>\n<th>参数名称</th>\n<th>类型</th>\n<th>是否必填</th>\n<th>说明</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>type</td>\n<td>string</td>\n<td>必填</td>\n<td>开始帧的类型，固定值 system.start</td>\n</tr>\n<tr>\n<td>payload</td>\n<td>object</td>\n<td>可选</td>\n<td>合成参数，详见下表</td>\n</tr>\n</tbody>\n</table>\n<h6 id=\"payload-字段说明\"><a href=\"#payload-%E5%AD%97%E6%AE%B5%E8%AF%B4%E6%98%8E\" aria-label=\"payload 字段说明 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>payload 字段说明</h6>\n<table>\n<thead>\n<tr>\n<th>参数名称</th>\n<th>类型</th>\n<th>是否必填</th>\n<th>说明</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>spd</td>\n<td>int</td>\n<td>可选</td>\n<td>语速，取值 0-15，默认为 5</td>\n</tr>\n<tr>\n<td>pit</td>\n<td>int</td>\n<td>可选</td>\n<td>音调，取值 0-15，默认为 5</td>\n</tr>\n<tr>\n<td>vol</td>\n<td>int</td>\n<td>可选</td>\n<td>音量，基础音库取值0-9，其他音库取值 0-15，默认为 5</td>\n</tr>\n<tr>\n<td>aue</td>\n<td>int</td>\n<td>可选</td>\n<td>音频格式，3=mp3-16k/24k，4=pcm-16k/24k，5=pcm-8k，6=wav-16k/24k，默认为3</td>\n</tr>\n<tr>\n<td>audio_ctrl</td>\n<td>string</td>\n<td>可选</td>\n<td><em> sampling_rate: 采样率,仅支持降采样,示例 {\"sampling_rate\":16000}</br></em> AIGC: 元数据标识，仅支持mp3格式音频添加，默认不添加。</br>示例：{ \"ContentPropagator\":\"内容传播服务提供者\", \"PropagateID\":\"内容传播编号\" }</br><em>ContentPropagator、PropagateID请传入string类型的数据。</em></br><em>若不传入两个字段，默认不添加元数据标识；传入字段后音频header将添加Label、ContentProducer、ProduceID、ContentPropagator、PropagateID总计5个字段。</em></td>\n</tr>\n</tbody>\n</table>\n<h3 id=\"服务端响应\"><a href=\"#%E6%9C%8D%E5%8A%A1%E7%AB%AF%E5%93%8D%E5%BA%94\" aria-label=\"服务端响应 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>服务端响应</h3>\n<ul>\n<li><strong>帧类型（Opcode）：</strong>Text</li>\n<li><strong>序列化方式：</strong>JSON</li>\n</ul>\n<h4 id=\"正常响应\"><a href=\"#%E6%AD%A3%E5%B8%B8%E5%93%8D%E5%BA%94\" aria-label=\"正常响应 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>正常响应</h4>\n<ul>\n<li>\n<p>服务端对客户端「开始合成」的响应</p>\n<ul>\n<li>code 等于 0：表示通道各个参数已经设置完成；</li>\n<li>code 不等于 0：表示通道参数设置有误，服务端会断开所有ws连接。</li>\n</ul>\n</li>\n</ul>\n<h5 id=\"示例-2\"><a href=\"#%E7%A4%BA%E4%BE%8B-2\" aria-label=\"示例 2 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>示例</h5>\n\n    <div class=\"code-block-wrapper\">\n        <div class=\"code-block\">\n            <div class=\"code-block-header\">\n                <span class=\"code-block-name\">Text</span>\n                <button class=\"code-copy-btn\" data-tooltip-text=\"\">\n                    <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\"> <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M5.57894 3.45614C5.57894 3.38832 5.63392 3.33333 5.70175 3.33333H12.5439C12.6117 3.33333 12.6667 3.38832 12.6667 3.45614V10.2982C12.6667 10.3661 12.6117 10.4211 12.5439 10.4211H11.7544V5.70175C11.7544 4.89754 11.1025 4.24561 10.2982 4.24561H5.57894V3.45614ZM4.24561 4.24561V3.45614C4.24561 2.65194 4.89754 2 5.70175 2H12.5439C13.3481 2 14 2.65194 14 3.45614V10.2982C14 11.1025 13.3481 11.7544 12.5439 11.7544H11.7544V12.5439C11.7544 13.3481 11.1025 14 10.2982 14H3.45614C2.65194 14 2 13.3481 2 12.5439V5.70175C2 4.89754 2.65194 4.24561 3.45614 4.24561H4.24561ZM3.33333 5.70175C3.33333 5.63392 3.38832 5.57894 3.45614 5.57894H10.2982C10.3661 5.57894 10.4211 5.63392 10.4211 5.70175V12.5439C10.4211 12.6117 10.3661 12.6667 10.2982 12.6667H3.45614C3.38832 12.6667 3.33333 12.6117 3.33333 12.5439V5.70175Z\" fill=\"currentColor\"></path> </svg>\n                    复制\n                </button>\n            </div>\n            <div class=\"code-block-content\">\n                <pre class=\"language-text\"><code><span class=\"line-number\">1</span>{\n<span class=\"line-number\">2</span>    &quot;type&quot;: &quot;system.started&quot;,\n<span class=\"line-number\">3</span>    &quot;code&quot;: 0,\n<span class=\"line-number\">4</span>    &quot;message&quot;: &quot;success&quot;,\n<span class=\"line-number\">5</span>    &quot;headers&quot;: {\n<span class=\"line-number\">6</span>        &quot;session_id&quot;: &quot;xxx&quot;\n<span class=\"line-number\">7</span>               }\n<span class=\"line-number\">8</span>}</code></pre>\n            </div>\n        </div>\n    </div>\n  \n<h5 id=\"参数说明-2\"><a href=\"#%E5%8F%82%E6%95%B0%E8%AF%B4%E6%98%8E-2\" aria-label=\"参数说明 2 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>参数说明</h5>\n<table>\n<thead>\n<tr>\n<th>参数名称</th>\n<th>类型</th>\n<th>是否必填</th>\n<th>说明</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>type</td>\n<td>string</td>\n<td>必填</td>\n<td>固定值 system.started，表示开始帧的类型</td>\n</tr>\n<tr>\n<td>code</td>\n<td>int</td>\n<td>必填</td>\n<td>错误码，0 表示成功</td>\n</tr>\n<tr>\n<td>message</td>\n<td>string</td>\n<td>必填</td>\n<td>错误信息</td>\n</tr>\n<tr>\n<td>headers</td>\n<td>object</td>\n<td>必填</td>\n<td>系统定义的请求头</td>\n</tr>\n<tr>\n<td>+ session_id</td>\n<td>string</td>\n<td>必填</td>\n<td>sn 信息，格式为 [0-9a-zA-Z_-]{1,64}</td>\n</tr>\n</tbody>\n</table>\n<h4 id=\"异常响应\"><a href=\"#%E5%BC%82%E5%B8%B8%E5%93%8D%E5%BA%94\" aria-label=\"异常响应 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>异常响应</h4>\n<h5 id=\"示例-3\"><a href=\"#%E7%A4%BA%E4%BE%8B-3\" aria-label=\"示例 3 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>示例</h5>\n\n    <div class=\"code-block-wrapper\">\n        <div class=\"code-block\">\n            <div class=\"code-block-header\">\n                <span class=\"code-block-name\">Text</span>\n                <button class=\"code-copy-btn\" data-tooltip-text=\"\">\n                    <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\"> <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M5.57894 3.45614C5.57894 3.38832 5.63392 3.33333 5.70175 3.33333H12.5439C12.6117 3.33333 12.6667 3.38832 12.6667 3.45614V10.2982C12.6667 10.3661 12.6117 10.4211 12.5439 10.4211H11.7544V5.70175C11.7544 4.89754 11.1025 4.24561 10.2982 4.24561H5.57894V3.45614ZM4.24561 4.24561V3.45614C4.24561 2.65194 4.89754 2 5.70175 2H12.5439C13.3481 2 14 2.65194 14 3.45614V10.2982C14 11.1025 13.3481 11.7544 12.5439 11.7544H11.7544V12.5439C11.7544 13.3481 11.1025 14 10.2982 14H3.45614C2.65194 14 2 13.3481 2 12.5439V5.70175C2 4.89754 2.65194 4.24561 3.45614 4.24561H4.24561ZM3.33333 5.70175C3.33333 5.63392 3.38832 5.57894 3.45614 5.57894H10.2982C10.3661 5.57894 10.4211 5.63392 10.4211 5.70175V12.5439C10.4211 12.6117 10.3661 12.6667 10.2982 12.6667H3.45614C3.38832 12.6667 3.33333 12.6117 3.33333 12.5439V5.70175Z\" fill=\"currentColor\"></path> </svg>\n                    复制\n                </button>\n            </div>\n            <div class=\"code-block-content\">\n                <pre class=\"language-text\"><code><span class=\"line-number\">1</span>{\n<span class=\"line-number\">2</span>    &quot;type&quot;: &quot;system.started&quot;,\n<span class=\"line-number\">3</span>    &quot;code&quot;: 216100,\n<span class=\"line-number\">4</span>    &quot;message&quot;: &quot;语速参数错误, 请输入0-15的整数&quot;,\n<span class=\"line-number\">5</span>    &quot;headers&quot;: {\n<span class=\"line-number\">6</span>        &quot;session_id&quot;: &quot;xxx&quot;\n<span class=\"line-number\">7</span>               }\n<span class=\"line-number\">8</span>}</code></pre>\n            </div>\n        </div>\n    </div>\n  \n<h5 id=\"异常响应列表\"><a href=\"#%E5%BC%82%E5%B8%B8%E5%93%8D%E5%BA%94%E5%88%97%E8%A1%A8\" aria-label=\"异常响应列表 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>异常响应列表</h5>\n<table>\n<thead>\n<tr>\n<th>type</th>\n<th>code</th>\n<th>message</th>\n<th>说明</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>system.started</code></td>\n<td>216100</td>\n<td>参数错误</td>\n<td>参数类型错误</td>\n</tr>\n<tr>\n<td><code>system.started</code></td>\n<td>216100</td>\n<td>语速参数错误, 请输入0-15的整数</td>\n<td>语速取值超限</td>\n</tr>\n<tr>\n<td><code>system.started</code></td>\n<td>216100</td>\n<td>音调参数错误, 请输入0-15的整数</td>\n<td>音调取值超限</td>\n</tr>\n<tr>\n<td><code>system.started</code></td>\n<td>216100</td>\n<td>基础音库音量参数错误, 请输入0-9的整数</td>\n<td>基础音库音量取值超限</td>\n</tr>\n<tr>\n<td><code>system.started</code></td>\n<td>216100</td>\n<td>精品/臻品音库音量参数错误, 请输入0-15的整数</td>\n<td>精品/臻品音库音量取值超限</td>\n</tr>\n<tr>\n<td><code>system.started</code></td>\n<td>216100</td>\n<td>音频格式错误, 3:mp3, 4:pcm-16k, 5:pcm-8k, 6:wav</td>\n<td>音频格式取值错误</td>\n</tr>\n</tbody>\n</table>\n<h4 id=\"不响应\"><a href=\"#%E4%B8%8D%E5%93%8D%E5%BA%94\" aria-label=\"不响应 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>不响应</h4>\n<ul>\n<li>已经发送过开始合成</li>\n</ul>\n<h2 id=\"发送文本\"><a href=\"#%E5%8F%91%E9%80%81%E6%96%87%E6%9C%AC\" aria-label=\"发送文本 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>发送文本</h2>\n<h3 id=\"客户端请求\"><a href=\"#%E5%AE%A2%E6%88%B7%E7%AB%AF%E8%AF%B7%E6%B1%82\" aria-label=\"客户端请求 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>客户端请求</h3>\n<ul>\n<li><strong>帧类型：</strong>Text</li>\n<li><strong>序列化方式：</strong>JSON</li>\n</ul>\n<h5 id=\"示例-4\"><a href=\"#%E7%A4%BA%E4%BE%8B-4\" aria-label=\"示例 4 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>示例</h5>\n\n    <div class=\"code-block-wrapper\">\n        <div class=\"code-block\">\n            <div class=\"code-block-header\">\n                <span class=\"code-block-name\">Text</span>\n                <button class=\"code-copy-btn\" data-tooltip-text=\"\">\n                    <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\"> <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M5.57894 3.45614C5.57894 3.38832 5.63392 3.33333 5.70175 3.33333H12.5439C12.6117 3.33333 12.6667 3.38832 12.6667 3.45614V10.2982C12.6667 10.3661 12.6117 10.4211 12.5439 10.4211H11.7544V5.70175C11.7544 4.89754 11.1025 4.24561 10.2982 4.24561H5.57894V3.45614ZM4.24561 4.24561V3.45614C4.24561 2.65194 4.89754 2 5.70175 2H12.5439C13.3481 2 14 2.65194 14 3.45614V10.2982C14 11.1025 13.3481 11.7544 12.5439 11.7544H11.7544V12.5439C11.7544 13.3481 11.1025 14 10.2982 14H3.45614C2.65194 14 2 13.3481 2 12.5439V5.70175C2 4.89754 2.65194 4.24561 3.45614 4.24561H4.24561ZM3.33333 5.70175C3.33333 5.63392 3.38832 5.57894 3.45614 5.57894H10.2982C10.3661 5.57894 10.4211 5.63392 10.4211 5.70175V12.5439C10.4211 12.6117 10.3661 12.6667 10.2982 12.6667H3.45614C3.38832 12.6667 3.33333 12.6117 3.33333 12.5439V5.70175Z\" fill=\"currentColor\"></path> </svg>\n                    复制\n                </button>\n            </div>\n            <div class=\"code-block-content\">\n                <pre class=\"language-text\"><code><span class=\"line-number\">1</span>{\n<span class=\"line-number\">2</span>    &quot;type&quot;: &quot;text&quot;,\n<span class=\"line-number\">3</span>    &quot;payload&quot;: {\n<span class=\"line-number\">4</span>        &quot;text&quot;: &quot;需要进行语音合成的文字&quot;\n<span class=\"line-number\">5</span>    }\n<span class=\"line-number\">6</span>}</code></pre>\n            </div>\n        </div>\n    </div>\n  \n<h5 id=\"参数说明-3\"><a href=\"#%E5%8F%82%E6%95%B0%E8%AF%B4%E6%98%8E-3\" aria-label=\"参数说明 3 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>参数说明</h5>\n<table>\n<thead>\n<tr>\n<th>参数名称</th>\n<th>类型</th>\n<th>是否必填</th>\n<th>说明</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>type</td>\n<td>string</td>\n<td>必填</td>\n<td>数据帧的类型，固定值  text</td>\n</tr>\n<tr>\n<td>payload</td>\n<td>array</td>\n<td>可选</td>\n<td>具体见下表</td>\n</tr>\n</tbody>\n</table>\n<h6 id=\"payload-字段说明-1\"><a href=\"#payload-%E5%AD%97%E6%AE%B5%E8%AF%B4%E6%98%8E-1\" aria-label=\"payload 字段说明 1 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>payload 字段说明</h6>\n<table>\n<thead>\n<tr>\n<th>参数名称</th>\n<th>类型</th>\n<th>是否必填</th>\n<th>说明</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>+ text</td>\n<td>string</td>\n<td>必填</td>\n<td>需要进行语音合成的文字，不超过1000字</td>\n</tr>\n</tbody>\n</table>\n<h3 id=\"服务端响应-1\"><a href=\"#%E6%9C%8D%E5%8A%A1%E7%AB%AF%E5%93%8D%E5%BA%94-1\" aria-label=\"服务端响应 1 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>服务端响应</h3>\n<h4 id=\"正常响应-1\"><a href=\"#%E6%AD%A3%E5%B8%B8%E5%93%8D%E5%BA%94-1\" aria-label=\"正常响应 1 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>正常响应</h4>\n\n    <div class=\"code-block-wrapper\">\n        <div class=\"code-block\">\n            <div class=\"code-block-header\">\n                <span class=\"code-block-name\">Text</span>\n                <button class=\"code-copy-btn\" data-tooltip-text=\"\">\n                    <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\"> <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M5.57894 3.45614C5.57894 3.38832 5.63392 3.33333 5.70175 3.33333H12.5439C12.6117 3.33333 12.6667 3.38832 12.6667 3.45614V10.2982C12.6667 10.3661 12.6117 10.4211 12.5439 10.4211H11.7544V5.70175C11.7544 4.89754 11.1025 4.24561 10.2982 4.24561H5.57894V3.45614ZM4.24561 4.24561V3.45614C4.24561 2.65194 4.89754 2 5.70175 2H12.5439C13.3481 2 14 2.65194 14 3.45614V10.2982C14 11.1025 13.3481 11.7544 12.5439 11.7544H11.7544V12.5439C11.7544 13.3481 11.1025 14 10.2982 14H3.45614C2.65194 14 2 13.3481 2 12.5439V5.70175C2 4.89754 2.65194 4.24561 3.45614 4.24561H4.24561ZM3.33333 5.70175C3.33333 5.63392 3.38832 5.57894 3.45614 5.57894H10.2982C10.3661 5.57894 10.4211 5.63392 10.4211 5.70175V12.5439C10.4211 12.6117 10.3661 12.6667 10.2982 12.6667H3.45614C3.38832 12.6667 3.33333 12.6117 3.33333 12.5439V5.70175Z\" fill=\"currentColor\"></path> </svg>\n                    复制\n                </button>\n            </div>\n            <div class=\"code-block-content\">\n                <pre class=\"language-text\"><code><span class=\"line-number\">1</span>WebSocket opcode`：`binary\n<span class=\"line-number\">2</span>WebSocket消息体：音频二进制数据</code></pre>\n            </div>\n        </div>\n    </div>\n  \n<h4 id=\"异常响应-1\"><a href=\"#%E5%BC%82%E5%B8%B8%E5%93%8D%E5%BA%94-1\" aria-label=\"异常响应 1 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>异常响应</h4>\n<h5 id=\"示例-5\"><a href=\"#%E7%A4%BA%E4%BE%8B-5\" aria-label=\"示例 5 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>示例</h5>\n\n    <div class=\"code-block-wrapper\">\n        <div class=\"code-block\">\n            <div class=\"code-block-header\">\n                <span class=\"code-block-name\">Text</span>\n                <button class=\"code-copy-btn\" data-tooltip-text=\"\">\n                    <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\"> <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M5.57894 3.45614C5.57894 3.38832 5.63392 3.33333 5.70175 3.33333H12.5439C12.6117 3.33333 12.6667 3.38832 12.6667 3.45614V10.2982C12.6667 10.3661 12.6117 10.4211 12.5439 10.4211H11.7544V5.70175C11.7544 4.89754 11.1025 4.24561 10.2982 4.24561H5.57894V3.45614ZM4.24561 4.24561V3.45614C4.24561 2.65194 4.89754 2 5.70175 2H12.5439C13.3481 2 14 2.65194 14 3.45614V10.2982C14 11.1025 13.3481 11.7544 12.5439 11.7544H11.7544V12.5439C11.7544 13.3481 11.1025 14 10.2982 14H3.45614C2.65194 14 2 13.3481 2 12.5439V5.70175C2 4.89754 2.65194 4.24561 3.45614 4.24561H4.24561ZM3.33333 5.70175C3.33333 5.63392 3.38832 5.57894 3.45614 5.57894H10.2982C10.3661 5.57894 10.4211 5.63392 10.4211 5.70175V12.5439C10.4211 12.6117 10.3661 12.6667 10.2982 12.6667H3.45614C3.38832 12.6667 3.33333 12.6117 3.33333 12.5439V5.70175Z\" fill=\"currentColor\"></path> </svg>\n                    复制\n                </button>\n            </div>\n            <div class=\"code-block-content\">\n                <pre class=\"language-text\"><code><span class=\"line-number\">1</span>{\n<span class=\"line-number\">2</span>    &quot;type&quot;: &quot;system.error&quot;,\n<span class=\"line-number\">3</span>    &quot;code&quot;: 216103,\n<span class=\"line-number\">4</span>    &quot;message&quot;: &quot;文本过长, 请控制在1000字以内&quot;,\n<span class=\"line-number\">5</span>    &quot;headers&quot;: {\n<span class=\"line-number\">6</span>        &quot;session_id&quot;: &quot;xxx&quot;\n<span class=\"line-number\">7</span>    }\n<span class=\"line-number\">8</span>}</code></pre>\n            </div>\n        </div>\n    </div>\n  \n<h5 id=\"异常响应列表-文本限制说明\"><a href=\"#%E5%BC%82%E5%B8%B8%E5%93%8D%E5%BA%94%E5%88%97%E8%A1%A8-%E6%96%87%E6%9C%AC%E9%99%90%E5%88%B6%E8%AF%B4%E6%98%8E\" aria-label=\"异常响应列表 文本限制说明 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>异常响应列表-文本限制说明</h5>\n<ol>\n<li>单次发送文本不超过1000汉字，若超过，下发提示帧【文本过长，请控制在1000字以内】</li>\n<li>未处理文本长度超过10000汉字后不处理新增文本，下发提示帧【当前待处理文本过长，请稍后发送】</li>\n</ol>\n<table>\n<thead>\n<tr>\n<th>type</th>\n<th>code</th>\n<th>message</th>\n<th>说明</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>text</td>\n<td>216101</td>\n<td>参数缺失</td>\n<td>缺少必需的参数</td>\n</tr>\n<tr>\n<td>text</td>\n<td>216103</td>\n<td>文本过长, 请控制在1000字以内</td>\n<td>单次文本不能超过1000字</td>\n</tr>\n<tr>\n<td>text</td>\n<td>216419</td>\n<td>当前待处理文本过长，请稍后发送</td>\n<td>发送频率过快，待处理文本过长</td>\n</tr>\n</tbody>\n</table>\n<h4 id=\"不响应-1\"><a href=\"#%E4%B8%8D%E5%93%8D%E5%BA%94-1\" aria-label=\"不响应 1 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>不响应</h4>\n<ul>\n<li>未发送开始合成就发送文本</li>\n<li>已经发送结束合成仍发送文本</li>\n<li>发送文本信息无内容</li>\n</ul>\n<h4 id=\"其他响应\"><a href=\"#%E5%85%B6%E4%BB%96%E5%93%8D%E5%BA%94\" aria-label=\"其他响应 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>其他响应</h4>\n<ul>\n<li>若发送文本信息无标点隔断，server等待标点或字符数变多（至少60字）再进行合成。有效的隔断标点如下：</li>\n</ul>\n\n    <div class=\"code-block-wrapper\">\n        <div class=\"code-block\">\n            <div class=\"code-block-header\">\n                <span class=\"code-block-name\">Text</span>\n                <button class=\"code-copy-btn\" data-tooltip-text=\"\">\n                    <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\"> <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M5.57894 3.45614C5.57894 3.38832 5.63392 3.33333 5.70175 3.33333H12.5439C12.6117 3.33333 12.6667 3.38832 12.6667 3.45614V10.2982C12.6667 10.3661 12.6117 10.4211 12.5439 10.4211H11.7544V5.70175C11.7544 4.89754 11.1025 4.24561 10.2982 4.24561H5.57894V3.45614ZM4.24561 4.24561V3.45614C4.24561 2.65194 4.89754 2 5.70175 2H12.5439C13.3481 2 14 2.65194 14 3.45614V10.2982C14 11.1025 13.3481 11.7544 12.5439 11.7544H11.7544V12.5439C11.7544 13.3481 11.1025 14 10.2982 14H3.45614C2.65194 14 2 13.3481 2 12.5439V5.70175C2 4.89754 2.65194 4.24561 3.45614 4.24561H4.24561ZM3.33333 5.70175C3.33333 5.63392 3.38832 5.57894 3.45614 5.57894H10.2982C10.3661 5.57894 10.4211 5.63392 10.4211 5.70175V12.5439C10.4211 12.6117 10.3661 12.6667 10.2982 12.6667H3.45614C3.38832 12.6667 3.33333 12.6117 3.33333 12.5439V5.70175Z\" fill=\"currentColor\"></path> </svg>\n                    复制\n                </button>\n            </div>\n            <div class=\"code-block-content\">\n                <pre class=\"language-text\"><code><span class=\"line-number\">1</span>, . 、? ! : ; ， 。 ？ ！ ： ； — …</code></pre>\n            </div>\n        </div>\n    </div>\n  \n<ul>\n<li>若5~6s内未接收到新文本，则强制以当前文本切句</li>\n</ul>\n<h2 id=\"结束合成\"><a href=\"#%E7%BB%93%E6%9D%9F%E5%90%88%E6%88%90\" aria-label=\"结束合成 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>结束合成</h2>\n<h3 id=\"客户端请求-1\"><a href=\"#%E5%AE%A2%E6%88%B7%E7%AB%AF%E8%AF%B7%E6%B1%82-1\" aria-label=\"客户端请求 1 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>客户端请求</h3>\n<ul>\n<li><strong>帧类型（Opcode）：</strong>Text</li>\n<li><strong>序列化方式：</strong>JSON</li>\n</ul>\n<h4 id=\"正常响应-2\"><a href=\"#%E6%AD%A3%E5%B8%B8%E5%93%8D%E5%BA%94-2\" aria-label=\"正常响应 2 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>正常响应</h4>\n<ul>\n<li>表示客户端没有文本需要合成了，客户端要求服务端立即合成所有缓存的文本；</li>\n<li>\n<p>注意事项：</p>\n<ul>\n<li>由于流式文本语音合成接口，服务端会分句合成音频，所以服务端会缓存客户端的文本，客户端需要再没有文本合成时，立刻发送此消息，否则可能丢失文本。</li>\n<li>客户端发送此消息后，服务端不在接收任何客户端后续请求。</li>\n</ul>\n</li>\n</ul>\n<h5 id=\"示例-6\"><a href=\"#%E7%A4%BA%E4%BE%8B-6\" aria-label=\"示例 6 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>示例</h5>\n\n    <div class=\"code-block-wrapper\">\n        <div class=\"code-block\">\n            <div class=\"code-block-header\">\n                <span class=\"code-block-name\">Text</span>\n                <button class=\"code-copy-btn\" data-tooltip-text=\"\">\n                    <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\"> <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M5.57894 3.45614C5.57894 3.38832 5.63392 3.33333 5.70175 3.33333H12.5439C12.6117 3.33333 12.6667 3.38832 12.6667 3.45614V10.2982C12.6667 10.3661 12.6117 10.4211 12.5439 10.4211H11.7544V5.70175C11.7544 4.89754 11.1025 4.24561 10.2982 4.24561H5.57894V3.45614ZM4.24561 4.24561V3.45614C4.24561 2.65194 4.89754 2 5.70175 2H12.5439C13.3481 2 14 2.65194 14 3.45614V10.2982C14 11.1025 13.3481 11.7544 12.5439 11.7544H11.7544V12.5439C11.7544 13.3481 11.1025 14 10.2982 14H3.45614C2.65194 14 2 13.3481 2 12.5439V5.70175C2 4.89754 2.65194 4.24561 3.45614 4.24561H4.24561ZM3.33333 5.70175C3.33333 5.63392 3.38832 5.57894 3.45614 5.57894H10.2982C10.3661 5.57894 10.4211 5.63392 10.4211 5.70175V12.5439C10.4211 12.6117 10.3661 12.6667 10.2982 12.6667H3.45614C3.38832 12.6667 3.33333 12.6117 3.33333 12.5439V5.70175Z\" fill=\"currentColor\"></path> </svg>\n                    复制\n                </button>\n            </div>\n            <div class=\"code-block-content\">\n                <pre class=\"language-text\"><code><span class=\"line-number\">1</span>{\n<span class=\"line-number\">2</span>    &quot;type&quot;:&quot;system.finish&quot;,\n<span class=\"line-number\">3</span>}</code></pre>\n            </div>\n        </div>\n    </div>\n  \n<h5 id=\"参数说明-4\"><a href=\"#%E5%8F%82%E6%95%B0%E8%AF%B4%E6%98%8E-4\" aria-label=\"参数说明 4 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>参数说明</h5>\n<table>\n<thead>\n<tr>\n<th>参数名称</th>\n<th>类型</th>\n<th>是否必填</th>\n<th>说明</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>type</td>\n<td>string</td>\n<td>必填</td>\n<td>结束帧的类型，固定值 system.finish</td>\n</tr>\n</tbody>\n</table>\n<h3 id=\"服务端响应-2\"><a href=\"#%E6%9C%8D%E5%8A%A1%E7%AB%AF%E5%93%8D%E5%BA%94-2\" aria-label=\"服务端响应 2 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>服务端响应</h3>\n<ul>\n<li><strong>帧类型：</strong>Text</li>\n<li><strong>序列化方式：</strong>JSON</li>\n</ul>\n<h4 id=\"正常响应-3\"><a href=\"#%E6%AD%A3%E5%B8%B8%E5%93%8D%E5%BA%94-3\" aria-label=\"正常响应 3 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>正常响应</h4>\n<ul>\n<li>服务端对客户端「合成结束」的响应，表示服务端已经完成所有文本的合成，且所有音频数据下发完毕。</li>\n</ul>\n<h5 id=\"示例-7\"><a href=\"#%E7%A4%BA%E4%BE%8B-7\" aria-label=\"示例 7 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>示例</h5>\n\n    <div class=\"code-block-wrapper\">\n        <div class=\"code-block\">\n            <div class=\"code-block-header\">\n                <span class=\"code-block-name\">Text</span>\n                <button class=\"code-copy-btn\" data-tooltip-text=\"\">\n                    <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\"> <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M5.57894 3.45614C5.57894 3.38832 5.63392 3.33333 5.70175 3.33333H12.5439C12.6117 3.33333 12.6667 3.38832 12.6667 3.45614V10.2982C12.6667 10.3661 12.6117 10.4211 12.5439 10.4211H11.7544V5.70175C11.7544 4.89754 11.1025 4.24561 10.2982 4.24561H5.57894V3.45614ZM4.24561 4.24561V3.45614C4.24561 2.65194 4.89754 2 5.70175 2H12.5439C13.3481 2 14 2.65194 14 3.45614V10.2982C14 11.1025 13.3481 11.7544 12.5439 11.7544H11.7544V12.5439C11.7544 13.3481 11.1025 14 10.2982 14H3.45614C2.65194 14 2 13.3481 2 12.5439V5.70175C2 4.89754 2.65194 4.24561 3.45614 4.24561H4.24561ZM3.33333 5.70175C3.33333 5.63392 3.38832 5.57894 3.45614 5.57894H10.2982C10.3661 5.57894 10.4211 5.63392 10.4211 5.70175V12.5439C10.4211 12.6117 10.3661 12.6667 10.2982 12.6667H3.45614C3.38832 12.6667 3.33333 12.6117 3.33333 12.5439V5.70175Z\" fill=\"currentColor\"></path> </svg>\n                    复制\n                </button>\n            </div>\n            <div class=\"code-block-content\">\n                <pre class=\"language-text\"><code><span class=\"line-number\">1</span>{\n<span class=\"line-number\">2</span>    &quot;type&quot;:&quot;system.finished&quot;,\n<span class=\"line-number\">3</span>    &quot;code&quot;: 0,\n<span class=\"line-number\">4</span>    &quot;message&quot;: &quot;success&quot;,\n<span class=\"line-number\">5</span>}</code></pre>\n            </div>\n        </div>\n    </div>\n  \n<h5 id=\"参数说明-5\"><a href=\"#%E5%8F%82%E6%95%B0%E8%AF%B4%E6%98%8E-5\" aria-label=\"参数说明 5 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>参数说明</h5>\n<table>\n<thead>\n<tr>\n<th>参数名称</th>\n<th>类型</th>\n<th>是否必填</th>\n<th>说明</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>type</td>\n<td>string</td>\n<td>必填</td>\n<td>结束帧的类型，固定值 system.finished</td>\n</tr>\n<tr>\n<td>code</td>\n<td>int</td>\n<td>必填</td>\n<td>错误码，0表示成功</td>\n</tr>\n<tr>\n<td>message</td>\n<td>string</td>\n<td>必填</td>\n<td>错误信息</td>\n</tr>\n</tbody>\n</table>\n<h4 id=\"异常响应-2\"><a href=\"#%E5%BC%82%E5%B8%B8%E5%93%8D%E5%BA%94-2\" aria-label=\"异常响应 2 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>异常响应</h4>\n<p>暂无</p>\n<h4 id=\"不响应-2\"><a href=\"#%E4%B8%8D%E5%93%8D%E5%BA%94-2\" aria-label=\"不响应 2 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>不响应</h4>\n<ul>\n<li>文本未合成完成，合成结束后会响应结束</li>\n</ul>\n<h2 id=\"断开连接\"><a href=\"#%E6%96%AD%E5%BC%80%E8%BF%9E%E6%8E%A5\" aria-label=\"断开连接 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>断开连接</h2>\n<h3 id=\"正常断开\"><a href=\"#%E6%AD%A3%E5%B8%B8%E6%96%AD%E5%BC%80\" aria-label=\"正常断开 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>正常断开</h3>\n<p>服务端响应结束合成后，会主动断开连接</p>\n<h3 id=\"异常断开\"><a href=\"#%E5%BC%82%E5%B8%B8%E6%96%AD%E5%BC%80\" aria-label=\"异常断开 permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>异常断开</h3>\n<p>客户端超过一分钟不发送消息，服务端会异常断开连接</p>","fields":{"slug":"Vmwbl4d4c","title":"流式文本在线合成","date":"2026-11-11","extractedHeadings":[]},"headings":[{"value":"接口描述","depth":1},{"value":"功能说明","depth":2},{"value":"示例代码","depth":2},{"value":"接口调用主流程","depth":1},{"value":"交互流程","depth":2},{"value":"握手建立连接","depth":2},{"value":"连接请求","depth":3},{"value":"请求地址","depth":4},{"value":"请求参数","depth":4},{"value":"请求示例","depth":4},{"value":"连接响应","depth":3},{"value":"示例","depth":5},{"value":"参数说明","depth":5},{"value":"初始化","depth":2},{"value":"客户端请求参数","depth":3},{"value":"示例","depth":5},{"value":"参数说明","depth":5},{"value":"payload 字段说明","depth":6},{"value":"服务端响应","depth":3},{"value":"正常响应","depth":4},{"value":"示例","depth":5},{"value":"参数说明","depth":5},{"value":"异常响应","depth":4},{"value":"示例","depth":5},{"value":"异常响应列表","depth":5},{"value":"不响应","depth":4},{"value":"发送文本","depth":2},{"value":"客户端请求","depth":3},{"value":"示例","depth":5},{"value":"参数说明","depth":5},{"value":"payload 字段说明","depth":6},{"value":"服务端响应","depth":3},{"value":"正常响应","depth":4},{"value":"异常响应","depth":4},{"value":"示例","depth":5},{"value":"异常响应列表-文本限制说明","depth":5},{"value":"不响应","depth":4},{"value":"其他响应","depth":4},{"value":"结束合成","depth":2},{"value":"客户端请求","depth":3},{"value":"正常响应","depth":4},{"value":"示例","depth":5},{"value":"参数说明","depth":5},{"value":"服务端响应","depth":3},{"value":"正常响应","depth":4},{"value":"示例","depth":5},{"value":"参数说明","depth":5},{"value":"异常响应","depth":4},{"value":"不响应","depth":4},{"value":"断开连接","depth":2},{"value":"正常断开","depth":3},{"value":"异常断开","depth":3}]}},"pageContext":{"isCreatedByStatefulCreatePages":false,"slug":"Vmwbl4d4c","prev":{"id":"2mwbl4d2n","name":"长文本语音合成-提交任务","path":"2mwbl4d2n","filePath":"模型/推理API（数据面）/在线推理/语音/语音合成/长文本语音合成-提交任务.md","seo":null,"parentIds":["Zmwbl43s8","xmwbl4528","Nmwbl45c6","Lmwbl4964","amwbl4cvl"],"parents":[{"id":"Zmwbl43s8","documentId":"0098c3f5-6f86-4ca0-ba61-8c65e07a87a5","name":"模型","repoName":"qianfan-api","filePath":"模型","disabled":false,"path":"Zmwbl43s8","lastMergeTime":null,"isApiDoc":null,"httpMethod":null,"seo":null,"sourceOrgName":null,"sourceRepoName":null,"sourceDocumentId":"","solutionTag":null,"solutionColor":null},{"id":"xmwbl4528","documentId":"202d7dd2-1164-424e-98f5-69ab44721f8a","name":"推理API（数据面）","repoName":"qianfan-api","filePath":"模型/推理API（数据面）","disabled":false,"path":"xmwbl4528","lastMergeTime":null,"isApiDoc":null,"httpMethod":null,"seo":null,"sourceOrgName":null,"sourceRepoName":null,"sourceDocumentId":"","solutionTag":null,"solutionColor":null},{"id":"Nmwbl45c6","documentId":"985bba32-c873-4e13-9148-0631067ca278","name":"在线推理","repoName":"qianfan-api","filePath":"模型/推理API（数据面）/在线推理","disabled":false,"path":"Nmwbl45c6","lastMergeTime":null,"isApiDoc":null,"httpMethod":null,"seo":null,"sourceOrgName":null,"sourceRepoName":null,"sourceDocumentId":"","solutionTag":null,"solutionColor":null},{"id":"Lmwbl4964","documentId":"238db9ce-a1e9-4ed4-a3d7-5138c285ae5a","name":"语音","repoName":"qianfan-api","filePath":"模型/推理API（数据面）/在线推理/语音","disabled":false,"path":"Lmwbl4964","lastMergeTime":null,"isApiDoc":null,"httpMethod":null,"seo":null,"sourceOrgName":null,"sourceRepoName":null,"sourceDocumentId":"","solutionTag":null,"solutionColor":null},{"id":"amwbl4cvl","documentId":"c4330d83-2370-4779-b2ce-65e3bb0b5c7f","name":"语音合成","repoName":"qianfan-api","filePath":"模型/推理API（数据面）/在线推理/语音/语音合成","disabled":false,"path":"amwbl4cvl","lastMergeTime":null,"isApiDoc":null,"httpMethod":null,"seo":null,"sourceOrgName":null,"sourceRepoName":null,"sourceDocumentId":"","solutionTag":null,"solutionColor":null}]},"next":{"id":"wmwbl4d5z","name":"语音识别","path":"wmwbl4d5z","filePath":"模型/推理API（数据面）/在线推理/语音/语音识别/音频文件转写-查询结果.md","seo":null,"parentIds":["Zmwbl43s8","xmwbl4528","Nmwbl45c6","Lmwbl4964","dmwbl4d5r"],"parents":[{"id":"Zmwbl43s8","documentId":"0098c3f5-6f86-4ca0-ba61-8c65e07a87a5","name":"模型","repoName":"qianfan-api","filePath":"模型","disabled":false,"path":"Zmwbl43s8","lastMergeTime":null,"isApiDoc":null,"httpMethod":null,"seo":null,"sourceOrgName":null,"sourceRepoName":null,"sourceDocumentId":"","solutionTag":null,"solutionColor":null},{"id":"xmwbl4528","documentId":"202d7dd2-1164-424e-98f5-69ab44721f8a","name":"推理API（数据面）","repoName":"qianfan-api","filePath":"模型/推理API（数据面）","disabled":false,"path":"xmwbl4528","lastMergeTime":null,"isApiDoc":null,"httpMethod":null,"seo":null,"sourceOrgName":null,"sourceRepoName":null,"sourceDocumentId":"","solutionTag":null,"solutionColor":null},{"id":"Nmwbl45c6","documentId":"985bba32-c873-4e13-9148-0631067ca278","name":"在线推理","repoName":"qianfan-api","filePath":"模型/推理API（数据面）/在线推理","disabled":false,"path":"Nmwbl45c6","lastMergeTime":null,"isApiDoc":null,"httpMethod":null,"seo":null,"sourceOrgName":null,"sourceRepoName":null,"sourceDocumentId":"","solutionTag":null,"solutionColor":null},{"id":"Lmwbl4964","documentId":"238db9ce-a1e9-4ed4-a3d7-5138c285ae5a","name":"语音","repoName":"qianfan-api","filePath":"模型/推理API（数据面）/在线推理/语音","disabled":false,"path":"Lmwbl4964","lastMergeTime":null,"isApiDoc":null,"httpMethod":null,"seo":null,"sourceOrgName":null,"sourceRepoName":null,"sourceDocumentId":"","solutionTag":null,"solutionColor":null},{"id":"dmwbl4d5r","documentId":"9eeb09fe-e077-4a12-b59f-58d58ff2dbab","name":"语音识别","repoName":"qianfan-api","filePath":"模型/推理API（数据面）/在线推理/语音/语音识别","disabled":false,"path":"dmwbl4d5r","lastMergeTime":null,"isApiDoc":null,"httpMethod":null,"seo":null,"sourceOrgName":null,"sourceRepoName":null,"sourceDocumentId":"","solutionTag":null,"solutionColor":null}]},"parents":[{"id":"Zmwbl43s8","documentId":"0098c3f5-6f86-4ca0-ba61-8c65e07a87a5","name":"模型","repoName":"qianfan-api","filePath":"模型","disabled":false,"path":"Zmwbl43s8","lastMergeTime":null,"isApiDoc":null,"httpMethod":null,"seo":null,"sourceOrgName":null,"sourceRepoName":null,"sourceDocumentId":"","solutionTag":null,"solutionColor":null},{"id":"xmwbl4528","documentId":"202d7dd2-1164-424e-98f5-69ab44721f8a","name":"推理API（数据面）","repoName":"qianfan-api","filePath":"模型/推理API（数据面）","disabled":false,"path":"xmwbl4528","lastMergeTime":null,"isApiDoc":null,"httpMethod":null,"seo":null,"sourceOrgName":null,"sourceRepoName":null,"sourceDocumentId":"","solutionTag":null,"solutionColor":null},{"id":"Nmwbl45c6","documentId":"985bba32-c873-4e13-9148-0631067ca278","name":"在线推理","repoName":"qianfan-api","filePath":"模型/推理API（数据面）/在线推理","disabled":false,"path":"Nmwbl45c6","lastMergeTime":null,"isApiDoc":null,"httpMethod":null,"seo":null,"sourceOrgName":null,"sourceRepoName":null,"sourceDocumentId":"","solutionTag":null,"solutionColor":null},{"id":"Lmwbl4964","documentId":"238db9ce-a1e9-4ed4-a3d7-5138c285ae5a","name":"语音","repoName":"qianfan-api","filePath":"模型/推理API（数据面）/在线推理/语音","disabled":false,"path":"Lmwbl4964","lastMergeTime":null,"isApiDoc":null,"httpMethod":null,"seo":null,"sourceOrgName":null,"sourceRepoName":null,"sourceDocumentId":"","solutionTag":null,"solutionColor":null},{"id":"amwbl4cvl","documentId":"c4330d83-2370-4779-b2ce-65e3bb0b5c7f","name":"语音合成","repoName":"qianfan-api","filePath":"模型/推理API（数据面）/在线推理/语音/语音合成","disabled":false,"path":"amwbl4cvl","lastMergeTime":null,"isApiDoc":null,"httpMethod":null,"seo":null,"sourceOrgName":null,"sourceRepoName":null,"sourceDocumentId":"","solutionTag":null,"solutionColor":null}],"specificSeo":null}}}