|
@@ -17,6 +17,7 @@ class Cmusphinx(SpeechRecognition):
|
|
|
|
|
|
# callback function to call after the translation speech/tex
|
|
|
self.main_controller_callback = callback
|
|
|
+ self.language = kwargs.get('language', "en-US")
|
|
|
|
|
|
# start listening in the background
|
|
|
self.set_callback(self.sphinx_callback)
|
|
@@ -28,7 +29,7 @@ class Cmusphinx(SpeechRecognition):
|
|
|
called from the background thread
|
|
|
"""
|
|
|
try:
|
|
|
- captured_audio = recognizer.recognize_sphinx(audio)
|
|
|
+ captured_audio = recognizer.recognize_sphinx(audio, language=self.language)
|
|
|
Utils.print_success("Sphinx Speech Recognition thinks you said %s" % captured_audio)
|
|
|
self._analyse_audio(captured_audio)
|
|
|
|