Package synthDrivers :: Module sapi5 :: Class SynthDriver
[hide private]
[frames] | no frames]

Class SynthDriver

source code

                   object --+        
                            |        
baseObject.AutoPropertyObject --+    
                                |    
   synthDriverHandler.SynthDriver --+
                                    |
                                   SynthDriver

Nested Classes [hide private]

Inherited from baseObject.AutoPropertyObject: __metaclass__

Instance Methods [hide private]
 
__init__(self)
Initialize this synth driver.
source code
 
terminate(self)
Terminate this synth driver.
source code
OrderedDict
_getAvailableVoices(self)
fetches an ordered dictionary of voices that the synth supports.
source code
 
_get_rate(self) source code
 
_get_pitch(self) source code
 
_get_volume(self) source code
 
_get_voice(self) source code
int
_get_lastIndex(self)
Obtain the index of the chunk of text which was last spoken.
source code
 
_set_rate(self, rate) source code
 
_set_pitch(self, value) source code
 
_set_volume(self, value) source code
 
_initTts(self) source code
 
_set_voice(self, value) source code
 
speak(self, speechSequence)
Speaks the given sequence of text and speech commands.
source code
 
cancel(self)
Silence speech immediately.
source code
 
pause(self, switch)
Pause or resume speech output.
source code

Inherited from synthDriverHandler.SynthDriver: getConfigSpec, isSupported, loadSettings, saveSettings, speakCharacter, speakText

Inherited from synthDriverHandler.SynthDriver (private): _getAvailableVariants, _get_availableLanguages, _get_availableVariants, _get_availableVoices, _get_inflection, _get_initialSettingsRingSetting, _get_language, _get_supportedSettings, _get_variant, _set_inflection, _set_language, _set_variant

Inherited from baseObject.AutoPropertyObject: invalidateCache

Inherited from baseObject.AutoPropertyObject (private): _getPropertyViaCache

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
bool
check(cls)
Determine whether this synth is available.
source code

Inherited from synthDriverHandler.SynthDriver: InflectionSetting, LanguageSetting, PitchSetting, RateSetting, VariantSetting, VoiceSetting, VolumeSetting

Inherited from synthDriverHandler.SynthDriver (private): _paramToPercent, _percentToParam

Inherited from baseObject.AutoPropertyObject: invalidateCaches

Class Variables [hide private]
list or tuple of SynthSetting supportedSettings = SynthDriver.VoiceSetting(), SynthDriver.Ra...
The settings supported by the synthesiser.
  COM_CLASS = "SAPI.SPVoice"
  name = "sapi5"
  description = "Microsoft Speech API version 5"

Inherited from baseObject.AutoPropertyObject: cachePropertiesByDefault

Instance Variables [hide private]

Inherited from synthDriverHandler.SynthDriver: availableVariants, availableVoices, inflection, lastIndex, pitch, rate, variant, voice, volume

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

check(cls)
Class Method

source code 

Determine whether this synth is available. The synth will be excluded from the list of available synths if this method returns False. For example, if this synth requires installation and it is not installed, False should be returned.

Returns: bool
True if this synth is available, False if not.
Overrides: synthDriverHandler.SynthDriver.check
(inherited documentation)

__init__(self)
(Constructor)

source code 

Initialize this synth driver. This method can also set default settings for the synthesizer.

Raises:
  • Exception - If an error occurs.
Overrides: object.__init__
(inherited documentation)

terminate(self)

source code 

Terminate this synth driver. This should be used for any required clean up.

Overrides: synthDriverHandler.SynthDriver.terminate
(inherited documentation)

_getAvailableVoices(self)

source code 

fetches an ordered dictionary of voices that the synth supports.

Returns: OrderedDict
an OrderedDict of VoiceInfo instances representing the available voices, keyed by ID
Overrides: synthDriverHandler.SynthDriver._getAvailableVoices
(inherited documentation)

_get_rate(self)

source code 
Overrides: synthDriverHandler.SynthDriver._get_rate

_get_pitch(self)

source code 
Overrides: synthDriverHandler.SynthDriver._get_pitch

_get_volume(self)

source code 
Overrides: synthDriverHandler.SynthDriver._get_volume

_get_voice(self)

source code 
Overrides: synthDriverHandler.SynthDriver._get_voice

_get_lastIndex(self)

source code 

Obtain the index of the chunk of text which was last spoken. When the synth speaks text associated with a particular index, this method should return that index. That is, this property should update for each chunk of text spoken by the synth.

Returns: int
The index or None if no index.
Overrides: synthDriverHandler.SynthDriver._get_lastIndex
(inherited documentation)

_set_rate(self, rate)

source code 
Overrides: synthDriverHandler.SynthDriver._set_rate

_set_pitch(self, value)

source code 
Overrides: synthDriverHandler.SynthDriver._set_pitch

_set_volume(self, value)

source code 
Overrides: synthDriverHandler.SynthDriver._set_volume

_set_voice(self, value)

source code 
Overrides: synthDriverHandler.SynthDriver._set_voice

speak(self, speechSequence)

source code 

Speaks the given sequence of text and speech commands. This base implementation will fallback to making use of the old speakText and speakCharacter methods. But new synths should override this method to support its full functionality.

Parameters:
  • speechSequence - a list of text strings and SpeechCommand objects (such as index and parameter changes).
Overrides: synthDriverHandler.SynthDriver.speak
(inherited documentation)

cancel(self)

source code 

Silence speech immediately.

Overrides: synthDriverHandler.SynthDriver.cancel
(inherited documentation)

pause(self, switch)

source code 

Pause or resume speech output.

Parameters:
  • switch - True to pause, False to resume (unpause).
Overrides: synthDriverHandler.SynthDriver.pause
(inherited documentation)

Class Variable Details [hide private]

supportedSettings

The settings supported by the synthesiser.
Type:
list or tuple of SynthSetting
Value:
SynthDriver.VoiceSetting(), SynthDriver.RateSetting(), SynthDriver.Pit\
chSetting(), SynthDriver.VolumeSetting()