From 0e39082aa314107015e739aa4693b18d97b7a5c2 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Tue, 6 Jan 2026 20:30:40 +0100 Subject: [PATCH] Better generate just speechd.client.html It contains more content than just the SSIPClient and Speaker classes. --- README.md | 5 +- doc/.gitignore | 4 +- doc/Makefile.am | 9 +- doc/speechd.client.SSIPClient.html | 351 ------ doc/speechd.client.Speaker.html | 352 ------ doc/speechd.client.html | 1675 ++++++++++++++++++++++++++++ doc/speechd.html | 37 - 7 files changed, 1681 insertions(+), 752 deletions(-) delete mode 100644 doc/speechd.client.SSIPClient.html delete mode 100644 doc/speechd.client.Speaker.html create mode 100644 doc/speechd.client.html delete mode 100644 doc/speechd.html diff --git a/README.md b/README.md index aaa99aa7..4205a75f 100644 --- a/README.md +++ b/README.md @@ -32,10 +32,7 @@ and the [SSIP protocol documentation](http://htmlpreview.github.io/?https://gith The python binding documentation is available on the shell with `pydoc3 speechd` (or `pydoc speechd`) -and online, both the documentation for the -[direct mapping of the SSIP commands and logic](http://htmlpreview.github.io/?https://github.com/brailcom/speechd/blob/master/doc/speechd.client.SSIPClient.html) -and the -[more convenient interface](http://htmlpreview.github.io/?https://github.com/brailcom/speechd/blob/master/doc/speechd.client.Speaker.html) +and online: the [speechd.client module documentation](http://htmlpreview.github.io/?https://github.com/brailcom/speechd/blob/master/doc/speechd.client.html) The key features and the supported TTS engines, output subsystems, client interfaces and client applications known to work with Speech Dispatcher are diff --git a/doc/.gitignore b/doc/.gitignore index b22a6dc2..f7dda69e 100644 --- a/doc/.gitignore +++ b/doc/.gitignore @@ -29,9 +29,7 @@ /speech-dispatcher.dvi /speech-dispatcher.html /speech-dispatcher.info -/speechd.client.SSIPClient.html -/speechd.client.Speaker.html -/speechd.html +/speechd.client.html /ssip.dvi /ssip.html /ssip.info diff --git a/doc/Makefile.am b/doc/Makefile.am index 01fbaeca..08edf5c7 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -20,8 +20,7 @@ all: html endif if HAVE_PYTHON -PYTHON_HTML = speechd.html speechd.client.SSIPClient.html speechd.client.Speaker.html -all: $(PYTHON_HTML) +all: speechd.client.html endif MAKEINFOHTML = $(MAKEINFO) --html --no-split @@ -33,8 +32,8 @@ speech_dispatcher_TEXINFOS = gpl.texi fdl.texi speech-dispatcher.texi speech_dispatcher_cs_TEXINFOS = gpl.texi fdl.texi speech-dispatcher-cs.texi ssip_TEXINFOS = gpl.texi fdl.texi -$(PYTHON_HTML): %.html: $(top_srcdir)/src/api/python/speechd/__init__.py $(top_srcdir)/src/api/python/speechd/client.py - PYTHONPATH=$(top_builddir)/src/api/python pydoc3 -w $* +speechd.client.html: $(top_srcdir)/src/api/python/speechd/client.py + PYTHONPATH=$(top_builddir)/src/api/python pydoc3 -w speechd.client CLEANFILES = spd-say.info \ speech-dispatcher-cs.info \ @@ -52,7 +51,7 @@ DISTCLEANFILES = \ speech-dispatcher-cs.dvi \ speech-dispatcher.html \ speech-dispatcher.dvi \ - $(PYTHON_HTML) \ + speechd.client.html \ ssip.html \ ssip.dvi \ mdate-sh \ diff --git a/doc/speechd.client.SSIPClient.html b/doc/speechd.client.SSIPClient.html deleted file mode 100644 index 1162fa89..00000000 --- a/doc/speechd.client.SSIPClient.html +++ /dev/null @@ -1,351 +0,0 @@ - - - - -Python: class SSIPClient - -

- - - - - - - -
 
speechd.client.SSIPClient = class SSIPClient(builtins.object)
   speechd.client.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'
- -
- \ No newline at end of file diff --git a/doc/speechd.client.Speaker.html b/doc/speechd.client.Speaker.html deleted file mode 100644 index 26d462fd..00000000 --- a/doc/speechd.client.Speaker.html +++ /dev/null @@ -1,352 +0,0 @@ - - - - -Python: class Speaker - -

- - - - - - - -
 
speechd.client.Speaker = class Speaker(SSIPClient)
   speechd.client.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'
- -
- \ No newline at end of file diff --git a/doc/speechd.client.html b/doc/speechd.client.html new file mode 100644 index 00000000..9dea014b --- /dev/null +++ b/doc/speechd.client.html @@ -0,0 +1,1675 @@ + + + + +Python: module speechd.client + + + + + +
 
speechd.client
index
/home/samy/ens/projet/1/speech/speech-dispatcher-git/src/api/python/speechd/client.py
+

Python API to Speech Dispatcher

+Basic Python client API to Speech Dispatcher is provided by the 'SSIPClient'
+class.  This interface maps directly to available SSIP commands and logic.

+A more convenient interface is provided by the 'Speaker' class.

+

+ + + + + +
 
Modules
       
os
+speechd.paths
+
socket
+subprocess
+
tempfile
+threading
+
time
+

+ + + + + +
 
Classes
       
+
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'
+ +

+ \ No newline at end of file diff --git a/doc/speechd.html b/doc/speechd.html deleted file mode 100644 index 6b65e8c7..00000000 --- a/doc/speechd.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - -Python: package speechd - - - - - -
 
speechd
index
/home/samy/ens/projet/1/speech/speech-dispatcher-git/src/api/python/speechd/__init__.py
-

Python API to Speech Dispatcher

-This is the Python client API to Speech Dispatcher.

-Two main classes are provided:

-- speechd.client.SSIPClient : direct mapping of the SSIP commands and logic
-- speechd.client.Speaker : a more convenient interface.

-You can use

-pydoc3 speechd.client.SSIPClient
-pydoc3 speechd.client.Speaker

-to get their documentation.

-

- - - - - -
 
Package Contents
       
_test
-
client
-
paths
-
- \ No newline at end of file