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

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

语音服务的使用既简单又经济。Using the Speech service is easy and affordable. 免费提供两个选项,以便您可以了解服务的作用,并决定它是否适合您的需要:There are two options available free of charge so you can discover what the service can do and decide whether it's right for your needs:

  • 免费试用,无需提供任何信用卡信息(需要拥有现有的 Azure 帐户)Get a free trial without providing any credit card info (you need to have an existing Azure account)
  • 免费创建新的 Azure 帐户(需要信用卡信息)Create a new Azure account at no charge for a trial period (credit card information required)

在本文中,你将选择最适合你的需求的选项之一。In this article, you'll choose one of these options that suits your needs best.

备注

语音服务有两个服务层:免费和订阅,它们具有不同的限制和优点。The Speech service has two service tiers: free and subscription, which have different limitations and benefits. 当你注册一个免费的 Azure 帐户时,它附带了 $200 服务信用额度,你可以将其应用于付费语音服务订阅,有效期为30天。When you sign up for a free Azure account it comes with $200 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 free trial or service credit expires.

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

试用语音服务,无需信用卡信息Try the Speech service without credit card info

尽管我们建议使用下一部分中的说明来尝试语音服务,但如果以下情况适用,你可能更愿意使用此部分的说明:Although we recommend trying the Speech service using the instructions in the next section, you may prefer this section's instructions if the following applies:

  • 你已有一个有效的 Azure 帐户。You already have an active Azure account.
  • 需要在不创建新 Azure 帐户的情况下评估语音服务。You want to evaluate the Speech service without creating a new Azure account.
  • 不需要使用信用卡,也不会在试用期后保存数据。You prefer no credit card be required and no data saved after trial period.

备注

在完成以下步骤后,你的试用期将立即开始。Your trial period starts immediately once the following steps are complete.

  1. 尝试 "试用认知服务"。Go to Try Cognitive Service.
  2. 选择“语音 API”选项卡。Select the Speech APIs tab.
  3. 选择 "获取 API 密钥"。Choose Get API Key.

系统会提供计费选项。You'll be presented with billing choices. 选择 "免费" 选项,然后阅读并批准用户协议。Choose the free option and then read and approve the user agreement. 你将看到一些密钥,你可以使用这些密钥在有限的时间里试用语音服务。You'll be presented with keys you can use to try the Speech service for a limited time.

使用新的 Azure 帐户试用语音服务Try the Speech service using a new Azure account

若要注册新的 Azure 帐户,需要 Microsoft 帐户。To sign up for a new Azure account, you will need a Microsoft account. 如果没有 Microsoft 帐户,则可以在Microsoft 帐户门户上免费注册一个帐户。If you do not have a Microsoft account, you can sign up for one free of charge at the Microsoft account portal. 选择Microsoft 登录然后在系统要求登录时,选择 "创建 Microsoft 帐户"。Select Sign in with Microsoft and then, when asked to sign in, select Create a Microsoft account. 按步骤创建并验证新的 Microsoft 帐户。Follow the steps to create and verify your new Microsoft account.

拥有 Microsoft 帐户后,请在Azure 注册页上,选择 "开始免费",然后使用 Microsoft 帐户创建新的 Azure 帐户。Once you have a Microsoft account, go to the Azure sign-up page, select Start free, and create a new Azure account using a Microsoft account.

在 Azure 中创建语音资源Create a Speech resource in Azure

备注

可在一个或多个区域中创建数量不受限的标准层订阅。You can create an unlimited number of standard-tier subscriptions in one or multiple regions. 但是,只能创建一个免费层订阅。However, you can create only one free-tier subscription. 不使用的免费层上的模型部署将自动解除授权。Model deployments on the free tier that remain unused for 7 days will be decommissioned automatically.

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

  1. 使用 Microsoft 帐户登录 Azure 门户Sign in to the Azure portal using your Microsoft 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. 窗口中,在搜索框中键入 "speech",然后按 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 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.

部署新的语音资源需要花费几分钟时间。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. 若要快速复制/粘贴代码编辑器或其他位置的密钥,请选择每个项旁边的 "复制" 按钮,切换 windows 将剪贴板内容粘贴到所需位置。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 free 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,请在创建语音配置时提供区域代码,例如 westusIf your application uses a Speech SDK, you provide the region code, such as westus, 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: