orca.speechserver (version 1552, $Date$)
index
/usr/lib/python2.5/site-packages/orca/speechserver.py

Provides an abtract class for working with speech servers.
 
A speech server (class SpeechServer) provides the ability to tell the
machine to speak.  Each speech server provides a set of known
voices (identified by name) which can be combined with various
attributes to create aural style sheets.

 
Modules
       
orca.debug
logging

 
Classes
       
__builtin__.dict(__builtin__.object)
VoiceFamily
SayAllContext
SpeechServer

 
class SayAllContext
     Methods defined here:
__init__(self, obj, utterance, startOffset=-1, endOffset=-1)
Creates a new SayAllContext that will be passed to the
SayAll callback handler for progress updates on speech.
If the object does not have an accessible text specialization,
then startOffset and endOffset parameters are meaningless.
If the object does have an accessible text specialization,
then values >= 0 for startOffset and endOffset indicate
where in the text the utterance has come from.
 
Arguments:
-obj:         the Accessible being spoken
-utterance:   the actual utterance being spoken
-startOffset: the start offset of the Accessible's text
-endOffset:   the end offset of the Accessible's text

Data and other attributes defined here:
COMPLETED = 2
INTERRUPTED = 1
PROGRESS = 0

 
class SpeechServer
    Provides speech server abstraction.
 
  Methods defined here:
__init__(self)
decreaseSpeechPitch(self, step=0.5)
Decreases the speech pitch.
decreaseSpeechRate(self, step=5)
Decreases the speech rate.
getInfo(self)
Returns [name, id]
getVoiceFamilies(self)
Returns a list of VoiceFamily instances representing all
voice families known by the speech server.
increaseSpeechPitch(self, step=0.5)
Increases the speech pitch.
increaseSpeechRate(self, step=5)
Increases the speech rate.
isSpeaking(self)
"Returns True if the system is currently speaking.
queueSilence(self, duration=50)
Adds silence to the queue.
 
Output is produced by the next call to speak.
queueText(self, text='', acss=None)
Adds the text to the queue.
 
Arguments:
- text: text to be spoken
- acss: acss.ACSS instance; if None,
        the default voice settings will be used.
        Otherwise, the acss settings will be
        used to augment/override the default
        voice settings.
 
Output is produced by the next call to speak.
queueTone(self, pitch=440, duration=50)
Adds a tone to the queue.
 
Output is produced by the next call to speak.
reset(self, text=None, acss=None)
Resets the speech engine.
sayAll(self, utteranceIterator, progressCallback)
Iterates through the given utteranceIterator, speaking
each utterance one at a time.  Subclasses may postpone
getting a new element until the current element has been
spoken.
 
Arguments:
- utteranceIterator: iterator/generator whose next() function
                     returns a [SayAllContext, acss] tuple
- progressCallback:  called as speech progress is made - has a
                     signature of (SayAllContext, type), where
                     type is one of PROGRESS, INTERRUPTED, or
                     COMPLETED.
shutdown(self)
Shuts down the speech engine.
speak(self, text=None, acss=None, interrupt=True)
Speaks all queued text immediately.  If text is not None,
it is added to the queue before speaking.
 
Arguments:
- text:      optional text to add to the queue before speaking
- acss:      acss.ACSS instance; if None,
             the default voice settings will be used.
             Otherwise, the acss settings will be
             used to augment/override the default
             voice settings.
- interrupt: if True, stops any speech in progress before
             speaking the text
speakCharacter(self, character, acss=None)
Speaks a single character immediately.
 
Arguments:
- character: text to be spoken
- acss:      acss.ACSS instance; if None,
             the default voice settings will be used.
             Otherwise, the acss settings will be
             used to augment/override the default
             voice settings.
speakUtterances(self, list, acss=None, interrupt=True)
Speaks the given list of utterances immediately.
 
