Skip to content

Commit 902629d

Browse files
Merge pull request #2344 from yulin-li/yulin/g722
[tts] add missed output formt g722-16khz-64kbps
2 parents 9d5e704 + aa5bd38 commit 902629d

File tree

1 file changed

+29
-28
lines changed

1 file changed

+29
-28
lines changed

articles/ai-services/speech-service/rest-text-to-speech.md

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ You can use the `tts.speech.microsoft.com/cognitiveservices/voices/list` endpoin
4141

4242
This table lists required and optional headers for text to speech requests:
4343

44-
| Header | Description | Required or optional |
45-
|--------|-------------|---------------------|
46-
| `Ocp-Apim-Subscription-Key` | Your Speech resource key. | Either this header or `Authorization` is required. |
47-
| `Authorization` | An authorization token preceded by the word `Bearer`. For more information, see [Authentication](#authentication). | Either this header or `Ocp-Apim-Subscription-Key` is required. |
44+
| Header | Description | Required or optional |
45+
| --------------------------- | ------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------- |
46+
| `Ocp-Apim-Subscription-Key` | Your Speech resource key. | Either this header or `Authorization` is required. |
47+
| `Authorization` | An authorization token preceded by the word `Bearer`. For more information, see [Authentication](#authentication). | Either this header or `Ocp-Apim-Subscription-Key` is required. |
4848

4949
### Request body
5050

@@ -73,7 +73,7 @@ curl --location --request GET 'https://YOUR_RESOURCE_REGION.tts.speech.microsoft
7373
You should receive a response with a JSON body that includes all supported locales, voices, gender, styles, and other details. The `WordsPerMinute` property for each voice can be used to estimate the length of the output speech. This JSON example shows partial results to illustrate the structure of a response:
7474

7575
```json
76-
[
76+
[
7777
// Redacted for brevity
7878
{
7979
"Name": "Microsoft Server Speech Text to Speech Voice (en-US, JennyNeural)",
@@ -191,13 +191,13 @@ You should receive a response with a JSON body that includes all supported local
191191

192192
The HTTP status code for each response indicates success or common errors.
193193

194-
| HTTP status code | Description | Possible reason |
195-
|------------------|-------------|-----------------|
196-
| 200 | OK | The request was successful. |
197-
| 400 | Bad request | A required parameter is missing, empty, or null. Or, the value passed to either a required or optional parameter is invalid. A common reason is a header that's too long. |
198-
| 401 | Unauthorized | The request isn't authorized. Make sure your resource key or token is valid and in the correct region. |
199-
| 429 | Too many requests | You exceeded the quota or rate of requests allowed for your resource. |
200-
| 502 | Bad gateway | There's a network or server-side problem. This status might also indicate invalid headers. |
194+
| HTTP status code | Description | Possible reason |
195+
| ---------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
196+
| 200 | OK | The request was successful. |
197+
| 400 | Bad request | A required parameter is missing, empty, or null. Or, the value passed to either a required or optional parameter is invalid. A common reason is a header that's too long. |
198+
| 401 | Unauthorized | The request isn't authorized. Make sure your resource key or token is valid and in the correct region. |
199+
| 429 | Too many requests | You exceeded the quota or rate of requests allowed for your resource. |
200+
| 502 | Bad gateway | There's a network or server-side problem. This status might also indicate invalid headers. |
201201

202202

203203
## Convert text to speech
@@ -214,12 +214,12 @@ These regions are supported for text to speech through the REST API. Be sure to
214214

215215
This table lists required and optional headers for text to speech requests:
216216

217-
| Header | Description | Required or optional |
218-
|--------|-------------|---------------------|
219-
| `Authorization` | An authorization token preceded by the word `Bearer`. For more information, see [Authentication](#authentication). | Required |
220-
| `Content-Type` | Specifies the content type for the provided text. Accepted value: `application/ssml+xml`. | Required |
221-
| `X-Microsoft-OutputFormat` | Specifies the audio output format. For a complete list of accepted values, see [Audio outputs](#audio-outputs). | Required |
222-
| `User-Agent` | The application name. The provided value must be fewer than 255 characters. | Required |
217+
| Header | Description | Required or optional |
218+
| -------------------------- | ------------------------------------------------------------------------------------------------------------------ | -------------------- |
219+
| `Authorization` | An authorization token preceded by the word `Bearer`. For more information, see [Authentication](#authentication). | Required |
220+
| `Content-Type` | Specifies the content type for the provided text. Accepted value: `application/ssml+xml`. | Required |
221+
| `X-Microsoft-OutputFormat` | Specifies the audio output format. For a complete list of accepted values, see [Audio outputs](#audio-outputs). | Required |
222+
| `User-Agent` | The application name. The provided value must be fewer than 255 characters. | Required |
223223

224224
### Request body
225225

@@ -250,21 +250,21 @@ User-Agent: <Your application name>
250250

251251
The HTTP status code for each response indicates success or common errors:
252252

253-
| HTTP status code | Description | Possible reason |
254-
|------------------|-------------|-----------------|
255-
| 200 | OK | The request was successful. The response body is an audio file. |
256-
| 400 | Bad request | A required parameter is missing, empty, or null. Or, the value passed to either a required or optional parameter is invalid. A common reason is a header that's too long. |
257-
| 401 | Unauthorized | The request isn't authorized. Make sure your Speech resource key or token is valid and in the correct region. |
258-
| 415 | Unsupported media type | It's possible that the wrong `Content-Type` value was provided. `Content-Type` should be set to `application/ssml+xml`. |
259-
| 429 | Too many requests | You exceeded the quota or rate of requests allowed for your resource. |
260-
| 502 | Bad gateway | There's a network or server-side problem. This status might also indicate invalid headers. |
261-
| 503 | Service Unavailable | There's a server-side problem for various reasons. |
253+
| HTTP status code | Description | Possible reason |
254+
| ---------------- | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
255+
| 200 | OK | The request was successful. The response body is an audio file. |
256+
| 400 | Bad request | A required parameter is missing, empty, or null. Or, the value passed to either a required or optional parameter is invalid. A common reason is a header that's too long. |
257+
| 401 | Unauthorized | The request isn't authorized. Make sure your Speech resource key or token is valid and in the correct region. |
258+
| 415 | Unsupported media type | It's possible that the wrong `Content-Type` value was provided. `Content-Type` should be set to `application/ssml+xml`. |
259+
| 429 | Too many requests | You exceeded the quota or rate of requests allowed for your resource. |
260+
| 502 | Bad gateway | There's a network or server-side problem. This status might also indicate invalid headers. |
261+
| 503 | Service Unavailable | There's a server-side problem for various reasons. |
262262

263263
If the HTTP status is `200 OK`, the body of the response contains an audio file in the requested format. This file can be played as it's transferred, saved to a buffer, or saved to a file.
264264

265265
## Audio outputs
266266

267-
The supported streaming and nonstreaming audio formats are sent in each request as the `X-Microsoft-OutputFormat` header. Each format incorporates a bit rate and encoding type. The Speech service supports 48-kHz, 24-kHz, 16-kHz, and 8-kHz audio outputs. Each prebuilt neural voice model is available at 24kHz and high-fidelity 48kHz.
267+
The supported streaming and nonstreaming audio formats are sent in each request as the `X-Microsoft-OutputFormat` header. Each format incorporates a bit rate and encoding type. The Speech service supports 48-kHz, 24-kHz, 16-kHz, and 8-kHz audio outputs. Each prebuilt neural voice model is available at 24kHz and high-fidelity 48kHz.
268268

269269
#### [Streaming](#tab/streaming)
270270

@@ -281,6 +281,7 @@ audio-24khz-96kbitrate-mono-mp3
281281
audio-24khz-160kbitrate-mono-mp3
282282
audio-48khz-96kbitrate-mono-mp3
283283
audio-48khz-192kbitrate-mono-mp3
284+
g722-16khz-64kbps
284285
ogg-16khz-16bit-mono-opus
285286
ogg-24khz-16bit-mono-opus
286287
ogg-48khz-16bit-mono-opus

0 commit comments

Comments
 (0)