NateRickard / Xamarin.Cognitive.Speech

A client library that makes it easy to work with the Microsoft Cognitive Services Speech Services Speech to Text API on Xamarin.iOS, Xamarin.Android, UWP, and Xamarin.Forms/.NET Standard libraries used by those platforms
MIT License
59 stars 18 forks source link

Null detailedResult #11

Closed nexxuno closed 5 years ago

nexxuno commented 6 years ago

Hello, speecherecognition was working wonders in my app then all of a sudden it stopped working some days ago for no apparent reason. There is no error just a null return in detailed result:

           var audioRecordTask = await recorder.StartRecording();

                using (var stream = recorder.GetAudioFileStream())
                {
                    //this will begin sending the recording audio data as it continues to record
                    var detailedResult = await bingSpeechClient.SpeechToTextDetailed(stream, recorder.AudioStreamDetails.SampleRate, audioRecordTask);
                    return detailedResult.Results != null && detailedResult.Results.Count > 0 ?
                        detailedResult.Results[0].ITN : string.Empty;
                }

Am I the only one facing this problem?

Android 8.0 on a S7Edge

Thanks, Paolo

nexxuno commented 6 years ago

It looks like this overload solved the problem, this doesn't explain the root issue. Moreover having an exception of some kind would have helped.

                    var detailedResult = await bingSpeechClient.SpeechToTextDetailed(stream, recorder.AudioStreamDetails.SampleRate, recorder.AudioStreamDetails.ChannelCount,
                        recorder.AudioStreamDetails.BitsPerSample, audioRecordTask);
nexxuno commented 6 years ago

Disregard my last reply. I mean: using that overload returns a detailed result but there is no result in the array.

What's even more interesting is that my Azure service receives only the token calls but then there is no other call (I expected a server error or the like on the subsequent call).

If you can't reproduce this I can try and debug it when I have more time, please let me know, thanks.

NateRickard commented 5 years ago

Thanks for reporting. I was able to reproduce this, and seems I just flipped some method params and it was causing it to send the wrong values to the service. Also, exceptions will now be surfaced to the caller, although in this case the service was returning something extremely unhelpful.

Re: the other issue you discussed above... I'm able to get detailed results successfully using the sample app. If you can reproduce this after updating to 2.1.2 feel free to debug and send a PR or send me the repro.

nexxuno commented 5 years ago

Thanks I'll try this asap.


From: Nate Rickard notifications@github.com Sent: Friday, September 21, 2018 8:18:29 PM To: NateRickard/Xamarin.Cognitive.BingSpeech Cc: Paolo Ferrazza; Author Subject: Re: [NateRickard/Xamarin.Cognitive.BingSpeech] Null detailedResult (#11)

Thanks for reporting. I was able to reproduce this, and seems I just flipped some method params and it was causing it to send the wrong values to the service. Also, exceptions will now be surfaced to the caller, although in this case the service was returning something extremely unhelpful.

Re: the other issue you discussed above... I'm able to get detailed results successfully using the sample app. If you can reproduce this after updating to 2.1.2https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.nuget.org%2Fpackages%2FXamarin.Cognitive.BingSpeech%2F2.1.2&data=02%7C01%7C%7Cfa1ec8262f534b3f8a3208d61feea2c0%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636731507121825325&sdata=L2hpP4%2FZir8woyIPj8upNItXT9gjOHfHGDBJAri%2FpJ4%3D&reserved=0 feel free to debug and send a PR or send me the repro.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FNateRickard%2FXamarin.Cognitive.BingSpeech%2Fissues%2F11%23issuecomment-423627781&data=02%7C01%7C%7Cfa1ec8262f534b3f8a3208d61feea2c0%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636731507121825325&sdata=qasD6nCpDcq2niwSNzWSnmJQMplH%2FnTI8N7QXjzedAo%3D&reserved=0, or mute the threadhttps://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAOxBALPATVesJcrfV26dqAXrMpKYPnYcks5udS11gaJpZM4Wry6y&data=02%7C01%7C%7Cfa1ec8262f534b3f8a3208d61feea2c0%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636731507121825325&sdata=cVrnYEOpgzOYCrp79XRhLZtEdst4q%2Bv9v2VznLQzRoA%3D&reserved=0.

nexxuno commented 5 years ago

@NateRickard I still have problems: SendRequest: Non-success status received :: Status Code: ServiceUnavailable; Reason: Service Unavailable; Content: <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>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: C081AD708A9A432AA438E2517B9EC0BE Ref B: MIL30EDGE0217 Ref C: 2018-09-24T14:13:58Z

I'll try and debug what's going on ...

NateRickard commented 5 years ago

Assume this is Android... change your Android project to use the Android HttpClient/Handler. This now seems to be required to successfully make calls to the speech api and I need to update the readme to reflect that.