Skip to content

Commit 16a3db2

Browse files
Merge pull request #220979 from eric-urban/eur/tsg-updates
update TSG with frequent issues
2 parents 6658b27 + 6328cb7 commit 16a3db2

File tree

6 files changed

+78
-74
lines changed

6 files changed

+78
-74
lines changed

articles/cognitive-services/Speech-Service/includes/quickstarts/speech-to-text-basics/cpp.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ The Speech SDK is available as a [NuGet package](https://www.nuget.org/packages/
3131

3232
Follow these steps to create a new console application and install the Speech SDK.
3333

34-
1. Create a new C++ console project in Visual Studio.
34+
1. Create a new C++ console project in Visual Studio Community 2022 named `SpeechRecognition`.
3535
1. Install the Speech SDK in your new project with the NuGet package manager.
3636
```powershell
3737
Install-Package Microsoft.CognitiveServices.Speech
3838
```
39-
1. Replace the contents of `main.cpp` with the following code:
39+
1. Replace the contents of `SpeechRecognition.cpp` with the following code:
4040
4141
```cpp
4242
#include <iostream>

articles/cognitive-services/Speech-Service/includes/quickstarts/speech-translation-basics/cpp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The Speech SDK is available as a [NuGet package](https://www.nuget.org/packages/
2525

2626
Follow these steps to create a new console application and install the Speech SDK.
2727

28-
1. Create a new C++ console project in Visual Studio named `SpeechTranslation`.
28+
1. Create a new C++ console project in Visual Studio Community 2022 named `SpeechTranslation`.
2929
1. Install the Speech SDK in your new project with the NuGet package manager.
3030
```powershell
3131
Install-Package Microsoft.CognitiveServices.Speech

articles/cognitive-services/Speech-Service/includes/quickstarts/text-to-speech-basics/cpp.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ The Speech SDK is available as a [NuGet package](https://www.nuget.org/packages/
3131

3232
Follow these steps to create a new console application and install the Speech SDK.
3333

34-
1. Create a new C++ console project in Visual Studio.
34+
1. Create a new C++ console project in Visual Studio Community 2022 named `SpeechSynthesis`.
3535
1. Install the Speech SDK in your new project with the NuGet package manager.
3636
```powershell
3737
Install-Package Microsoft.CognitiveServices.Speech
3838
```
39-
1. Replace the contents of `main.cpp` with the following code:
39+
1. Replace the contents of `SpeechSynthesis.cpp` with the following code:
4040
4141
```cpp
4242
#include <iostream>

articles/cognitive-services/Speech-Service/language-support.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,11 @@ Custom Neural Voice lets you create synthetic voices that are rich in speaking s
6565

6666
Select the right locale that matches your training data to train a custom neural voice model. For example, if the recording data is spoken in English with a British accent, select `en-GB`.
6767

68-
With the cross-lingual feature (preview), you can transfer your custom neural voice model to speak a second language. For example, with the `zh-CN` data, you can create a voice that speaks `en-AU` or any of the languages with Cross-lingual support.
68+
With the cross-lingual feature (preview), you can transfer your custom neural voice model to speak a second language. For example, with the `zh-CN` data, you can create a voice that speaks `en-AU` or any of the languages with Cross-lingual support.
69+
70+
### Get locales via API and SDK
71+
72+
You can also get a list of locales and voices supported for each specific region or endpoint through the [Speech SDK](speech-sdk.md), [Speech-to-text REST API](rest-speech-to-text.md), [Speech-to-text REST API for short audio](rest-speech-to-text-short.md) and [Text-to-speech REST API](rest-text-to-speech.md#get-a-list-of-voices).
6973

7074
# [Pronunciation assessment](#tab/pronunciation-assessment)
7175

@@ -115,10 +119,6 @@ The table in this section summarizes the locales supported for the Intent Recogn
115119

116120
***
117121

118-
## Get locales via API and SDK
119-
120-
You can also get a list of locales and voices supported for each specific region or endpoint through the [Speech SDK](speech-sdk.md), [Speech-to-text REST API](rest-speech-to-text.md), [Speech-to-text REST API for short audio](rest-speech-to-text-short.md) and [Text-to-speech REST API](rest-text-to-speech.md#get-a-list-of-voices).
121-
122122
## Next steps
123123

124124
* [Region support](regions.md)

articles/cognitive-services/Speech-Service/toc.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ items:
364364
href: how-to-use-logging.md
365365
- name: Troubleshoot the Speech SDK
366366
href: troubleshooting.md
367+
displayName: help, faq, tsg, error
367368
- name: Get Speech-to-text Session ID
368369
href: how-to-get-speech-session-id.md
369370
- name: Track memory usage
@@ -373,7 +374,7 @@ items:
373374
displayName: RHEL, CentOS 7, CentOS, Configure RHEL, Configure CentO
374375
- name: Generate a REST API client library
375376
href: swagger-documentation.md
376-
displayName: rest
377+
displayName: rest, swagger
377378
- name: Embedded Speech
378379
href: embedded-speech.md
379380
- name: Speech containers

articles/cognitive-services/Speech-Service/troubleshooting.md

Lines changed: 66 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,29 @@ title: Troubleshoot the Speech SDK - Speech service
33
titleSuffix: Azure Cognitive Services
44
description: This article provides information to help you solve issues you might encounter when you use the Speech SDK.
55
services: cognitive-services
6-
author: jhakulin
6+
author: eric-urban
77
manager: nitinme
88
ms.service: cognitive-services
99
ms.subservice: speech-service
1010
ms.topic: how-to
11-
ms.date: 07/23/2019
12-
ms.author: jhakulin
11+
ms.date: 12/08/2022
12+
ms.author: eur
1313
---
1414

1515
# Troubleshoot the Speech SDK
1616

1717
This article provides information to help you solve issues you might encounter when you use the Speech SDK.
1818

19-
## Error: WebSocket Upgrade failed with an authentication error (403)
19+
## Authentication failed
2020

21-
You might have the wrong endpoint for your region or service. Check the URI to make sure it's correct.
21+
You might observe one of several authentication errors, depending on the programming environment, API, or SDK. Here are some example errors:
22+
- Did you set the speech resource key and region values?
23+
- AuthenticationFailure
24+
- HTTP 403 Forbidden or HTTP 401 Unauthorized. Connection requests without a valid `Ocp-Apim-Subscription-Key` or `Authorization` header are rejected with a status of 403 or 401.
25+
- ValueError: cannot construct SpeechConfig with the given arguments (or a variation of this message). This error could be observed, for example, when you run one of the Speech SDK for Python quickstarts without setting environment variables. You might also see it when you set the environment variables to something invalid such as your key or region.
26+
- Exception with an error code: 0x5. This access denied error could be observed, for example, when you run one of the Speech SDK for C# quickstarts without setting environment variables.
2227

23-
Also, there might be a problem with your Speech resource key or authorization token. For more information, see the next section.
24-
25-
## Error: HTTP 403 Forbidden or HTTP 401 Unauthorized
26-
27-
This error often is caused by authentication issues. Connection requests without a valid `Ocp-Apim-Subscription-Key` or `Authorization` header are rejected with a status of 403 or 401.
28-
29-
* If you're using a resource key for authentication, you might see the error because:
30-
31-
- The key is missing or invalid
32-
- You have exceeded your resource's usage quota
33-
34-
* If you're using an authorization token for authentication, you might see the error because:
35-
36-
- The authorization token is invalid
37-
- The authorization token is expired
28+
For baseline authentication troubleshooting tips, see [validate your resource key](#validate-your-resource-key) and [validate an authorization token](#validate-an-authorization-token). For more information about confirming credentials, see [get the keys for your resource](../cognitive-services-apis-create-account.md?tabs=speech#get-the-keys-for-your-resource).
3829

3930
### Validate your resource key
4031

@@ -43,80 +34,92 @@ You can verify that you have a valid resource key by running one of the followin
4334
> [!NOTE]
4435
> Replace `YOUR_RESOURCE_KEY` and `YOUR_REGION` with your own resource key and associated region.
4536
46-
* PowerShell
37+
# [PowerShell](#tab/powershell)
38+
39+
```powershell
40+
$FetchTokenHeader = @{
41+
'Content-type'='application/x-www-form-urlencoded'
42+
'Content-Length'= '0'
43+
'Ocp-Apim-Subscription-Key' = 'YOUR_RESOURCE_KEY'
44+
}
45+
$OAuthToken = Invoke-RestMethod -Method POST -Uri https://YOUR_REGION.api.cognitive.microsoft.com/sts/v1.0/issueToken -Headers $FetchTokenHeader
46+
$OAuthToken
47+
```
4748

48-
```powershell
49-
$FetchTokenHeader = @{
50-
'Content-type'='application/x-www-form-urlencoded'
51-
'Content-Length'= '0'
52-
'Ocp-Apim-Subscription-Key' = 'YOUR_RESOURCE_KEY'
53-
}
54-
$OAuthToken = Invoke-RestMethod -Method POST -Uri https://YOUR_REGION.api.cognitive.microsoft.com/sts/v1.0/issueToken -Headers $FetchTokenHeader
55-
$OAuthToken
56-
```
49+
# [cURL](#tab/curl)
5750

58-
* cURL
51+
```
52+
curl -v -X POST "https://YOUR_REGION.api.cognitive.microsoft.com/sts/v1.0/issueToken" -H "Ocp-Apim-Subscription-Key: YOUR_RESOURCE_KEY" -H "Content-type: application/x-www-form-urlencoded" -H "Content-Length: 0"
53+
```
5954

60-
```
61-
curl -v -X POST "https://YOUR_REGION.api.cognitive.microsoft.com/sts/v1.0/issueToken" -H "Ocp-Apim-Subscription-Key: YOUR_RESOURCE_KEY" -H "Content-type: application/x-www-form-urlencoded" -H "Content-Length: 0"
62-
```
55+
---
6356

6457
If you entered a valid resource key, the command returns an authorization token, otherwise an error is returned.
6558

6659
### Validate an authorization token
6760

61+
If you're using an authorization token for authentication, you might see an authentication error because:
62+
- The authorization token is invalid
63+
- The authorization token is expired
64+
6865
If you use an authorization token for authentication, run one of the following commands to verify that the authorization token is still valid. Tokens are valid for 10 minutes.
6966

7067
> [!NOTE]
7168
> Replace `YOUR_AUDIO_FILE` with the path to your prerecorded audio file. Replace `YOUR_ACCESS_TOKEN` with the authorization token returned in the preceding step. Replace `YOUR_REGION` with the correct region.
7269
73-
* PowerShell
70+
# [PowerShell](#tab/powershell)
71+
72+
```powershell
73+
$SpeechServiceURI =
74+
'https://YOUR_REGION.stt.speech.microsoft.com/speech/recognition/interactive/cognitiveservices/v1?language=en-US'
7475
75-
```powershell
76-
$SpeechServiceURI =
77-
'https://YOUR_REGION.stt.speech.microsoft.com/speech/recognition/interactive/cognitiveservices/v1?language=en-US'
76+
# $OAuthToken is the authorization token returned by the token service.
77+
$RecoRequestHeader = @{
78+
'Authorization' = 'Bearer '+ $OAuthToken
79+
'Transfer-Encoding' = 'chunked'
80+
'Content-type' = 'audio/wav; codec=audio/pcm; samplerate=16000'
81+
}
7882
79-
# $OAuthToken is the authorization token returned by the token service.
80-
$RecoRequestHeader = @{
81-
'Authorization' = 'Bearer '+ $OAuthToken
82-
'Transfer-Encoding' = 'chunked'
83-
'Content-type' = 'audio/wav; codec=audio/pcm; samplerate=16000'
84-
}
83+
# Read audio into byte array.
84+
$audioBytes = [System.IO.File]::ReadAllBytes("YOUR_AUDIO_FILE")
8585
86-
# Read audio into byte array.
87-
$audioBytes = [System.IO.File]::ReadAllBytes("YOUR_AUDIO_FILE")
86+
$RecoResponse = Invoke-RestMethod -Method POST -Uri $SpeechServiceURI -Headers $RecoRequestHeader -Body $audioBytes
8887
89-
$RecoResponse = Invoke-RestMethod -Method POST -Uri $SpeechServiceURI -Headers $RecoRequestHeader -Body $audioBytes
88+
# Show the result.
89+
$RecoResponse
90+
```
9091

91-
# Show the result.
92-
$RecoResponse
93-
```
92+
# [cURL](#tab/curl)
9493

95-
* cURL
94+
```
95+
curl -v -X POST "https://YOUR_REGION.stt.speech.microsoft.com/speech/recognition/interactive/cognitiveservices/v1?language=en-US" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Transfer-Encoding: chunked" -H "Content-type: audio/wav; codec=audio/pcm; samplerate=16000" --data-binary @YOUR_AUDIO_FILE
96+
```
9697

97-
```
98-
curl -v -X POST "https://YOUR_REGION.stt.speech.microsoft.com/speech/recognition/interactive/cognitiveservices/v1?language=en-US" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Transfer-Encoding: chunked" -H "Content-type: audio/wav; codec=audio/pcm; samplerate=16000" --data-binary @YOUR_AUDIO_FILE
99-
```
98+
---
10099

101100
If you entered a valid authorization token, the command returns the transcription for your audio file, otherwise an error is returned.
102101

103-
---
104102

105-
## Error: HTTP 400 Bad Request
103+
## InitialSilenceTimeout via RecognitionStatus
106104

107-
This error usually occurs when the request body contains invalid audio data. Only WAV format is supported. Also, check the request's headers to make sure you specify appropriate values for `Content-Type` and `Content-Length`.
105+
This issue usually is observed with [single-shot recognition](./how-to-recognize-speech.md#single-shot-recognition) of a single utterance. For example, the error can be returned under the following circumstances:
108106

109-
## Error: HTTP 408 Request Timeout
107+
* The audio begins with a long stretch of silence. In that case, the service stops the recognition after a few seconds and returns `InitialSilenceTimeout`.
108+
* The audio uses an unsupported codec format, which causes the audio data to be treated as silence.
110109

111-
The error most likely occurs because no audio data is being sent to the service. This error also might be caused by network issues.
110+
It's OK to have silence at the beginning of audio, but only when you use [continuous recognition](./how-to-recognize-speech.md#continuous-recognition).
112111

113-
## "RecognitionStatus" in the response is "InitialSilenceTimeout"
112+
## SPXERR_AUDIO_SYS_LIBRARY_NOT_FOUND
114113

115-
This issue usually is caused by audio data. You might see this error because:
114+
This can be returned, for example, when multiple versions of Python have been installed, or if you're not using a supported version of Python. You can try using a different python interpreter or uninstall all python versions and re-install the latest version of python and the Speech SDK.
116115

117-
* There's a long stretch of silence at the beginning of the audio. In that case, the service stops the recognition after a few seconds and returns `InitialSilenceTimeout`.
116+
## HTTP 400 Bad Request
118117

119-
* The audio uses an unsupported codec format, which causes the audio data to be treated as silence.
118+
This error usually occurs when the request body contains invalid audio data. Only WAV format is supported. Also, check the request's headers to make sure you specify appropriate values for `Content-Type` and `Content-Length`.
119+
120+
## HTTP 408 Request Timeout
121+
122+
The error most likely occurs because no audio data is being sent to the service. This error also might be caused by network issues.
120123

121124
## Connection closed or timeout
122125

0 commit comments

Comments
 (0)