summaryrefslogtreecommitdiff
path: root/client/mic.py
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2014-09-15 15:56:44 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2014-09-25 20:23:21 +0200
commit443d31b63f424915ac8e37546aaaaf9c30056b2b (patch)
tree18344fcbc0a500732fd6320f8f03ef72a7038556 /client/mic.py
parent78f0b5b8344dad427902b84210dc4d217c9d9205 (diff)
downloadjasper-client-443d31b63f424915ac8e37546aaaaf9c30056b2b.tar.gz
jasper-client-443d31b63f424915ac8e37546aaaaf9c30056b2b.zip
Use TranscriptionMode enum
Diffstat (limited to 'client/mic.py')
-rw-r--r--client/mic.py7
1 files changed, 5 insertions, 2 deletions
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