Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS:recognized in IntentRecognizer not working #1644

Closed
Aethey opened this issue Sep 7, 2022 · 11 comments
Closed

JS:recognized in IntentRecognizer not working #1644

Aethey opened this issue Sep 7, 2022 · 11 comments
Assignees

Comments

@Aethey
Copy link

Aethey commented Sep 7, 2022

Describe the bug
in the JavaScript SDK,when using the startContinuousRecognitionAsync method with a IntentRecognizer,
the recognized is never be called, just recognizing can get the callback

Version of the Cognitive Services Speech SDK
"microsoft-cognitiveservices-speech-sdk": "^1.23.0"

@glharper
Copy link
Member

glharper commented Sep 7, 2022

@Aethey Thank you for using Speech SDK, and writing this issue up. Would you mind sharing the exact code you're reproducing this with (minus any subscription keys)?

@Aethey
Copy link
Author

Aethey commented Sep 8, 2022

@Aethey Thank you for using Speech SDK, and writing this issue up. Would you mind sharing the exact code you're reproducing this with (minus any subscription keys)?

sure,the funcation code like this

async sttFromMicContinuous() {

    // init recognizer
    const audioConfig = speechsdk.AudioConfig.fromDefaultMicrophoneInput();
    // if change the IntentRecognizer to SpeechRecognizer(sorry, not SpeakerRecognizer, is SpeechRecognizer), the callback has no problem
    const recognizer = new speechsdk.IntentRecognizer(
      speechConfig,
      audioConfig
    );

    // init intentModel
    var intentModel = speechsdk.LanguageUnderstandingModel.fromAppId(APPID);
    recognizer.addAllIntents(intentModel);

    // no problem
    recognizer.recognizing = (s, e) => {
        // can get log
        console.log(`recognizing: ${e.result.text}`);
        console.log(e.result.reason);
      };

      // never be called
      recognizer.recognized = (s, e) => {
        // nothing, never be called,
        console.log(`recognized: ${e.result.text}`);
        console.log(`recognized: ${e.result.json}`);
      };

    // start
    recognizer.startContinuousRecognitionAsync(
        () => {
          console.log("Recognition started");
        },
        (err) => {
          console.trace("err - " + err);
          recognizer.close();
          // recognizer = undefined;
        }
    );

@glharper
Copy link
Member

glharper commented Sep 9, 2022

@Aethey Is this code being run in a browser environment? (Node does not have support for direct microphone input).

@Aethey
Copy link
Author

Aethey commented Sep 12, 2022

@Aethey Is this code being run in a browser environment? (Node does not have support for direct microphone input).

run in a browser environment,and the SpeechRecognizer is work well

@glharper
Copy link
Member

@Aethey I've tested the sample here and gotten recognized callbacks using Intent Recognition. Would you mind downloading that sample, running it locally, and seeing if you see (recognized) lines in the bottom text area when you perform intent recognition?

@Aethey
Copy link
Author

Aethey commented Sep 13, 2022

@Aethey I've tested the sample here and gotten recognized callbacks using Intent Recognition. Would you mind downloading that sample, running it locally, and seeing if you see (recognized) lines in the bottom text area when you perform intent recognition?

thanks for your demo,and i have running it locally,but the result like this :
reco_err02

no callback in recognized

about the LUIS part:
var intentModel = speechsdk.LanguageUnderstandingModel.fromSubscription( APPKEY, APPID, "westus" ); recognizer.addAllIntents(intentModel);

i can get result in python with the same APPKEY and the same APPID

@glharper
Copy link
Member

@Aethey Is the region for your app westus or East Asia? Are you seeing any errors in the JS console?

@Aethey
Copy link
Author

Aethey commented Sep 14, 2022

@Aethey Is the region for your app westus or East Asia? Are you seeing any errors in the JS console?

the speech sdk region is "japaneast". its not in select bar and i edit it in code.
the LUIS region is "westus",

all the log like this:
new

there is no response and no error and no message about LUIS, i have no idea to find the reason

@glharper
Copy link
Member

@Aethey I've reproduced this, and have an understanding of the root cause. There should be a PR for this within the next few days. Thanks again for letting us know!

@Aethey
Copy link
Author

Aethey commented Sep 15, 2022

@Aethey I've reproduced this, and have an understanding of the root cause. There should be a PR for this within the next few days. Thanks again for letting us know!

thanks for your reply.

@glharper
Copy link
Member

@Aethey JS Speech SDK v1.24 has been released, with this fix included. Thanks again for submitting this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants