Custom speech recognition
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?

Thanks
@shahidkhuram @w-Yuan can you look at this?
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 I think it is fixed in #965.
@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.
I also found the solution please read it here https://github.com/Microsoft/BotFramework-WebChat/issues/1216