Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > SAPI and Python

Thread Tools

SAPI and Python

Sean Kennedy
Posts: n/a
Ok - I've done a lot of searching with google for info on
what I'm about to ask, and haven't found enough to accomplish
what I'm after - so if anyone has the answers (or even
just ideas on how to proceed) I'd love the help.

I'm fairly new to Python, but not to OO programming. I've
written a simple wx application that uses an SpSharedRecognizer
for voice recognition, and currently sendKeys to send control
applications. The basic ideas came from Inigo Surguy's
web page describing voice recognition in Python.

The problems:

1. The application is specifically tailored to World of Warcraft,
and it will not be useful to the folks who might otherwise use it
if I can't share the audio in with Teamspeak and/or Ventrillo. I
currently have Push-to-Talk implemented by clearing the wordsrule
when it's not listening and setting it when it is. That, as far
as I can tell, will not allow another app to grab the audio in

My first notion of an idea on how to accomplish this came from the
following code at

It looks there like they are releasing the audio-in. However, setting
the AudioInput property to None in Python results in an exceptions with
a type mismatch.

Question: Do you think clearing the AudioInput property will actually
release the audio-in? And, what is the correct way to do it in Python?

2. sendKeys works - but it has the problem of causing McAfee to perk
up and raise a warning on the python interpreter. I can tell it to allow
the script to run, but it only works until the next time I close and
restart the application.

Question: Is sendEvent a better way to do this? And is there a nice
web site with sample python code about it?

Thanks from a python newbie for any insights you folks have.

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
pyTTS says, '"SAPI" not supported' weheh Python 1 06-23-2008 08:58 AM
SAPI permission celine langlois ASP .Net 0 02-28-2006 09:46 PM
Installing SAPI 5.1 In windows??? Smart Java 0 02-13-2006 11:35 AM
Accessing MS sapi for speech controlled jukebox software Jeff Java 1 08-27-2004 09:56 AM
Get the pronunciation with using SAPI Winston Wong C++ 2 03-02-2004 10:31 AM