You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cognitive-services/Speech-Service/rest-speech-to-text.md
+26-32Lines changed: 26 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ manager: nitinme
8
8
ms.service: cognitive-services
9
9
ms.subservice: speech-service
10
10
ms.topic: conceptual
11
-
ms.date: 12/09/2019
11
+
ms.date: 03/03/2020
12
12
ms.author: erhopf
13
13
---
14
14
@@ -49,6 +49,7 @@ These parameters may be included in the query string of the REST request.
49
49
|`language`| Identifies the spoken language that is being recognized. See [Supported languages](language-support.md#speech-to-text). | Required |
50
50
|`format`| Specifies the result format. Accepted values are `simple` and `detailed`. Simple results include `RecognitionStatus`, `DisplayText`, `Offset`, and `Duration`. Detailed responses include multiple results with confidence values and four different representations. The default setting is `simple`. | Optional |
51
51
|`profanity`| Specifies how to handle profanity in recognition results. Accepted values are `masked`, which replaces profanity with asterisks, `removed`, which removes all profanity from the result, or `raw`, which includes the profanity in the result. The default setting is `masked`. | Optional |
52
+
|`cid`| When using the [Custom Speech portal](how-to-custom-speech.md) to create custom models, you can use custom models via their **Endpoint ID** found on the **Deployment** page. Use the **Endpoint ID** as the argument to the `cid` query string parameter. | Optional |
52
53
53
54
## Request headers
54
55
@@ -67,10 +68,10 @@ This table lists required and optional headers for speech-to-text requests.
67
68
68
69
Audio is sent in the body of the HTTP `POST` request. It must be in one of the formats in this table:
69
70
70
-
| Format | Codec | Bitrate | Sample Rate |
71
-
|--------|-------|---------|-------------|
72
-
| WAV | PCM | 16-bit | 16 kHz, mono |
73
-
| OGG | OPUS | 16-bit | 16 kHz, mono |
71
+
| Format | Codec | Bitrate | Sample Rate |
72
+
|--------|-------|---------|--------------|
73
+
| WAV | PCM | 16-bit| 16 kHz, mono |
74
+
| OGG | OPUS | 16-bit| 16 kHz, mono |
74
75
75
76
>[!NOTE]
76
77
>The above formats are supported through REST API and WebSocket in the Speech service. The [Speech SDK](speech-sdk.md) currently supports the WAV format with PCM codec as well as [other formats](how-to-use-codec-compressed-audio-input-streams.md).
@@ -95,50 +96,43 @@ The HTTP status code for each response indicates success or common errors.
95
96
96
97
| HTTP status code | Description | Possible reason |
|`100`| Continue | The initial request has been accepted. Proceed with sending the rest of the data. (Used with chunked transfer) |
100
+
|`200`| OK | The request was successful; the response body is a JSON object. |
101
+
|`400`| Bad request | Language code not provided, not a supported language, invalid audio file, etc. |
102
+
|`401`| Unauthorized | Subscription key or authorization token is invalid in the specified region, or invalid endpoint. |
103
+
|`403`| Forbidden | Missing subscription key or authorization token. |
103
104
104
105
## Chunked transfer
105
106
106
107
Chunked transfer (`Transfer-Encoding: chunked`) can help reduce recognition latency. It allows the Speech service to begin processing the audio file while it is transmitted. The REST API does not provide partial or interim results.
107
108
108
-
This code sample shows how to send audio in chunks. Only the first chunk should contain the audio file's header. `request` is an HTTPWebRequest object connected to the appropriate REST endpoint. `audioFile` is the path to an audio file on disk.
109
+
This code sample shows how to send audio in chunks. Only the first chunk should contain the audio file's header. `request` is an `HttpWebRequest` object connected to the appropriate REST endpoint. `audioFile` is the path to an audio file on disk.
0 commit comments