Package pyTTS :: Module sapi :: Class Base
[show private | hide private]
[frames | no frames]

Type Base

object --+
         |
        Base

Known Subclasses:
SynthAndOutput, SynthOnly

Parent class for all speech synthesizer interfaces.
Method Summary
  __init__(self)
Initialize an instance.
  __del__(self)
Cleans up COM references.
integer CheckFlags(self, flags)
Validates speech flags.
integer GetRate(self)
Return rate of speech, typically in the range of [-10, 10]
string GetVoice(self)
Return name of the currently selected voice
list GetVoiceNames(self)
Return names of supported voices on this system
  GetVoices(self)
integer GetVolume(self)
Return current voice volume in range [0,100]
  Repeat(self, *flags)
Repeats the last text spoken using the provided flags.
  SetOutputFormat(self, rate, bits, channels)
Changes the output stream format.
  SetRate(self, rate)
Sets the current rate of speech.
  SetVoice(self, obj)
  SetVoiceByName(self, voice_name)
Sets the given voice to be the active voice.
  SetVolume(self, vol)
Sets the current voice volume.
  Speak(self, text, *flags)
Virtual method.
Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Property Summary
  Rate
  Voice
  Volume

Instance Variable Summary
integer? format: Current speech format
string last_speech: Last text spoken
SAPI.SpVoice speech: COM interface to the speech engine
integer valid_flags: Allowed modifiers to speech functions
dictionary voices: Supported voices

Method Details

__init__(self)
(Constructor)

Initialize an instance.
Overrides:
__builtin__.object.__init__

__del__(self)
(Destructor)

Cleans up COM references.

CheckFlags(self, flags)

Validates speech flags. Reduces the list of flags to a single sum that can be passed to the engine.
Parameters:
flags - List of flags to reduce
           (type=list of integer)
Returns:
Single integer bit field
           (type=integer)

GetRate(self)

Returns:
Rate of speech, typically in the range of [-10, 10]
           (type=integer)

GetVoice(self)

Returns:
Name of the currently selected voice
           (type=string)

GetVoiceNames(self)

Returns:
Names of supported voices on this system
           (type=list)

GetVolume(self)

Returns:
Current voice volume in range [0,100]
           (type=integer)

Repeat(self, *flags)

Repeats the last text spoken using the provided flags.
Parameters:
flags - TTS flags to be passed to the underlying COM object
           (type=list)

SetOutputFormat(self, rate, bits, channels)

Changes the output stream format.
Parameters:
rate - Sampling rate in kHz (8, 11, 12, 16, 22, 24, 32, 44, 48)
           (type=integer)
bits - Bits per sample (8 or 16)
           (type=integer)
channels - Mono (1) or stereo (2)
           (type=integer)

SetRate(self, rate)

Sets the current rate of speech.
Parameters:
rate - Rate of speech, typically in the range of [-10, 10]
           (type=integer)

SetVoiceByName(self, voice_name)

Sets the given voice to be the active voice.
Parameters:
voice_name - Name of the voice to use for any future speech operations
           (type=string)

SetVolume(self, vol)

Sets the current voice volume.
Parameters:
vol - Volume to set in range [0,100]
           (type=integer)

Speak(self, text, *flags)

Virtual method. Stores text as last spoken text.
Parameters:
text - Text to speak
           (type=string)
flags - TTS flags to be passed to the underlying COM object
           (type=list)

Property Details

Rate

Get Method:
GetRate(self)
Set Method:
SetRate(self, rate)

Voice

Get Method:
GetVoice(self)
Set Method:
SetVoiceByName(self, voice_name)

Volume

Get Method:
GetVolume(self)
Set Method:
SetVolume(self, vol)

Instance Variable Details

format

Current speech format
Type:
integer?

last_speech

Last text spoken
Type:
string

speech

COM interface to the speech engine
Type:
SAPI.SpVoice

valid_flags

Allowed modifiers to speech functions
Type:
integer

voices

Supported voices
Type:
dictionary

Generated by Epydoc 2.1 on Fri Feb 18 13:59:28 2005 http://epydoc.sf.net