2
votes

I am trying to use the Bing Speech Api using C# but 95% of the times I get the following response from the API:

Message=SendRequest: Non-success status received :: Status Code: ServiceUnavailable; Reason: ; Content: http://www.w3.org/1999/xhtml'>body { font-family:Arial; margin-left:40px; }img { border:0 none; }#content { margin-left: auto; margin-right: auto }#logo { margin-top: 30px; width=120px; height=34px }#message h2 { font-size: 20px; font-weight: normal; color: #000000; margin: 34px 0px 0px 0px }#message p { font-size: 13px; color: #000000; margin: 7px 0px 0px 0px }#errorref { font-size: 11px; color: #737373; margin-top: 41px }Bing

Bing services aren't available right now

We're working to restore all services as soon as possible.
We know you want to get back to searching. Please check back soon.

Ref A: A1C0134338234D4AA480524F216CB616 Ref B: PAR02EDGE0112 Ref C: 2018-09-27T17:12:16Z

I do have a valid key and I am succesfully authenticated by the API, at first I thought that the servers were down but I'm getting the same response since one week so I assume something else is wrong.

Any insight would be appreciated.

EDIT: I am communicating with the api through an open source C# library (https://github.com/NateRickard/Xamarin.Cognitive.BingSpeech). The endpoint I am using is the default one in the library, "speech.platform.bing.com/speech/recognition".

Here is an overview of the request which is sent through HTTP:

{Method: POST, RequestUri: 'https://speech.platform.bing.com/speech/recognition/interactive/cognitiveservices/v1?language=fr-FR&format=simple&profanity=masked', Version: 1.1, Content: System.Net.Http.PushStreamContent, Headers:
{
  Transfer-Encoding: chunked
  Expect: 100-continue
  Accept: application/json
  Accept: text/xml
  Host: speech.platform.bing.com
  Ocp-Apim-Subscription-Key: {my subscription key}
  Content-Type: audio/wav
}}
1
Can you add more details about the way you are calling the API (code sample, endpoints, etc)Nicolas R
I have edited the question to provide more detailed information.Toto
Is this error coming back immediately or could it be timing out?John Boker
No, the response of the API is never coming immediately (if I specify an invalid subscription key it does though), there is a slight delay of roughly 3 seconds.Toto
Did you solved that?TaiT's

1 Answers

0
votes

I don't know why, but it worked for me with python if I use the following header (instead of your header):

url = 'https://speech.platform.bing.com/speech/recognition/dictation/cognitiveservices/v1?language=en-US&format=detailed'

header = {
    'Accept': 'application/json',
    'Ocp-Apim-Subscription-Key': YOUR_API_KEY,
    'Content-type': 'audio/wav; codec=audio/pcm; samplerate=16000',
    'Authorization': 'Bearer {0}'.format(token)
}

r = requests.post(url, headers=header, data=audiodata)