免费试用语音服务Try the Speech service for free''

在本文中,我们选择一个选项来轻松地免费测试语音服务,以便发现服务的功能:In this article, you choose an option to easily test the Speech service free of charge so you can discover what the service can do:

  • 选项 1:在 Azure 中创建新的语音资源,使用免费订阅(需要信用卡信息)。Option 1: Create a new Speech resource in Azure, at no charge using a free subscription (credit card information required). 免费订阅主要有比付费订阅更苛刻的速率限制。A free subscription mainly has stricter rate-limits than a paid subscription. 若要测试服务,计划在将来升级到付费订阅,并且不希望丢失数据,则可使用此选项。This option is best if you want to test the service, but also plan to upgrade to a paid subscription in the future, and don't want to lose data.

通过创建 Azure 资源来试用语音服务Try the Speech service by creating an Azure resource

若要执行以下步骤,你需要一个 Azure 帐户。请转到 Azure 注册页,创建一个新的 Azure 帐户。For the following steps, you need an Azure account, go to the Azure sign-up page, create a new Azure account.


语音服务有两个服务层级:免费和订阅,它们具有不同的限制和优势。The Speech service has two service tiers: free and subscription, which have different limitations and benefits. 注册免费的 Azure 帐户时,该帐户附带 1,500 个服务额度,可用于支付长达 30 天的付费语音服务订阅。When you sign up for a free Azure account it comes with 1,500 in service credit that you can apply toward a paid Speech service subscription, valid for up to 30 days.

如果使用免费的低容量“语音”服务层级,即使在试用或服务额度过期后,也可以保留此免费订阅。If you use the free, low-volume Speech service tier you can keep this free subscription even after your trial or service credit expires.

有关详细信息,请参阅认知服务定价 - 语音服务For more information, see Cognitive Services pricing - Speech service.

创建资源Create the resource

若要将语音服务资源(免费层或付费层)添加到 Azure 帐户,请执行以下步骤:To add a Speech service resource (free or paid tier) to your Azure account:

  1. 使用 Azure 帐户登录到 Azure 门户Sign in to the Azure portal using your Azure account.

  2. 选择门户左上角的“创建资源”。 Select Create a resource at the top left of the portal. 如果看不到“创建资源”,始终可以通过选择左上角的折叠菜单来找到它: If you do not see Create a resource, you can always find it by selecting the collapsed menu in the upper left:


  3. 在“新建”窗口中的搜索框内键入“语音”,然后按 ENTER。 In the New window, type "speech" in the search box and press ENTER.

  4. 在搜索结果中,选择“语音”。 In the search results, select Speech.


  5. 选择“创建”,然后: Select Create, then:

    • 为新资源指定唯一的名称。Give a unique name for your new resource. 名称有助于区分绑定到同一服务的多个订阅。The name helps you distinguish among multiple subscriptions tied to the same service.
    • 选择新资源关联的 Azure 订阅,以确定计费方式。Choose the Azure subscription that the new resource is associated with to determine how the fees are billed.
    • 选择将使用资源的区域Choose the region where the resource will be used.
    • 选择免费 (F0) 或付费 (S0) 定价层。Choose either a free (F0) or paid (S0) pricing tier. 若要查看每个层的定价和用量配额的完整信息,请选择“查看全部定价详细信息” 。For complete information about pricing and usage quotas for each tier, select View full pricing details.
    • 为此“语音”订阅创建新的资源组或将订阅分配到现有资源组。Create a new resource group for this Speech subscription or assign the subscription to an existing resource group. 资源组有助于使多种 Azure 订阅保持有序状态。Resource groups help you keep your various Azure subscriptions organized.
    • 选择“创建” 。Select Create. 系统随后会将你转到部署概述,并显示部署进度消息。This will take you to the deployment overview and display deployment progress messages.


可在一个或多个区域中创建数量不受限的标准层订阅。You can create an unlimited number of standard-tier subscriptions in one or multiple regions. 但是,只能创建一个免费层订阅。However, you can create only one free-tier subscription. 在免费层上进行的模型部署如果连续 7 天处于未使用状态,则会被系统自动停用。Model deployments on the free tier that remain unused for 7 days will be decommissioned automatically.

部署新的语音资源需要花费片刻时间。It takes a few moments to deploy your new Speech resource. 部署完成后,选择“转到资源”,然后在左侧导航窗格中选择“密钥”以显示语音服务订阅密钥。 Once deployment is complete, select Go to resource and in the left navigation pane select Keys to display your Speech service subscription keys. 每个订阅有两个密钥;可在应用程序中使用任意一个密钥。Each subscription has two keys; you can use either key in your application. 若要将密钥快速复制/粘贴到代码编辑器或其他位置,请选择每个密钥旁边的复制按钮,切换窗口,然后将剪贴板中的内容粘贴到所需位置。To quickly copy/paste a key to your code editor or other location, select the copy button next to each key, switch windows to paste the clipboard contents to the desired location.


这些订阅密钥用于访问认知服务 API。These subscription keys are used to access your Cognitive Service API. 不要共享你的密钥。Do not share your keys. 安全存储密钥 - 例如,使用 Azure Key Vault。Store them securely– for example, using Azure Key Vault. 此外,我们建议定期重新生成这些密钥。We also recommend regenerating these keys regularly. 发出 API 调用只需一个密钥。Only one key is necessary to make an API call. 重新生成第一个密钥时,可以使用第二个密钥来持续访问服务。When regenerating the first key, you can use the second key for continued access to the service.

切换到新订阅Switch to a new subscription

若要从一个订阅切换到另一个订阅(例如,在试用到期时或发布应用程序时),请将代码中的区域和订阅密钥替换为新 Azure 资源的区域和订阅密钥。To switch from one subscription to another, for example when your trial expires or when you publish your application, replace the region and subscription key in your code with the region and subscription key of the new Azure resource.

关于区域About regions

  • 如果应用程序使用语音 SDK,请在创建语音配置时提供区域代码,例如 chinaeast2If your application uses a Speech SDK, you provide the region code, such as chinaeast2, when creating a speech configuration.
  • 如果应用程序使用某个语音服务的 REST API,则区域是你在发出请求时使用的终结点 URI 的一部分。If your application uses one of the Speech service's REST APIs, the region is part of the endpoint URI you use when making requests.
  • 为某个区域创建的密钥仅在该区域有效。Keys created for a region are valid only in that region. 尝试在其他区域使用此类密钥会导致身份验证错误。Attempting to use them with other regions will result in authentication errors.

后续步骤Next steps

完成我们的 10 分钟快速入门之一,或查看我们的 SDK 示例:Complete one of our 10-minute quickstarts or check out our SDK samples: