From 1eb5e58379f463f322e62a37ece2c2bd6d61c67d Mon Sep 17 00:00:00 2001 From: schneefux Date: Wed, 30 Jul 2014 03:36:53 +0000 Subject: Prompt user to populate stt_engine in profile --- client/populate.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'client') diff --git a/client/populate.py b/client/populate.py index 48b8670..dd5ca48 100644 --- a/client/populate.py +++ b/client/populate.py @@ -4,7 +4,6 @@ import yaml from pytz import timezone import feedparser - def run(): profile = {} @@ -84,6 +83,26 @@ def run(): response = raw_input("Please choose email (E) or text message (T): ") profile['prefers_email'] = (response == 'E') + stt_engines = { + "sphinx" : None, + "google" : "GOOGLE_SPEECH" + } + + response = raw_input( + "\nIf you would like to choose a specific STT engine, please specify which." + + "\nAvailable implementations: %s. (Press Enter to default to PocketSphinx): " % stt_engines.keys()) + if (response in stt_engines): + profile["stt_engine"] = response + api_key_name = stt_engines[response] + if api_key_name: + key = raw_input("\nPlease enter your API key: ") + profile["keys"] = { api_key_name : key } + else: + print("Unrecognized STT engine. Available implementations: %s" % stt_engines.keys()) + profile["stt_engine"] = "sphinx" + + + # write to profile print("Writing to profile...") outputFile = open("profile.yml", "w") -- cgit v1.3.1