Public Authentication(string subscriptionKey) Public static readonly string FetchTokenUri = If your subscription isn't in the West US region, change the value of FetchTokenUri to match the region for your subscription. Pass your subscription key for the Speech service when you instantiate the class.
#How to get anonymous voice tts how to
This C# class illustrates how to get an access token. H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" H "Content-type: application/x-www-form-urlencoded" \ This example is currently set to West US. Make sure to use the correct endpoint for the region that matches your subscription. Replace YOUR_SUBSCRIPTION_KEY with your subscription key for the Speech service. This cURL command illustrates how to get an access token.
![how to get anonymous voice tts how to get anonymous voice tts](https://wow.zamimg.com/uploads/screenshots/normal/1021181.jpg)
#How to get anonymous voice tts windows
$OAuthToken = Invoke-RestMethod -Method POST -Uri ĬURL is a command-line tool available in Linux (and in the Windows Subsystem for Linux).
![how to get anonymous voice tts how to get anonymous voice tts](https://i.ytimg.com/vi/Scd_7imJM3c/maxresdefault.jpg)
This example is a simple PowerShell script to get an access token. The body of the response contains the access token in JSON Web Token (JWT) format. Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEYĬontent-type: application/x-www-form-urlencoded If your subscription isn't in the West US region, replace the Host header with your region's host name. This example is a simple HTTP request to get a token. Use the following samples to create your access token request. The issueToken endpoint has this format: Replace with the identifier that matches the region of your subscription from this table: Geography To get an access token, you need to make a request to the issueToken endpoint by using Ocp-Apim-Subscription-Key and your subscription key. In this request, you exchange your subscription key for an access token that's valid for 10 minutes. When you're using the Authorization: Bearer header, you're required to make a request to the issueToken endpoint. For example: 'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY' When you're using the Ocp-Apim-Subscription-Key header, you're only required to provide your subscription key. This table illustrates which headers are supported for each feature: Supported authorization header AuthenticationĮach request requires an authorization header. For more information, see Speech service pricing.īefore you use the text-to-speech REST API, understand that you need to complete a token exchange as part of authentication to access the service.
![how to get anonymous voice tts how to get anonymous voice tts](https://api.abilitynet.org.uk/sites/default/files/inline-images/mcmw_text_to_speech_in_android_pie_fig_9.png)
Costs vary for prebuilt neural voices (called Neural on the pricing page) and custom neural voices (called Custom Neural on the pricing page).