Arguments:
- list:      list of strings to be spoken
- acss:      acss.ACSS instance; if None,
             the default voice settings will be used.
             Otherwise, the acss settings will be
             used to augment/override the default
             voice settings.
- interrupt: if True, stop any speech currently in progress.
stop(self)
Stops ongoing speech and flushes the queue.

Static methods defined here:
getFactoryName()
Returns a localized name describing this factory.
getSpeechServer(info)
Gets a given SpeechServer based upon the info.
See SpeechServer.getInfo() for more info.
getSpeechServers()
Gets available speech servers as a list.  The caller
is responsible for calling the shutdown() method of each
speech server returned.
shutdownActiveServers()
Cleans up and shuts down this factory.

 
class VoiceFamily(__builtin__.dict)
    Holds the family description for a voice.
 
 
Method resolution order:
VoiceFamily
__builtin__.dict
__builtin__.object

Methods defined here:
__init__(self, props)
Create and initialize VoiceFamily.

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

Data and other attributes defined here:
FEMALE = 'female'
GENDER = 'gender'
LOCALE = 'locale'
MALE = 'male'
NAME = 'name'
settings = {'gender': None, 'locale': None, 'name': None}

Methods inherited from __builtin__.dict:
__cmp__(...)
x.__cmp__(y) <==> cmp(x,y)
__contains__(...)
D.__contains__(k) -> True if D has a key k, else False
__delitem__(...)
x.__delitem__(y) <==> del x[y]
__eq__(...)
x.__eq__(y) <==> x==y
__ge__(...)
x.__ge__(y) <==> x>=y
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__gt__(...)
x.__gt__(y) <==> x>y
__hash__(...)
x.__hash__() <==> hash(x)
__iter__(...)
x.__iter__() <==> iter(x)
__le__(...)
x.__le__(y) <==> x<=y
__len__(...)
x.__len__() <==> len(x)
__lt__(...)
x.__lt__(y) <==> x<y
__ne__(...)
x.__ne__(y) <==> x!=y
__repr__(...)
x.__repr__() <==> repr(x)
__setitem__(...)
x.__setitem__(i, y) <==> x[i]=y
clear(...)
D.clear() -> None.  Remove all items from D.
copy(...)
D.copy() -> a shallow copy of D
get(...)
D.get(k[,d]) -> D[k] if k in D, else d.  d defaults to None.
has_key(...)
D.has_key(k) -> True if D has a key k, else False
items(...)
D.items() -> list of D's (key, value) pairs, as 2-tuples
iteritems(...)
D.iteritems() -> an iterator over the (key, value) items of D
iterkeys(...)
D.iterkeys() -> an iterator over the keys of D
itervalues(...)
D.itervalues() -> an iterator over the values of D
keys(...)
D.keys() -> list of D's keys
pop(...)
D.pop(k[,d]) -> v, remove specified key and return the corresponding value
If key is not found, d is returned if given, otherwise KeyError is raised
popitem(...)
D.popitem() -> (k, v), remove and return some (key, value) pair as a
2-tuple; but raise KeyError if D is empty
setdefault(...)
D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
update(...)
D.update(E, **F) -> None.  Update D from E and F: for k in E: D[k] = E[k]
(if E has keys else: for (k, v) in E: D[k] = v) then: for k in F: D[k] = F[k]
values(...)
D.values() -> list of D's values

Data and other attributes inherited from __builtin__.dict:
__new__ = <built-in method __new__ of type object at 0x8144300>
T.__new__(S, ...) -> a new object with type S, a subtype of T
fromkeys = <built-in method fromkeys of type object at 0x827124c>
dict.fromkeys(S[,v]) -> New dict with keys from S and values equal to v.
v defaults to None.

 
Data
        __copyright__ = 'Copyright (c) 2005-2006 Sun Microsystems Inc.'
__date__ = '$Date$'
__id__ = '$Id$'
__license__ = 'LGPL'
__version__ = '$Revision$'
log = <logging.Logger instance at 0x40602b0c>