class TestMic(unittest.TestCase): def setUp(self): self.jasper_clip = jasperpath.data('audio', 'jasper.wav') self.time_clip = jasperpath.data('audio', 'time.wav') from stt import PocketSphinxSTT self.stt = PocketSphinxSTT(**PocketSphinxSTT.get_config()) def testTranscribeJasper(self): """ Does Jasper recognize his name (i.e., passive listen)? """ with open(self.jasper_clip, mode="rb") as f: transcription = self.stt.transcribe(f, mode=TranscriptionMode.KEYWORD) self.assertIn("JASPER", transcription) def testTranscribe(self): """ Does Jasper recognize 'time' (i.e., active listen)? """ with open(self.time_clip, mode="rb") as f: transcription = self.stt.transcribe(f) self.assertIn("TIME", transcription)
class TestMic(unittest.TestCase): def setUp(self): self.jasper_clip = jasperpath.data('audio', 'jasper.wav') self.time_clip = jasperpath.data('audio', 'time.wav') from stt import PocketSphinxSTT self.stt = PocketSphinxSTT() def testTranscribeJasper(self): """ Does Jasper recognize his name (i.e., passive listen)? """ with open(self.jasper_clip, mode="rb") as f: transcription = self.stt.transcribe(f, mode=TranscriptionMode.KEYWORD) self.assertIn("JASPER", transcription) def testTranscribe(self): """ Does Jasper recognize 'time' (i.e., active listen)? """ with open(self.time_clip, mode="rb") as f: transcription = self.stt.transcribe(f) self.assertIn("TIME", transcription)
class TestMic(unittest.TestCase): def setUp(self): self.jasper_clip = jasperpath.data('audio', 'jasper.wav') self.time_clip = jasperpath.data('audio', 'time.wav') from stt import PocketSphinxSTT self.stt = PocketSphinxSTT() def testTranscribeJasper(self): """Does Jasper recognize his name (i.e., passive listen)?""" transcription = self.stt.transcribe(self.jasper_clip, PERSONA_ONLY=True) self.assertTrue("JASPER" in transcription) def testTranscribe(self): """Does Jasper recognize 'time' (i.e., active listen)?""" transcription = self.stt.transcribe(self.time_clip) self.assertTrue("TIME" in transcription)
class TestMic(unittest.TestCase): def setUp(self): self.jasper_clip = "../static/audio/jasper.wav" self.time_clip = "../static/audio/time.wav" from stt import PocketSphinxSTT self.stt = PocketSphinxSTT() def testTranscribeJasper(self): """Does Jasper recognize his name (i.e., passive listen)?""" transcription = self.stt.transcribe(self.jasper_clip, PERSONA_ONLY=True) self.assertTrue("JASPER" in transcription) def testTranscribe(self): """Does Jasper recognize 'time' (i.e., active listen)?""" transcription = self.stt.transcribe(self.time_clip) self.assertTrue("TIME" in transcription)