BotFramework-WebChat icon indicating copy to clipboard operation
BotFramework-WebChat copied to clipboard

Custom speech recognition

Open stephaneey opened this issue 9 years ago • 5 comments

Hello,

I created a custom speech service using cris.ai. I manage to consume it very well using the JavaScript speech client https://github.com/Azure-Samples/SpeechToText-WebSockets-Javascript. I customized it in order to make it target my custom speech service instance.

However, when trying to do the same with the webchat control, it fails unexpectedly. Looking at the nextwork trace, I see the connection with my custom speech service is well established but I get an error back as shown in my screenshot.

Any idea? csspeecherror

Thanks

stephaneey avatar Oct 31 '17 20:10 stephaneey

@shahidkhuram @w-Yuan can you look at this?

danmarshall avatar Nov 01 '17 18:11 danmarshall

Hello,

I think I found the problem, at least I managed to make it work but I'm not sure what the consequences could be. While digging a bit further, I noticed that the webchat control was working fine with my custom speech service as long as I didn't bind the samples/speech/index.html page to a bot. However, as soon as I bind this page to any bot (with or without priming), it failed with the above error. Then, I simply compared the network traces with fiddler and I noticed that when a bot is involved, it sends the ReferenceGrammar speech context.

So, I commented out this piece of code:

/*let speechContext = null;
        if (this.referenceGrammarId) {
            speechContext = JSON.stringify({
                dgi: {
                    Groups: [
                        {
                            Type: "Generic",
                            Hints: { ReferenceGrammar: this.referenceGrammarId }
                        }
                    ]
                }
            });
        }*/

        //this.actualRecognizer.Recognize(eventhandler, speechContext);

to only do this:
        this.actualRecognizer.Recognize(eventhandler);

and it's working now but I'm not sure what the consequences could be?

We can close the issue but it'd be nice to share your thoughts about that change.

Note: of course, with the changes I made (also change speechconnectionfactory), I know that this version of the webchat control isn't usable with the regular bing speech because instead of extending it, I modified it but I can live with it.

Thanks

stephaneey avatar Nov 04 '17 19:11 stephaneey

@stephaneey I think it is fixed in #965.

compulim avatar Jun 15 '18 09:06 compulim

@stephaneey - we do have scenario to use custom speech service to recognise the domain specific words. we have trained the lang model and acoustic model in cris.ai. wuld you please help me in suggesting and point to a sample to consuming the cris in web chat. appreciate your help.

Kumar3010 avatar Oct 06 '18 13:10 Kumar3010

I also found the solution please read it here https://github.com/Microsoft/BotFramework-WebChat/issues/1216

maithakh avatar Nov 15 '18 09:11 maithakh