From 443d31b63f424915ac8e37546aaaaf9c30056b2b Mon Sep 17 00:00:00 2001 From: schneefux Date: Mon, 15 Sep 2014 15:56:44 +0200 Subject: Use TranscriptionMode enum --- client/mic.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'client/mic.py') diff --git a/client/mic.py b/client/mic.py index 6c428c0..ccc322e 100644 --- a/client/mic.py +++ b/client/mic.py @@ -9,6 +9,7 @@ import audioop import pyaudio import alteration import jasperpath +from stt import TranscriptionMode class Mic: @@ -162,7 +163,7 @@ class Mic: write_frames.close() # check if PERSONA was said - transcribed = self.passive_stt_engine.transcribe(AUDIO_FILE, PERSONA_ONLY=True) + transcribed = self.passive_stt_engine.transcribe(AUDIO_FILE, mode=TranscriptionMode.KEYWORD) if PERSONA in transcribed: return (THRESHOLD, PERSONA) @@ -232,7 +233,9 @@ class Mic: write_frames.writeframes(''.join(frames)) write_frames.close() - return self.active_stt_engine.transcribe(AUDIO_FILE, MUSIC=MUSIC) + mode = TranscriptionMode.MUSIC if MUSIC else TranscriptionMode.NORMAL + + return self.active_stt_engine.transcribe(AUDIO_FILE, mode=mode) def say(self, phrase, OPTIONS=" -vdefault+m3 -p 40 -s 160 --stdout > say.wav"): # alter phrase before speaking -- cgit v1.3.1