

Be sure to select the endpoint that matches your Speech resource region. These regions are supported for text to speech through the REST API. The cognitiveservices/v1 endpoint allows you to convert text to speech by using Speech Synthesis Markup Language (SSML).

This status might also indicate invalid headers. There's a network or server-side problem. You have exceeded the quota or rate of requests allowed for your resource. Make sure your resource key or token is valid and in the correct region. A common reason is a header that's too long. Or, the value passed to either a required or optional parameter is invalid. HTTP status codeĪ required parameter is missing, empty, or null.
Speech to text api example code#
The HTTP status code for each response indicates success or common errors. "LocaleName": "Chinese (Mandarin, Simplified)", "Name": "Microsoft Server Speech Text to Speech Voice (zh-CN, YunxiNeural)", "Name": "Microsoft Server Speech Text to Speech Voice (ga-IE, OrlaNeural)", "ShortName": "en-US-JennyMultilingualNeural", "Name": "Microsoft Server Speech Text to Speech Voice (en-US, JennyMultilingualNeural)",

"Name": "Microsoft Server Speech Text to Speech Voice (en-US, JennyNeural)", This JSON example shows partial results to illustrate the structure of a response: [ The WordsPerMinute property for each voice can be used to estimate the length of the output speech. You should receive a response with a JSON body that includes all supported locales, voices, gender, styles, and other details. header 'Ocp-Apim-Subscription-Key: YOUR_RESOURCE_KEY' Here's an example curl command: curl -location -request GET '' \ Ocp-Apim-Subscription-Key: YOUR_RESOURCE_KEY This request requires only an authorization header: GET /cognitiveservices/voices/list HTTP/1.1 For more information, see Authentication.Įither this header or Ocp-Apim-Subscription-Key is required.Ī body isn't required for GET requests to this endpoint. This table lists required and optional headers for text to speech requests: HeaderĮither this header or Authorization is required.Īn authorization token preceded by the word Bearer. Voices and styles in preview are only available in three service regions: East US, West Europe, and Southeast Asia.
