diff options
author | Clayton G. Hobbs <clay@lakeserv.net> | 2015-12-27 00:06:48 -0500 |
---|---|---|
committer | Clayton G. Hobbs <clay@lakeserv.net> | 2015-12-27 00:06:48 -0500 |
commit | 900a3d8d2f8e96b5cdd20c95c076b42bfdec9d75 (patch) | |
tree | 2414445725ffbcb12e74d95818650441db4a5ef5 /recognizer.py | |
parent | 4c20e7d7ca1b9392e3b5a303eef3b5fa71f2b833 (diff) |
Update language automatically on startup
We now have a hash.yaml file which contains a SHA256 hash of sentences.corpus. If this differs from the hash the file calculated when Kaylee sarts, the language is updated and the new hash is stored in hash.yaml.
Diffstat (limited to 'recognizer.py')
-rwxr-xr-x | recognizer.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/recognizer.py b/recognizer.py index 038d4cf..bb35480 100755 --- a/recognizer.py +++ b/recognizer.py @@ -32,9 +32,9 @@ class Recognizer(GObject.GObject): cmd = audio_src+' ! audioconvert ! audioresample ! pocketsphinx name=asr ! appsink sync=false' try: self.pipeline=Gst.parse_launch( cmd ) - except Exception, e: - print e.message - print "You may need to install gstreamer1.0-pocketsphinx" + except Exception as e: + print(e.message) + print("You may need to install gstreamer1.0-pocketsphinx") raise e bus = self.pipeline.get_bus() @@ -63,4 +63,4 @@ class Recognizer(GObject.GObject): # If we have a final command, send it for processing command = msg_struct.get_string('hypothesis') if command != '' and msg_struct.get_boolean('final')[1]: - self.emit("finished", command) + self.emit("finished", command) |