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

Type SynthAndOutput

object --+    
         |    
      Base --+
             |
            SynthAndOutput


Defines methods for speaking to audio out. Methods are also provided to synth to memory and disk with the intention of speaking the data later from this object. Supports callbacks for speech stream events in all cases
Method Summary
  __init__(self)
Initialize an instance.
  __del__(self)
Cleans up COM interfaces.
boolean IsSpeaking(self)
Return is the engine speaking right now or not?
  Pause(self)
Pauses a speech stream to be resumed later.
  Resume(self)
Resumes a previously paused stream.
  Skip(self, num_items, type_items)
Skips a number of items in a speech stream.
  Speak(self, text, *flags)
Speaks text with the optional flag modifiers.
  SpeakFromMemory(self, mem_stream, *flags)
Speaks the contents of memory block with the optional flag modifiers.
  SpeakFromWave(self, file, *flags)
Speaks the content of a wave file on disk with the optional flag modifiers.
SAPI.SpMemoryStream SpeakToMemory(self, text, *flags)
Speaks the given text to a memory buffer with the optional flag modifiers.
  SpeakToWave(self, file, text, *flags)
Speaks the given text to a file on disk with the optional flag modifiers.
  Stop(self)
Stop all speech immediately.
  SubscribeAll(self, func)
Register a callback for all types of event.
  SubscribeAudioLevel(self, func)
Register a callback for this type of event.
  SubscribeBookmark(self, func)
Register a callback for this type of event.
  SubscribeEndStream(self, func)
Register a callback for this type of event.
  SubscribeEnginePrivate(self, func)
Register a callback for this type of event.
  SubscribePhoneme(self, func)
Register a callback for this type of event.
  SubscribeSentence(self, func)
Register a callback for this type of event.
  SubscribeStartStream(self, func)
Register a callback for this type of event.
  SubscribeViseme(self, func)
Register a callback for this type of event.
  SubscribeVoiceChange(self, func)
Register a callback for this type of event.
  SubscribeWord(self, func)
Register a callback for this type of event.
Inherited from Base: CheckFlags, GetRate, GetVoice, GetVoiceNames, GetVoices, GetVolume, Repeat, SetOutputFormat, SetRate, SetVoice, SetVoiceByName, SetVolume
Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Property Summary
  OnAnyEvent
  OnAudioLevel
  OnBookmark
  OnEndStream
  OnEnginePrivate
  OnPhoneme
  OnSentence
  OnStartStream
  OnViseme
  OnVoiceChange
  OnWord
Inherited from Base: Rate, Voice, Volume

Instance Variable Summary
? events: COM interface with support for events
Inherited from Base: format, last_speech, speech, valid_flags, voices

Method Details

__init__(self)
(Constructor)

Initialize an instance.
Overrides:
pyTTS.sapi.Base.__init__

__del__(self)
(Destructor)

Cleans up COM interfaces.
Overrides:
pyTTS.sapi.Base.__del__

IsSpeaking(self)

Returns:
Is the engine speaking right now or not?
           (type=boolean)

Pause(self)

Pauses a speech stream to be resumed later.

Resume(self)

Resumes a previously paused stream.

Skip(self, num_items, type_items='Sentence')

Skips a number of items in a speech stream.
Parameters:
num_items - Number of items to skip (positive=forward, negative=backwards)
           (type=integer)
type_items - Type of items to skip (currently, sentence only)
           (type=string)

Speak(self, text, *flags)

Speaks text with the optional flag modifiers. Text can include XML commands.
Overrides:
pyTTS.sapi.Base.Speak

SpeakFromMemory(self, mem_stream, *flags)

Speaks the contents of memory block with the optional flag modifiers. Events will be fired appropriately.
Parameters:
mem_stream - Buffer of audio data and associated metadata
           (type=SAPI.SpMemoryStream)
flags - TTS flags to be passed to the underlying COM object
           (type=list)

SpeakFromWave(self, file, *flags)

Speaks the content of a wave file on disk with the optional flag modifiers. If the wave file was created by SAPI and includes events, those events will be fired.
Parameters:
file - Filename of wave
           (type=string)
flags - TTS flags to be passed to the underlying COM object
           (type=list)

SpeakToMemory(self, text, *flags)

Speaks the given text to a memory buffer with the optional flag modifiers.
Parameters:
text - Text to speak
           (type=string)
flags - TTS flags to be passed to the underlying COM object
           (type=list)
Returns:
Buffer of audio data and associated metadata
           (type=SAPI.SpMemoryStream)

SpeakToWave(self, file, text, *flags)

Speaks the given text to a file on disk with the optional flag modifiers.
Parameters:
file - Filename of wave
text - Text to speak
           (type=string)
flags - TTS flags to be passed to the underlying COM object
           (type=list)

Stop(self)

Stop all speech immediately.

SubscribeAll(self, func)

Register a callback for all types of event.
Parameters:
func - Callback function
           (type=callable)

SubscribeAudioLevel(self, func)

Register a callback for this type of event.
Parameters:
func - Callback function
           (type=callable)

SubscribeBookmark(self, func)

Register a callback for this type of event.
Parameters:
func - Callback function
           (type=callable)

SubscribeEndStream(self, func)

Register a callback for this type of event.
Parameters:
func - Callback function
           (type=callable)

SubscribeEnginePrivate(self, func)

Register a callback for this type of event.
Parameters:
func - Callback function
           (type=callable)

SubscribePhoneme(self, func)

Register a callback for this type of event.
Parameters:
func - Callback function
           (type=callable)

SubscribeSentence(self, func)

Register a callback for this type of event.
Parameters:
func - Callback function
           (type=callable)

SubscribeStartStream(self, func)

Register a callback for this type of event.
Parameters:
func - Callback function
           (type=callable)

SubscribeViseme(self, func)

Register a callback for this type of event.
Parameters:
func - Callback function
           (type=callable)

SubscribeVoiceChange(self, func)

Register a callback for this type of event.
Parameters:
func - Callback function
           (type=callable)

SubscribeWord(self, func)

Register a callback for this type of event.
Parameters:
func - Callback function
           (type=callable)

Property Details

OnAnyEvent

Set Method:
SubscribeAll(self, func)

OnAudioLevel

Set Method:
SubscribeAudioLevel(self, func)

OnBookmark

Set Method:
SubscribeBookmark(self, func)

OnEndStream

Set Method:
SubscribeEndStream(self, func)

OnEnginePrivate

Set Method:
SubscribeEnginePrivate(self, func)

OnPhoneme

Set Method:
SubscribePhoneme(self, func)

OnSentence

Set Method:
SubscribeSentence(self, func)

OnStartStream

Set Method:
SubscribeStartStream(self, func)

OnViseme

Set Method:
SubscribeViseme(self, func)

OnVoiceChange

Set Method:
SubscribeVoiceChange(self, func)

OnWord

Set Method:
SubscribeWord(self, func)

Instance Variable Details

events

COM interface with support for events
Type:
?

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