SAPI and Python

Discussion in 'Python' started by Sean Kennedy, Oct 16, 2006.

  1. Sean Kennedy

    Sean Kennedy Guest

    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
    device.

    My first notion of an idea on how to accomplish this came from the
    following code at http://msdn.microsoft.com/library/default.asp?
    url=/library/en-us/SAPI51sr/html/VB_ISpeechRecognizer_AudioInput.asp

    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.
    Sean Kennedy, Oct 16, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. celine langlois

    SAPI permission

    celine langlois, Feb 28, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    631
    celine langlois
    Feb 28, 2006
  2. Jeff
    Replies:
    1
    Views:
    550
    zoopy
    Aug 27, 2004
  3. Smart
    Replies:
    0
    Views:
    754
    Smart
    Feb 13, 2006
  4. Winston Wong

    Get the pronunciation with using SAPI

    Winston Wong, Mar 2, 2004, in forum: C++
    Replies:
    2
    Views:
    1,051
    Buster
    Mar 2, 2004
  5. weheh
    Replies:
    1
    Views:
    544
    Tim Golden
    Jun 23, 2008
Loading...

Share This Page