Search code examples
xamarinxamarin.formsspeech-recognitionazure-cognitive-services

Microsoft Cognitive Services Speech core not found


When i'm trying to configure the specch engine it throws an exception "libMicrosoft.CognitiveServices.Speech.core.so assembly: type: member:(null)" from SpeechConfig.FromSubscription method.How can I resolve this issue?What could possibly went wrong?

    private async void btnStart_Clicked(object sender, EventArgs e)
        {
            bool isMicEnabled = await micService.GetPermissionAsync();
            if (!isMicEnabled)
            {
                return;
            }
            if (recognizer == null)
            {
                var config = SpeechConfig.FromSubscription(GlobalData.CognitiveServicesApiKey, GlobalData.CognitiveServicesRegion);
                recognizer = new SpeechRecognizer(config);
                recognizer.Recognized += (obj, args) =>
                {
                    ReceiveTranscription(args.Result.Text);
                };
            }
            if (isTranscribing)
            {
                try
                {
                    await recognizer.StopContinuousRecognitionAsync();
                }
                catch (Exception)
                {
                }
                isTranscribing = false;
            }
            else
            {
                try
                {
                    await recognizer.StartContinuousRecognitionAsync();
                }
                catch (Exception)
                {
                }
                isTranscribing = true;
            }
            UpdateDisplayState();
        }

Solution

  • It definitely would appear that the speech.core binary isn't available. It might be that the nuget package wasn't installed properly based on this walkthrough: https://learn.microsoft.com/en-us/azure/cognitive-services/speech-service/quickstarts/setup-platform?tabs=xaml%2Clinux%2Cjre%2Cbrowser&pivots=programming-language-csharp