using start_keyword_recognition for keyword detection

Tushar Saurabh 1 Reputation point
2020-09-12T04:42:07.783+00:00

I am following the below documents for keyword detection -

azure.cognitiveservices.speech.recognizer

custom-keyword-basics

I have followed each step. Created the keyword model. However I am stuck at using the recognizer class and corresponding module. Based on the documents, I used it like below -

keywordRecognizer = speechsdk.Recognizer()  
result = keywordRecognizer .start_keyword_recognition(keywordModel ))  

The above code is throwing below error -

'Recognizer' object has no attribute '_impl'

I am not able to understand the implementation from speech.py code too which says -

def start_keyword_recognition(self, model: KeywordRecognitionModel):  
    """  
    Synchronously initiates keyword recognition operation.  
  
    :param model: the keyword recognition model that specifies the keyword to be recognized.  
    """  
    return self._impl.start_keyword_recognition(model._impl)  
Azure AI Speech
Azure AI Speech
An Azure service that integrates speech processing into apps and services.
1,438 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. GiftA-MSFT 11,151 Reputation points
    2020-09-14T14:05:34.877+00:00

    Hi, you seem to have called speech recognizer incorrectly. Please refer to the correct implementation here. It should look like this:

    speech_recognizer = speechsdk.SpeechRecognizer(speech_config=speech_config)
    

    Hope this helps!

    0 comments No comments