Browse Source

modified recognizer instance creation to use self.options['microphone']

Jezra 10 years ago
parent
commit
e50facf674
1 changed files with 7 additions and 2 deletions
  1. 7
    2
      Blather.py

+ 7
- 2
Blather.py View File

38
 		self.continuous_listen = False
38
 		self.continuous_listen = False
39
 
39
 
40
 		self.commands = {}
40
 		self.commands = {}
41
+
42
+		#read the commands
41
 		self.read_commands()
43
 		self.read_commands()
42
-		self.recognizer = Recognizer(lang_file, dic_file, opts.microphone )
43
-		self.recognizer.connect('finished',self.recognizer_finished)
44
 
44
 
45
 		#load the options file
45
 		#load the options file
46
 		self.load_options()
46
 		self.load_options()
47
+
47
 		#merge the opts
48
 		#merge the opts
48
 		for k,v in opts.__dict__.items():
49
 		for k,v in opts.__dict__.items():
49
 			if (not k in self.options) or opts.override:
50
 			if (not k in self.options) or opts.override:
76
 		if self.options['history']:
77
 		if self.options['history']:
77
 			self.history = []
78
 			self.history = []
78
 
79
 
80
+		#create the recognizer
81
+		self.recognizer = Recognizer(lang_file, dic_file, self.options['microphone'] )
82
+		self.recognizer.connect('finished',self.recognizer_finished)
83
+
79
 	def read_commands(self):
84
 	def read_commands(self):
80
 		#read the.commands file
85
 		#read the.commands file
81
 		file_lines = open(command_file)
86
 		file_lines = open(command_file)

Loading…
Cancel
Save