when i tried executing the code i got the following error s in line 18. " auto recognizer = SpeechRecognizer::FromConfig(config);"
Errors:
The thread 0x27e0 has exited with code 0 (0x0).
Exception thrown at 0x000007FEFC88BDED in Voicecontrol.exe: Microsoft C++ exception: [rethrow] at memory location 0x0000000000000000.
Exception thrown at 0x000007FEFC88BDED in Voicecontrol.exe: Microsoft C++ exception: Microsoft::CognitiveServices::Speech::Impl::ExceptionWithCallStack at memory location 0x00000000002FE780.
Exception thrown at 0x000007FEFC88BDED in Voicecontrol.exe: Microsoft C++ exception: std::runtime_error at memory location 0x00000000002FEFD8.
Unhandled exception at 0x000007FEFC88BDED in Voicecontrol.exe: Microsoft C++ exception: std::runtime_error at memory location 0x00000000002FEFD8.
I used the subscription key which i generated from Microsoft Azure.
In the output window the output was:
(602): 173ms SPX_THROW_HR_IF: (0x00e) = 0xe
(602): 369ms SPX_RETURN_ON_FAIL: hr = 0x4d2d80
I even went through all the steps correctly I don't know why this error is showing up. Can someone please help me with this issue.
Regards,
Eeswar
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@eadluru Hi, thanks for the feedback. I will investigate it and get back to you soon.
@wolfma61 Hi Wolfgang, I tried to reproduce the bug and followed the whole document, but I can see a error:

Can you please help to check if there anything I am doing wrong? Thanks.
will investigate
hi,
the code is actually now working without any errors but when i execute the code in Linux there is no problem and I am getting the correct output. but in Windows it directly displays the message in last if statement (i.e.)
if (result->Reason == ResultReason::Canceled)
{
auto cancellation = CancellationDetails::FromResult(result);
cout << "CANCELED: Reason=" << (int)cancellation->Reason << std::endl;
if (cancellation->Reason == CancellationReason::Error)
{
cout << "CANCELED: ErrorCode= " << (int)cancellation->ErrorCode << std::endl;
cout << "CANCELED: ErrorDetails=" << cancellation->ErrorDetails << std::endl;
cout << "CANCELED: Did you update the subscription info?" << std::endl;
}
can you lease say why is this happening in windows because the same subscription key worked in Linux.
Eeswar
what is the error you receive?
@wolfma61 this is the output i got.
Say something...
CANCELED: Reason=1
CANCELED: ErrorCode= 5
CANCELED: ErrorDetails=Connection failed (no connection to the remote host). Int
ernal error: 8. Error details: 998. Please check network connection, firewall se
tting, and the region name used to create speech factory.
CANCELED: Did you update the subscription info?
Please press a key to continue.
ma61
all the samples are part of our daily test path, so I would assume they are working ... ;)
beside assuming, I gave it a try on my machine with the shipped nuget package
-> it worked
Say something...
We recognized: say something to test the program.
Please press a key to continue.
not sure where to take it from here. Make sure subscription key/region are correct ... which is the most common problem. But beside that, I don't have a good reason for failure.
thx
Wolfgang
@eadluru are you still having issues or can we close this item?
I am having this same issue. I'm using the samples -- .net core console app -- that come with the speech SDK and trying option 1, getting:
Say something...
CANCELED: Reason=1
CANCELED: ErrorCode= 5
CANCELED: ErrorDetails=Connection failed (no connection to the remote host). Int
ernal error: 8. Error details: 998. Please check network connection, firewall se
tting, and the region name used to create speech factory.
CANCELED: Did you update the subscription info?
I have double, triple, quadruple checked my keys and the region, even regenerated the key and it's not working. What can I try next?
BTW this very same sample worked for us months ago but I haven't tried it again until just yesterday.
Hard to debug this remotely 😉 but here are a few comments:
@roryap: what OS are you running? What version of the SDK are you using?
I tested on Windows with SDK version 1.3
I tried the .net code console app as you asked, and with a valid subscription key and valid region I had no trouble running the sample
If I entered a wrong region I got the following error output:
Say something...
CANCELED: Reason=Error
CANCELED: ErrorCode=ConnectionFailure
CANCELED: ErrorDetails=Connection failed (no connection to the remote host). Internal error: 1. Error details: 11001. Please check network connection, firewall setting, and the region name used to create speech factory.
CANCELED: Did you update the subscription info?
This is similar to your error message, and seems to indicate that no connection to the remote service was even created, so the subscription key couldn't even be checked.
@roryap: What region did you enter?
A few more observations
My error reason and error code is presented as strings, not as numbers. In the .netcore sample the errors are printed like this:
Console.WriteLine($"CANCELED: ErrorCode={cancellation.ErrorCode}");
This prints the text representation of the enum, so a string, not a number as in your output.
@roryap: Are you sure the output you pasted is from the .netcore sample?
The C++ sample prints the errors as numbers.
The SDK sample repository has a way to file issues directly. It is probably viewed by more people, so perhaps someone else has a good idea which issue you are facing.
Thx
Wolfgang
Hi @wolfma61 thanks for your reply.
I'm using Windows 7 Pro x64 SP1. The "README.md" says the latest version is 1.3.1, but the "CHANGELOG.md" says "The samples in this repository are working against version 1.0.0 of the SDK.", so I don't know.
The region I'm using is "westus", and yes it's the net core console app:
\cognitive-services-speech-sdk-master\cognitive-services-speech-sdk-master\samples\csharp\dotnetcore\console\samples.sln
My apologies for the confusion about the output, I just copy/pasted what the OP had provided above instead of what my actual output was because I mistakenly thought it was identical. Here's the actual output from my console:
Your choice (0: Stop): 1
Say something...
CANCELED: Reason=Error
CANCELED: ErrorCode=ConnectionFailure
CANCELED: ErrorDetails=Connection failed (no connection to the remote host). Int
ernal error: 8. Error details: 998. Please check network connection, firewall se
tting, and the region name used to create speech factory.
CANCELED: Did you update the subscription info?
Recognition done. Your choice (0: Stop):
@wolfma61 Additionally, I'm getting the following response from the https://westus.api.cognitive.microsoft.com/sts/v1.0/issuetoken endpoint (when I issue a GET directly to that URL):
{
"statusCode": 404,
"message": "Resource not found"
}
we only document a POST to that endpoint with the subscription key in the header ... unless I'm missing something. So the GET not working could be expected
The sample still works for me ...
we don't support Win7 officially,
I have no device currently where I could test this ...
@wolfma61 Thank you.
@roryap Hi, do you have support plan for your account? IF not, could you please send us an email at [email protected]? Please provide us with your subscription ID and the URL for this thread,
and I can create a free support ticket for you for further help. I have no Win7 device neither....
@YutongTie-MSFT Thanks I have sent that email per your request.
This is not a supported platform and this issue has been moved to support.