| |
+Methods defined here:
+- __del__(self)
- Close the connection
+
+- __init__(
+ self,
+ name,
+ component='default',
+ user='unknown',
+ address=None,
+ autospawn=None,
+ host=None,
+ port=None,
+ method=None,
+ socket_path=None
+)
- Initialize the instance and connect to the server.
+
+Arguments:
+ name -- client identification string
+ component -- connection identification string. When one client opens
+ multiple connections, this can be used to identify each of them.
+ user -- user identification string (user name). When multi-user
+ access is expected, this can be used to identify their connections.
+ address -- server address as specified in Speech Dispatcher
+ documentation (e.g. "unix:/run/user/joe/speech-dispatcher/speechd.sock"
+ or "inet:192.168.0.85:6561")
+ autospawn -- a flag to specify whether the library should
+ try to start the server if it determines its not already
+ running or not
+
+Deprecated arguments:
+ method -- communication method to use, one of the constants defined in class
+ CommunicationMethod
+ socket_path -- for CommunicationMethod.UNIX_SOCKET, socket
+ path in filesystem. By default, this is $XDG_RUNTIME_DIR/speech-dispatcher/speechd.sock
+ where $XDG_RUNTIME_DIR is determined using the XDG Base Directory
+ Specification.
+ host -- for CommunicationMethod.INET_SOCKET, server hostname
+ or IP address as a string. If None, the default value is
+ taken from SPEECHD_HOST environment variable (if it
+ exists) or from the DEFAULT_HOST attribute of this class.
+ port -- for CommunicationMethod.INET_SOCKET method, server
+ port as number or None. If None, the default value is
+ taken from SPEECHD_PORT environment variable (if it
+ exists) or from the DEFAULT_PORT attribute of this class.
+
+For more information on client identification strings see Speech
+Dispatcher documentation.
+
+- block_begin(self)
- Begin an SSIP block.
+
+See SSIP documentation for more details about blocks.
+
+- block_end(self)
- Close an SSIP block.
+
+See SSIP documentation for more details about blocks.
+
+- cancel(self, scope='self')
- Immediately stop speaking and discard messages in queues.
+
+Arguments:
+ scope -- see the documentation of this class.
+
+- char(self, char)
- Say given character.
+
+Arguments:
+ char -- a character to be spoken. Either a Python unicode string or
+ a UTF-8 encoded byte string.
+
+This method is non-blocking; it just sends the command, given
+message is queued on the server and the method returns immediately.
+
+- close(self)
- Close the connection to Speech Dispatcher.
+
+- get_language(self)
- Get the current language.
+
+- get_output_module(self)
- Get the current output module.
+
+- get_pitch(self)
- Get the current pitch.
+
+- get_punctuation(self)
- Get the punctuation pronunciation level.
+
+- get_rate(self)
- Get the current speech rate (speed).
+
+- get_volume(self)
- Get the speech volume.
+
+- key(self, key)
- Say given key name.
+
+Arguments:
+ key -- the key name (as defined in SSIP); string.
+
+This method is non-blocking; it just sends the command, given
+message is queued on the server and the method returns immediately.
+
+- list_output_modules(self)
- Return names of all active output modules as a tuple of strings.
+
+- list_synthesis_voices(self, language=None, variant=None)
- Return names of all available voices for the current output module.
+
+If language (possibly even variant) is set, only the list matching that
+language (possibly even variant) is returned.
+
+Returns a tuple of tripplets (name, language, variant).
+
+'name' is a string, 'language' is an ISO 639-1 Alpha-2/3 language code
+and 'variant' is a string. Language and variant may be None.
+
+- pause(self, scope='self')
- Pause speaking and postpone other messages until resume.
+
+This method is non-blocking. However, speaking can continue for a
+short while even after it's called (typically to the end of the
+sentence).
+
+Arguments:
+ scope -- see the documentation of this class.
+
+- resume(self, scope='self')
- Resume speaking of the currently paused messages.
+
+This method is non-blocking. However, speaking can continue for a
+short while even after it's called (typically to the end of the
+sentence).
+
+Arguments:
+ scope -- see the documentation of this class.
+
+- set_cap_let_recogn(self, value, scope='self')
- Set capital letter recognition mode.
+
+Arguments:
+ value -- one of 'none', 'spell', 'icon'. None means no signalization
+ of capital letters, 'spell' means capital letters will be spelled
+ with a synthetic voice and 'icon' means that the capital-letter icon
+ will be prepended before each capital letter.
+ scope -- see the documentation of this class.
+
+- set_data_mode(self, value)
- Set the data mode for further speech commands.
+
+Arguments:
+ value - one of the constants defined by the DataMode class.
+
+- set_debug(self, val)
- Switch debugging on and off. When switched on,
+debugging files will be created in the chosen destination
+(see set_debug_destination()) for Speech Dispatcher and all
+its running modules. All logging information will then be
+written into these files with maximal verbosity until switched
+off. You should always first call set_debug_destination.
+
+The intended use of this functionality is to switch debugging
+on for a period of time while the user will repeat the behavior
+and then send the logs to the appropriate bug-reporting place.
+
+Arguments:
+ val -- a boolean value determining whether debugging
+ is switched on or off
+ scope -- see the documentation of this class.
+
+- set_debug_destination(self, path)
- Set debug destination.
+
+Arguments:
+ path -- path (string) to the directory where debugging
+ files will be created
+ scope -- see the documentation of this class.
+
+- set_language(self, language, scope='self')
- Switch to a particular language for further speech commands.
+
+Arguments:
+ language -- two/three letter language code according to RFC 1766 as string, possibly with a region qualification.
+ scope -- see the documentation of this class.
+
+- set_output_module(self, name, scope='self')
- Switch to a particular output module.
+
+Arguments:
+ name -- module (string) as returned by 'list_output_modules()'.
+ scope -- see the documentation of this class.
+
+- set_pause_context(self, value, scope='self')
- Set the amount of context when resuming a paused message.
+
+Arguments:
+ value -- a positive or negative value meaning how many chunks of data
+ after or before the pause should be read when resume() is executed.
+ scope -- see the documentation of this class.
+
+- set_pitch(self, value, scope='self')
- Set the pitch for further speech commands.
+
+Arguments:
+ value -- integer value within the range from -100 to 100, with 0
+ corresponding to the default pitch of the current speech synthesis
+ output module, lower values meaning lower pitch and higher values
+ meaning higher pitch.
+ scope -- see the documentation of this class.
+
+- set_pitch_range(self, value, scope='self')
- Set the pitch range for further speech commands.
+
+Arguments:
+ value -- integer value within the range from -100 to 100, with 0
+ corresponding to the default pitch range of the current speech synthesis
+ output module, lower values meaning lower pitch range and higher values
+ meaning higher pitch range.
+ scope -- see the documentation of this class.
+
+- set_priority(self, priority)
- Set the priority category for the following messages.
+
+Arguments:
+ priority -- one of the 'Priority' constants.
+
+- set_punctuation(self, value, scope='self')
- Set the punctuation pronunciation level.
+
+Arguments:
+ value -- one of the 'PunctuationMode' constants.
+ scope -- see the documentation of this class.
+
+- set_rate(self, value, scope='self')
- Set the speech rate (speed) for further speech commands.
+
+Arguments:
+ value -- integer value within the range from -100 to 100, with 0
+ corresponding to the default speech rate of the current speech
+ synthesis output module, lower values meaning slower speech and
+ higher values meaning faster speech.
+ scope -- see the documentation of this class.
+
+- set_spelling(self, value, scope='self')
- Toggle the spelling mode or on off.
+
+Arguments:
+ value -- if 'True', all incoming messages will be spelled
+ instead of being read as normal words. 'False' switches
+ this behavior off.
+ scope -- see the documentation of this class.
+
+- set_synthesis_voice(self, value, scope='self')
- Set voice by its real name.
+
+Arguments:
+ value -- voice name as returned by 'list_synthesis_voices()'
+ scope -- see the documentation of this class.
+
+- set_voice(self, value, scope='self')
- Set voice by a symbolic name.
+
+Arguments:
+ value -- one of the SSIP symbolic voice names: 'MALE1' .. 'MALE3',
+ 'FEMALE1' ... 'FEMALE3', 'CHILD_MALE', 'CHILD_FEMALE'
+ scope -- see the documentation of this class.
+
+Symbolic voice names are mapped to real synthesizer voices in the
+configuration of the output module. Use the method
+'set_synthesis_voice()' if you want to work with real voices.
+
+- set_volume(self, value, scope='self')
- Set the speech volume for further speech commands.
+
+Arguments:
+ value -- integer value within the range from -100 to 100, with 100
+ corresponding to the default speech volume of the current speech
+ synthesis output module, lower values meaning softer speech.
+ scope -- see the documentation of this class.
+
+- sound_icon(self, sound_icon)
- Output given sound_icon.
+
+Arguments:
+ sound_icon -- the name of the sound icon as defined by SSIP; string.
+
+This method is non-blocking; it just sends the command, given message
+is queued on the server and the method returns immediately.
+
+- speak(self, text, callback=None, event_types=None)
- Say given message.
+
+Arguments:
+ text -- message text to be spoken. This may be either a UTF-8
+ encoded byte string or a Python unicode string.
+ callback -- a callback handler for asynchronous event notifications.
+ A callable object (function) which accepts one positional argument
+ `type' and one keyword argument `index_mark'. See below for more
+ details.
+ event_types -- a tuple of event types for which the callback should
+ be called. Each item must be one of `CallbackType' constants.
+ None (the default value) means to handle all event types. This
+ argument is irrelevant when `callback' is not used.
+
+The callback function will be called whenever one of the events occurs.
+The event type will be passed as argument. Its value is one of the
+`CallbackType' constants. In case of an index mark event, additional
+keyword argument `index_mark' will be passed and will contain the index
+mark identifier as specified within the text.
+
+The callback function should not perform anything complicated and is
+not allowed to issue any further SSIP client commands. An attempt to
+do so would lead to a deadlock in SSIP communication.
+
+This method is non-blocking; it just sends the command, given
+message is queued on the server and the method returns immediately.
+
+- stop(self, scope='self')
- Immediately stop speaking the currently spoken message.
+
+Arguments:
+ scope -- see the documentation of this class.
+
+
+Data descriptors defined here:
+- __dict__
+- dictionary for instance variables
+
+- __weakref__
+- list of weak references to the object
+
+
+Data and other attributes defined here:
+- DEFAULT_HOST = '127.0.0.1'
+
+- DEFAULT_PORT = 6560
+
+- DEFAULT_SOCKET_PATH = 'speech-dispatcher/speechd.sock'
+
+ |