Closed GoogleCodeExporter closed 9 years ago
izraip, I am *so* sorry that I didn't follow up on this. I managed to lose the
email
bug report and just now noticed it.
I don't feel that pausing listening in the speech library is the appropriate
way to
handle this. If you want to speak while the computer is speaking, it would be a
frustrating user experience for it to be invisibly holding its ears. You might
be
piping speech output to headphones in which case this isn't a problem, or you
might
be using a synthesized voice that doesn't match your own, which wouldn't cause
the
problem.
I had this problem myself when developing http://musicbutler.googlecode.com,
and have
a few suggestions:
* Use a female voice if you're a male and vice versa. This will make Windows less
likely to falsely recognize your voice.
* Listen for phrases that start with a keyword. All my musicbutler commands start
with saying the name of the butler, such as "Einstein, play me some Beach
Boys."
This makes it unlikely that the computer's voice, or music played over the
stereo,
will match a phrase being listened for.
* Manually stop listening before speech.say, and then listen again. I don't have a
way to programmatically pause listening in the speech API at the moment, so
your only
option would be to listener.stoplistening() and then to restart. You could
wrap the
starting of the listener in a helper function so that you don't duplicate code;
something like
mylistener = null
def startup():
global mylistener
mylistener = speech.listenfor(["Foo", "Bar", "Baz"], response)
def response(phrase, listener):
listener.stoplistening()
speech.say("Nothing is listening right now")
startup()
startup()
# at the end of the program, you turn off listening via...
mylistener.stoplistening()
Original comment by gundl...@gmail.com
on 21 Oct 2008 at 11:23
Original issue reported on code.google.com by
irz...@gmail.com
on 19 Sep 2008 at 3:46