集成第三方文字转语音服务
IBM® Voice Gateway 支持使用语音适配器来集成第三方语音合成(文字转语音)服务以替换 IBM® Text to Speech 服务。适配器是与 Voice Gateway 一起部署的单独 Docker 容器,并且充当介于 Voice Gateway 和第三方语音服务之间的代理。
Voice Gateway 提供以下选项以用于集成第三方语音服务:
Voice Gateway Text to Speech Adapter:Text to Speech Adapter 当前支持 Google Text to Speech API 从文本将语音合成为音频。通过使用 Google Text to Speech API,可以为自助服务代理程序选择其他语音。V1.0.0.7a 和更高版本。
Text to Speech Adapter
Text to Speech Adapter 体系结构
使用 Text to Speech 时,Voice Gateway 中的 Media Relay 容器使用 WebSocket 连接将数据路由到 Text to Speech。通过使用 Text to Speech Adapter,可以将 Voice Gateway 部署连接到第三方文字转语音提供程序。Media Relay 使用 WebSocket 连接来连接到 Text to Speech Adapter,而不是使用 WebSocket 连接将部署集成到 Text to Speech。然后,此适配器使用与第三方文字转语音服务的 gRPC 连接来合成音频并将其返回到 Media Relay,由 Media Relay 将音频传送到呼叫者。
在以下示例中,Text to Speech Adapter 将 Voice Gateway 与 Google Text to Speech Beta 服务进行连接。

部署 Text to Speech Adapter
Voice Gateway Text to Speech Adapter 封装为单独 Docker 映像,您需要与核心 SIP Orchestrator 和 Media Relay 映像一起配置和部署此映像。部署 Text to Speech Adapter 之前,请部署基本 Voice Gateway 实例,如 Voice Gateway 入门中所述。然后,在以下页面中详细了解如何将 Text to Speech Adapter 添加到部署中:
- 在 Docker 上部署 Text to Speech Adapter
- 将 Text to Speech Adapter 部署到 IBM Cloud Kubernetes Service 中的 Kubernetes
配置 Text to Speech Adapter
要设置 Text to Speech Adapter,可以定义以下类型的配置。
- 部署配置,用于定义 Text to Speech Adapter 容器并指定为 Docker 环境变量。有关更多信息,请参阅 Text to Speech Adapter 环境变量。
- JSON 配置,可指定以在单个 Voice Gateway 环境中单独配置多个租户。有关更多信息,请参阅设置多租户环境。
- 动态配置,使您能够通过在 Watson Assistant 对话节点响应中指定 API 操作和状态变量,以便能够呼叫期间更改设置。有关更多信息,请参阅使用 Voice Gateway API 对自助服务代理程序进行编程。