您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

从语音翻译 API 迁移到语音服务Migrate from the Translator Speech API to the Speech service

本文介绍如何将应用程序从 Microsoft 语音翻译 API 迁移到语音服务Use this article to migrate your applications from the Microsoft Translator Speech API to the Speech service. 本指南概述了语音翻译 API 和语音服务之间的差异,并提供了有关迁移应用程序的策略。This guide outlines the differences between the Translator Speech API and Speech service, and suggests strategies for migrating your applications.

备注

语音服务不会接受你的语音翻译 API 订阅密钥。Your Translator Speech API subscription key won't be accepted by the Speech service. 需要创建新的语音服务订阅。You'll need to create a new Speech service subscription.

功能比较Comparison of features

FeatureFeature 语音翻译APITranslator Speech API 语音服务Speech service 详细信息Details
翻译为文本Translation to text ✔️ ✔️
翻译为语音Translation to speech ✔️ ✔️
全球终结点Global endpoint ✔️ 语音服务未提供全局终结点。The Speech service doesn't offer a global endpoint. 全球终结点可以自动将流量定向到最近的区域终结点,从而减少应用程序中的延迟。A global endpoint can automatically direct traffic to the nearest regional endpoint, decreasing latency in your application.
区域终结点Regional endpoints ✔️
连接时间限制Connection time limit 90 分钟90 minutes 使用 SDK 时,无限制。Unlimited with the SDK. 使用 WebSocket 连接时,限制为 10 分钟。10 minutes with a WebSockets connection.
头中的身份验证密钥Auth key in header ✔️ ✔️
在一个请求中翻译多种语言Multiple languages translated in a single request ✔️
可用 SDKSDKs available ✔️ 请参阅适用于 Sdk 的语音服务文档See the Speech service documentation for available SDKs.
WebSocket 连接WebSockets connections ✔️ ✔️
语言 APILanguages API ✔️ 语音服务支持 "转换器 API 语言参考" 一文中介绍的相同语言范围。The Speech service supports the same range of languages described in the Translator API languages reference article.
猥亵内容筛选器和标记Profanity Filter and Marker ✔️
.WAV/PCM 作为输入.WAV/PCM as input ✔️ ✔️
其他文件类型作为输入Other file types as input
部分结果Partial results ✔️ ✔️
计时信息Timing info ✔️
相关性 IDCorrelation ID ✔️
自定义语音模型Custom speech models ✔️ 语音服务提供自定义语音模型,使你能够自定义你组织的独特词汇的语音识别。The Speech service offers custom speech models that enable you to customize speech recognition to your organization’s unique vocabulary.
自定义翻译模型Custom translation models ✔️ 通过订阅 Microsoft 文本翻译 API,可使用自定义翻译工具,从而利用自己的数据提高翻译准确度。Subscribing to the Microsoft Text Translation API enables you to use Custom Translator to use your own data for more accurate translations.

迁移策略Migration strategies

如果你或你的组织在开发或生产环境中具有使用语音翻译 API 的应用程序,则应将其更新为使用语音服务。If you or your organization have applications in development or production that use the Translator Speech API, you should update them to use the Speech service. 请参阅语音服务文档,了解可用的 sdk、代码示例和教程。See the Speech service documentation for available SDKs, code samples, and tutorials. 迁移时请考虑以下事项:Consider the following when you are migrating:

  • 语音服务未提供全局终结点。The Speech service doesn't offer a global endpoint. 确定应用程序在使用一个区域终结点处理其所有流量的情况下,能否高效运行。Determine if your application functions efficiently when it uses a single regional endpoint for all of its traffic. 如果不能,则使用地理位置来确定最高效的终结点。If not, use geolocation to determine the most efficient endpoint.

  • 如果应用程序使用长期有效的连接但无法使用可用的 SDK,则可以使用 WebSocket 连接。If your application uses long-lived connections and can't use the available SDKs, you can use a WebSockets connection. 通过在适当的时间重新连接来管理 10 分钟的超时限制。Manage the 10-minute timeout limit by reconnecting at the appropriate times.

  • 如果你的应用程序使用文本翻译 API 和语音翻译 API 来启用自定义翻译模型,则可以使用语音服务直接添加类别 Id。If your application uses the Translator Text API and Translator Speech API to enable custom translation models, you can add Category IDs directly by using the Speech service.

  • 与语音翻译 API 不同,语音服务可以通过一个请求完成多种语言的翻译。Unlike the Translator Speech API, the Speech service can complete translations into multiple languages in a single request.

后续步骤Next steps

另请参阅See also