Example #1
0
 def testRecognizerWrapper(self):
     source = WavFile(os.path.join(DATA_DIR, "hey_mycroft.wav"))
     with source as audio:
         assert self.recognizer.found_wake_word(audio.stream.read())
     source = WavFile(os.path.join(DATA_DIR, "mycroft.wav"))
     with source as audio:
         assert self.recognizer.found_wake_word(audio.stream.read())
Example #2
0
 def testRecognizerWrapper(self):
     source = WavFile(os.path.join(DATA_DIR, "hey_mycroft.wav"))
     with source as audio:
         hyp = self.ww_recognizer.transcribe(audio.stream.read())
         assert hyp.hypstr.lower() == "hey mycroft"
     source = WavFile(os.path.join(DATA_DIR, "mycroft.wav"))
     with source as audio:
         hyp = self.ww_recognizer.transcribe(audio.stream.read())
         assert hyp.hypstr.lower() == "hey mycroft"
Example #3
0
 def __create_sample_from_test_file(self, sample_name):
     root_dir = dirname(dirname(dirname(__file__)))
     filename = join(root_dir, 'unittests', 'client', 'data',
                     sample_name + '.wav')
     wavfile = WavFile(filename)
     with wavfile as source:
         return AudioData(source.stream.read(), wavfile.SAMPLE_RATE,
                          wavfile.SAMPLE_WIDTH)
Example #4
0
 def testRecognitionInLongerUtterance(self):
     source = WavFile(os.path.join(DATA_DIR, "weather_mycroft.wav"))
     with source as audio:
         assert self.recognizer.found_wake_word(audio.stream.read())
Example #5
0
 def testRecognitionInLongerUtterance(self):
     source = WavFile(os.path.join(DATA_DIR, "mycroft_in_utterance.wav"))
     with source as audio:
         hyp = self.ww_recognizer.transcribe(audio.stream.read())
         assert hyp.hypstr.lower() == "hey mycroft"
Example #6
0
 def testRecognitionInLongerUtterance(self):
     source = WavFile(os.path.join(DATA_DIR, "weather_mycroft.wav"))
     with source as audio:
         hyp = self.recognizer.transcribe(audio.stream.read())
         assert "mycroft" in hyp.hypstr.lower()