Skip to content

Commit

Permalink
Change NatlinkEngine.speak() to turn on the mic after speech
Browse files Browse the repository at this point in the history
This is to make the expected behaviour consistent for each version
of Dragon. For example, Dragon Home 15 will turn the mic off during
text-to-speech output. This will turn it back on afterwards.
  • Loading branch information
drmfinlay committed Oct 26, 2018
1 parent 0af5d76 commit 086049b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dragonfly/engines/backend_natlink/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,12 @@ def speak(self, text):
""" Speak the given *text* using text-to-speech. """
self.natlink.execScript('TTSPlayString "%s"' % text)

# Turn on the mic if necessary so the user can start speaking again.
# This is to make the expected behaviour consistent for each version
# of Dragon.
if self.natlink.getMicState() != "on":
self.natlink.setMicState("on")

def _get_language(self):
import win32com.client
app = win32com.client.Dispatch("Dragon.DgnEngineControl")
Expand Down

0 comments on commit 086049b

Please sign in to comment.