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())
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"
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)
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())
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"
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()