Package speakeasy :: Module text_to_speech :: Class TextToSpeechEngine
[hide private]
[frames] | no frames]

Class TextToSpeechEngine

source code

object --+
         |
        TextToSpeechEngine
Known Subclasses:

Abstract class from which text-to-speech engine classes are derived.

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
getEngineName(self) source code
 
getDefaultVoice(self) source code
 
getT2SDestFilename(self) source code
 
checkVoiceValid(self, voice, defaultVoice)
Called from subclasses.
source code
 
bashQuotify(self, str)
Bash does not tolerate single quotes within single-quoted strings.
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

checkVoiceValid(self, voice, defaultVoice)

source code 

Called from subclasses. Given the name of a voice, check whether it is either None, or a voice that is supported by the sound engine. If voice is None, the name of the engine's default voice is returned.

Parameters:
  • voice ({string | NoneType}) - Name of voice, or None

bashQuotify(self, str)

source code 

Bash does not tolerate single quotes within single-quoted strings. Backslashing the embedded single quote does *not* work. Thus: echo 'That's it' will lead to error as expected, but so will echo 'That's it'. The solution is to replace all single quotes with ''' (all quotes are single quotes here).

Parameters:
  • str (string) - String in which to make single quotes safe. Ok not to have any single quotes.