2

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
}}
Toto
  • 736
  • 9
  • 33

1 Answers1

0

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)
mk_
  • 11
  • 2