| | |
+
+- builtins.Exception(builtins.BaseException)
+
-
+
+- SSIPError
+
-
+
+- SSIPCommunicationError
+
+
+- SSIPResponseError
+
-
+
+- SSIPCommandError
+
- SSIPDataError
+
+
+- SpawnError
+
+
+- builtins.object
+
-
+
+- CallbackType
+
- CommunicationMethod
+
- ConnectionMethod
+
- DataMode
+
- Priority
+
- PunctuationMode
+
- SSIPClient
+
-
+
+- Client
+
- Speaker
+
+
+- Scope
+
+
+
+
+
+
+ class CallbackType(builtins.object) |
+
+| |
+Constants describing the available types of callbacks |
+| |
+Data descriptors defined here:
+- __dict__
+- dictionary for instance variables
+
+- __weakref__
+- list of weak references to the object
+
+
+Data and other attributes defined here:
+- BEGIN = 'begin'
+
+- CANCEL = 'cancel'
+
+- END = 'end'
+
+- INDEX_MARK = 'index_marks'
+
+- PAUSE = 'pause'
+
+- RESUME = 'resume'
+
+ |
+
+
+ class Client(SSIPClient) |
+
+| |
+Client(name=None, client=None, **kwargs)
+
+A DEPRECATED backwards-compatible API.
+
+This Class is provided only for backwards compatibility with the previous
+unofficial API. It will be removed in future versions. Please use either
+'SSIPClient' or 'Speaker' interface instead. As deprecated, the API is no
+longer documented. |
+| |
+- Method resolution order:
+- Client
+- SSIPClient
+- builtins.object
+
+
+Methods defined here:
+- __init__(self, name=None, client=None, **kwargs)
- 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.
+
+- char(self, char, priority='text')
- 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.
+
+- key(self, key, priority='text')
- 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.
+
+- say(self, text, priority='message')
+
+- sound_icon(self, sound_icon, priority='text')
- 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.
+
+
+Methods inherited from SSIPClient:
+- __del__(self)
- Close the connection
+
+- 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.
+
+- 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.
+
+- 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.
+
+- 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 inherited from SSIPClient:
+- __dict__
+- dictionary for instance variables
+
+- __weakref__
+- list of weak references to the object
+
+
+Data and other attributes inherited from SSIPClient:
+- DEFAULT_HOST = '127.0.0.1'
+
+- DEFAULT_PORT = 6560
+
+- DEFAULT_SOCKET_PATH = 'speech-dispatcher/speechd.sock'
+
+ |
+
+
+ class CommunicationMethod(builtins.object) |
+
+| |
+Constants describing the possible methods of connection to server. |
+| |
+Data descriptors defined here:
+- __dict__
+- dictionary for instance variables
+
+- __weakref__
+- list of weak references to the object
+
+
+Data and other attributes defined here:
+- INET_SOCKET = 'inet_socket'
+
+- UNIX_SOCKET = 'unix_socket'
+
+ |
+
+
+ class ConnectionMethod(builtins.object) |
+
+| |
+Constants describing the possible methods of connection to server.
+
+Retained for backwards compatibility but DEPRECATED. See CommunicationMethod. |
+| |
+Data descriptors defined here:
+- __dict__
+- dictionary for instance variables
+
+- __weakref__
+- list of weak references to the object
+
+
+Data and other attributes defined here:
+- INET_SOCKET = 'inet_socket'
+
+- UNIX_SOCKET = 'unix_socket'
+
+ |
+
+
+ class DataMode(builtins.object) |
+
+| |
+Constants specifying the type of data contained within messages
+to be spoken. |
+| |
+Data descriptors defined here:
+- __dict__
+- dictionary for instance variables
+
+- __weakref__
+- list of weak references to the object
+
+
+Data and other attributes defined here:
+- SSML = 'ssml'
+
+- TEXT = 'text'
+
+ |
+
+
+ class Priority(builtins.object) |
+
+| |
+An enumeration of valid SSIP message priorities.
+
+The constants of this class should be used to specify the 'priority'
+argument for the 'Client' methods. For more information about message
+priorities and their interaction, see the SSIP documentation. |
+| |
+Data descriptors defined here:
+- __dict__
+- dictionary for instance variables
+
+- __weakref__
+- list of weak references to the object
+
+
+Data and other attributes defined here:
+- IMPORTANT = 'important'
+
+- MESSAGE = 'message'
+
+- NOTIFICATION = 'notification'
+
+- PROGRESS = 'progress'
+
+- TEXT = 'text'
+
+ |
+
+
+ class PunctuationMode(builtins.object) |
+
+| |
+Constants for selecting a punctuation mode.
+
+The mode determines which characters should be read. |
+| |
+Data descriptors defined here:
+- __dict__
+- dictionary for instance variables
+
+- __weakref__
+- list of weak references to the object
+
+
+Data and other attributes defined here:
+- ALL = 'all'
+
+- MOST = 'most'
+
+- NONE = 'none'
+
+- SOME = 'some'
+
+ |
+
+
+ class SSIPClient(builtins.object) |
+
+| |
+SSIPClient(
+ name,
+ component='default',
+ user='unknown',
+ address=None,
+ autospawn=None,
+ host=None,
+ port=None,
+ method=None,
+ socket_path=None
+)
+
+Basic Speech Dispatcher client interface.
+
+This class provides a Python interface to Speech Dispatcher functionality
+over an SSIP connection. The API maps directly to available SSIP commands.
+Each connection to Speech Dispatcher is represented by one instance of this
+class.
+
+Many commands take the 'scope' argument, thus it is shortly documented
+here. It is either one of 'Scope' constants or a number of connection. By
+specifying the connection number, you are applying the command to a
+particular connection. This feature is only meant to be used by Speech
+Dispatcher control application, however. More datails can be found in
+Speech Dispatcher documentation.
+
+Here is a simple example:
+
+from speechd import client
+c = client.SSIPClient("mytest")
+c.speak("hello, world!") |
+| |
+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'
+
+ |
+
+
+ class SSIPCommandError(SSIPResponseError) |
+
+| |
+SSIPCommandError(code, msg, data)
+
+Exception raised on error response after sending command. |
+| |
+- Method resolution order:
+- SSIPCommandError
+- SSIPResponseError
+- builtins.Exception
+- builtins.BaseException
+- builtins.object
+
+
+Methods defined here:
+- command(self)
- Return the command string which resulted in this error.
+
+
+Methods inherited from SSIPResponseError:
+- __init__(self, code, msg, data)
- Initialize self. See help(type(self)) for accurate signature.
+
+- code(self)
- Return the server response error code as integer number.
+
+- msg(self)
- Return server response error message as string.
+
+
+Data descriptors inherited from SSIPResponseError:
+- __weakref__
+- list of weak references to the object
+
+
+Static methods inherited from builtins.Exception:
+- __new__(*args, **kwargs) class method of builtins.Exception
- Create and return a new object. See help(type) for accurate signature.
+
+
+Methods inherited from builtins.BaseException:
+- __getattribute__(self, name, /)
- Return getattr(self, name).
+
+- __reduce__(self, /)
- Helper for pickle.
+
+- __repr__(self, /)
- Return repr(self).
+
+- __setstate__(self, object, /)
+
+- __str__(self, /)
- Return str(self).
+
+- add_note(self, object, /)
- Exception.add_note(note) --
+add a note to the exception
+
+- with_traceback(self, object, /)
- Exception.with_traceback(tb) --
+set self.__traceback__ to tb and return self.
+
+
+Data descriptors inherited from builtins.BaseException:
+- __cause__
+- exception cause
+
+- __context__
+- exception context
+
+- __dict__
+
+- __suppress_context__
+
+- __traceback__
+
+- args
+
+ |
+
+
+ class SSIPCommunicationError(SSIPError) |
+
+| |
+SSIPCommunicationError(description=None, original_exception=None, **kwargs)
+
+Exception raised when trying to operate on a closed connection. |
+| |
+- Method resolution order:
+- SSIPCommunicationError
+- SSIPError
+- builtins.Exception
+- builtins.BaseException
+- builtins.object
+
+
+Methods defined here:
+- __init__(self, description=None, original_exception=None, **kwargs)
- Initialize self. See help(type(self)) for accurate signature.
+
+- __str__(self)
- Return str(self).
+
+- additional_exception(self)
- Return an additional exception
+
+Additional exceptions araise from failed attempts to resolve
+the former problem
+
+- description(self)
- Return error description
+
+- original_exception(self)
- Return the original exception if any
+
+If this exception is secondary, being caused by a lower
+level exception, return this original exception, otherwise
+None
+
+- set_additional_exception(self, exception)
- Set an additional exception
+
+See method additional_exception().
+
+
+Data descriptors inherited from SSIPError:
+- __weakref__
+- list of weak references to the object
+
+
+Static methods inherited from builtins.Exception:
+- __new__(*args, **kwargs) class method of builtins.Exception
- Create and return a new object. See help(type) for accurate signature.
+
+
+Methods inherited from builtins.BaseException:
+- __getattribute__(self, name, /)
- Return getattr(self, name).
+
+- __reduce__(self, /)
- Helper for pickle.
+
+- __repr__(self, /)
- Return repr(self).
+
+- __setstate__(self, object, /)
+
+- add_note(self, object, /)
- Exception.add_note(note) --
+add a note to the exception
+
+- with_traceback(self, object, /)
- Exception.with_traceback(tb) --
+set self.__traceback__ to tb and return self.
+
+
+Data descriptors inherited from builtins.BaseException:
+- __cause__
+- exception cause
+
+- __context__
+- exception context
+
+- __dict__
+
+- __suppress_context__
+
+- __traceback__
+
+- args
+
+ |
+
+
+ class SSIPDataError(SSIPResponseError) |
+
+| |
+SSIPDataError(code, msg, data)
+
+Exception raised on error response after sending data. |
+| |
+- Method resolution order:
+- SSIPDataError
+- SSIPResponseError
+- builtins.Exception
+- builtins.BaseException
+- builtins.object
+
+
+Methods defined here:
+- data(self)
- Return the data which resulted in this error.
+
+
+Methods inherited from SSIPResponseError:
+- __init__(self, code, msg, data)
- Initialize self. See help(type(self)) for accurate signature.
+
+- code(self)
- Return the server response error code as integer number.
+
+- msg(self)
- Return server response error message as string.
+
+
+Data descriptors inherited from SSIPResponseError:
+- __weakref__
+- list of weak references to the object
+
+
+Static methods inherited from builtins.Exception:
+- __new__(*args, **kwargs) class method of builtins.Exception
- Create and return a new object. See help(type) for accurate signature.
+
+
+Methods inherited from builtins.BaseException:
+- __getattribute__(self, name, /)
- Return getattr(self, name).
+
+- __reduce__(self, /)
- Helper for pickle.
+
+- __repr__(self, /)
- Return repr(self).
+
+- __setstate__(self, object, /)
+
+- __str__(self, /)
- Return str(self).
+
+- add_note(self, object, /)
- Exception.add_note(note) --
+add a note to the exception
+
+- with_traceback(self, object, /)
- Exception.with_traceback(tb) --
+set self.__traceback__ to tb and return self.
+
+
+Data descriptors inherited from builtins.BaseException:
+- __cause__
+- exception cause
+
+- __context__
+- exception context
+
+- __dict__
+
+- __suppress_context__
+
+- __traceback__
+
+- args
+
+ |
+
+
+ class SSIPError(builtins.Exception) |
+
+| |
+Common base class for exceptions during SSIP communication. |
+| |
+- Method resolution order:
+- SSIPError
+- builtins.Exception
+- builtins.BaseException
+- builtins.object
+
+
+Data descriptors defined here:
+- __weakref__
+- list of weak references to the object
+
+
+Methods inherited from builtins.Exception:
+- __init__(self, /, *args, **kwargs)
- Initialize self. See help(type(self)) for accurate signature.
+
+
+Static methods inherited from builtins.Exception:
+- __new__(*args, **kwargs) class method of builtins.Exception
- Create and return a new object. See help(type) for accurate signature.
+
+
+Methods inherited from builtins.BaseException:
+- __getattribute__(self, name, /)
- Return getattr(self, name).
+
+- __reduce__(self, /)
- Helper for pickle.
+
+- __repr__(self, /)
- Return repr(self).
+
+- __setstate__(self, object, /)
+
+- __str__(self, /)
- Return str(self).
+
+- add_note(self, object, /)
- Exception.add_note(note) --
+add a note to the exception
+
+- with_traceback(self, object, /)
- Exception.with_traceback(tb) --
+set self.__traceback__ to tb and return self.
+
+
+Data descriptors inherited from builtins.BaseException:
+- __cause__
+- exception cause
+
+- __context__
+- exception context
+
+- __dict__
+
+- __suppress_context__
+
+- __traceback__
+
+- args
+
+ |
+
+
+ class SSIPResponseError(builtins.Exception) |
+
+| |
+SSIPResponseError(code, msg, data)
+
+ |
+| |
+- Method resolution order:
+- SSIPResponseError
+- builtins.Exception
+- builtins.BaseException
+- builtins.object
+
+
+Methods defined here:
+- __init__(self, code, msg, data)
- Initialize self. See help(type(self)) for accurate signature.
+
+- code(self)
- Return the server response error code as integer number.
+
+- msg(self)
- Return server response error message as string.
+
+
+Data descriptors defined here:
+- __weakref__
+- list of weak references to the object
+
+
+Static methods inherited from builtins.Exception:
+- __new__(*args, **kwargs) class method of builtins.Exception
- Create and return a new object. See help(type) for accurate signature.
+
+
+Methods inherited from builtins.BaseException:
+- __getattribute__(self, name, /)
- Return getattr(self, name).
+
+- __reduce__(self, /)
- Helper for pickle.
+
+- __repr__(self, /)
- Return repr(self).
+
+- __setstate__(self, object, /)
+
+- __str__(self, /)
- Return str(self).
+
+- add_note(self, object, /)
- Exception.add_note(note) --
+add a note to the exception
+
+- with_traceback(self, object, /)
- Exception.with_traceback(tb) --
+set self.__traceback__ to tb and return self.
+
+
+Data descriptors inherited from builtins.BaseException:
+- __cause__
+- exception cause
+
+- __context__
+- exception context
+
+- __dict__
+
+- __suppress_context__
+
+- __traceback__
+
+- args
+
+ |
+
+
+ class Scope(builtins.object) |
+
+| |
+An enumeration of valid SSIP command scopes.
+
+The constants of this class should be used to specify the 'scope' argument
+for the 'Client' methods. |
+| |
+Data descriptors defined here:
+- __dict__
+- dictionary for instance variables
+
+- __weakref__
+- list of weak references to the object
+
+
+Data and other attributes defined here:
+- ALL = 'all'
+
+- SELF = 'self'
+
+ |
+
+
+ class SpawnError(builtins.Exception) |
+
+| |
+Indicates failure in server autospawn. |
+| |
+- Method resolution order:
+- SpawnError
+- builtins.Exception
+- builtins.BaseException
+- builtins.object
+
+
+Data descriptors defined here:
+- __weakref__
+- list of weak references to the object
+
+
+Methods inherited from builtins.Exception:
+- __init__(self, /, *args, **kwargs)
- Initialize self. See help(type(self)) for accurate signature.
+
+
+Static methods inherited from builtins.Exception:
+- __new__(*args, **kwargs) class method of builtins.Exception
- Create and return a new object. See help(type) for accurate signature.
+
+
+Methods inherited from builtins.BaseException:
+- __getattribute__(self, name, /)
- Return getattr(self, name).
+
+- __reduce__(self, /)
- Helper for pickle.
+
+- __repr__(self, /)
- Return repr(self).
+
+- __setstate__(self, object, /)
+
+- __str__(self, /)
- Return str(self).
+
+- add_note(self, object, /)
- Exception.add_note(note) --
+add a note to the exception
+
+- with_traceback(self, object, /)
- Exception.with_traceback(tb) --
+set self.__traceback__ to tb and return self.
+
+
+Data descriptors inherited from builtins.BaseException:
+- __cause__
+- exception cause
+
+- __context__
+- exception context
+
+- __dict__
+
+- __suppress_context__
+
+- __traceback__
+
+- args
+
+ |
+
+
+ class Speaker(SSIPClient) |
+
+| |
+Speaker(
+ name,
+ component='default',
+ user='unknown',
+ address=None,
+ autospawn=None,
+ host=None,
+ port=None,
+ method=None,
+ socket_path=None
+)
+
+Extended Speech Dispatcher Interface.
+
+This class provides an extended intercace to Speech Dispatcher
+functionality and tries to hide most of the lower level details of SSIP
+(such as a more sophisticated handling of blocks and priorities and
+advanced event notifications) under a more convenient API.
+
+Please note that the API is not yet stabilized and thus is subject to
+change! Please contact the authors if you plan using it and/or if you have
+any suggestions.
+
+Well, in fact this class is currently not implemented at all. It is just a
+draft. The intention is to hide the SSIP details and provide a generic
+interface practical for screen readers. |
+| |
+- Method resolution order:
+- Speaker
+- SSIPClient
+- builtins.object
+
+
+Methods inherited from SSIPClient:
+- __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 inherited from SSIPClient:
+- __dict__
+- dictionary for instance variables
+
+- __weakref__
+- list of weak references to the object
+
+
+Data and other attributes inherited from SSIPClient:
+- DEFAULT_HOST = '127.0.0.1'
+
+- DEFAULT_PORT = 6560
+
+- DEFAULT_SOCKET_PATH = 'speech-dispatcher/speechd.sock'
+
+ | |