可以提交给 TTS(神经)语音服务端点的文本数量是否有限制?
我从 Azure 函数发出的所有请求都是成功的,但恰好在 10 分钟时截止。
是的,在旧的 Bing Speech API documentation 中指出,语音服务对与服务的 WebSocket 连接的持续时间进行了限制,活动 WebSocket 连接的最长持续时间为 10 分钟,非活动连接的最长持续时间为 180 秒.
更新
在新的语音服务文档中也说明访问令牌的有效期为 10 分钟。
如果您使用 docs
中的 javascriptMicrosoft Speech API 的 JavaScript 服务包装器。它是一个 特别是 Speech Websocket API 的实现,它 支持最长10分钟的长语音识别
TTS 文档 说:
Asynchronous synthesis of long audio: Use the batch synthesis API (Preview) to asynchronously synthesize text-to-speech files longer than 10 minutes
.
批量合成 API 文档 说:
The Batch synthesis API ... can synthesize a large volume of text input (long and short) asynchronously... create synthesized audio longer than 10 minutes
.
所以我相信这意味着同步 TTS API 最多只能处理 10 分钟的音频。在我的例子中,TTSing 长文本给了我 HTTP 状态代码 200,响应是通过分块传输编码发送的,大约 10 秒后它在
System.Net.Http.HttpRequestException: Error while copying content to a stream. ---> System.IO.IOException: The response ended prematurely.
上失败了,所以我认为 TTS 后端正在从文本生成音频,并且有一次音频超过 10 分钟,抛出异常并关闭连接。