winspeech
index

Speech recognition and synthesis library for Windows - Python 2 and 3.
Based on the abandoned Python 2 library https://github.com/michaelgundlach/pyspeech.
 
This module adds contains a few more features, the important one being the ability to create
in-process speech recognizers.
 
Author: Areeb Beigh <areebbeigh@gmail.com>
GitHub: https://github.com/areebbeigh/winspeech
 
License:
    Copyright 2016 Areeb Beigh
 
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
 
       http://www.apache.org/licenses/LICENSE-2.0
 
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

 
Classes
       
builtins.object
Listener

 
class Listener(builtins.object)
    Listens for speech and calls a callback on a separate thread.
 
  Methods defined here:
__init__(self, context, grammar, callback)
This should never be called directly; use winspeech.listen_for()
and winspeech.listen_for_anything() to create Listener objects.
is_listening(self)
True if this Listener is listening for speech.
stop_listening(self)
Stop listening for speech.  Returns True if we were listening.

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
Functions
       
initialize_recognizer(recognizer)
Initializes the speech recognizer
 
Parameters:
     recognizer: The type of recognizer to initialize_recognizer. winspeech.INPROC_RECOGNIZER for in process
     and winspeech.SHARED_RECOGNIZER for shared recognizer.
is_listening()
True if any Listeners are listening.
listen_for(phrase_list, callback)
If any of the phrases in the given list are heard,
callback(spoken_text, listener) is executed.  Returns a Listener object.
 
The first argument to callback will be the string of text heard.
The second argument will be the same listener object returned by
listen_for().
 
Execution takes place on a single thread shared by all listener callbacks.
listen_for_anything(callback)
When anything resembling English is heard, callback(spoken_text, listener)
is executed.  Returns a Listener object.
 
The first argument to callback will be the string of text heard.
The second argument will be the same listener object returned by
listen_for_anything().
 
Execution takes place on a single thread shared by all listener callbacks.
say(phrase)
Say the given phrase out loud. This will run on a separate thread.
say_wait(phrase)
Say the given phrase out load. This will run on the current thread.
stop_listening()
Cause all Listeners to stop listening.  Returns True if at least one
Listener was listening.
stop_talking()
Stop the current utterance.

 
Data
        INPROC_RECOGNIZER = 'SAPI.SpInprocRecognizer'
SHARED_RECOGNIZER = 'SAPI.SpSharedRecognizer'

 
Author
        Areeb Beigh [areebbeigh@gmail.com]