| <!DOCTYPE html> |
| <html lang="en"> |
| <head> |
| <meta charset="utf-8"> |
| <title>Python: module speechd.client</title><style>/* CSS file for pydoc. Contents of this file are subject to change without notice. */ body { background-color: #f0f0f8; } table.heading tr { background-color: #7799ee; } .decor { color: #ffffff; } .title-decor { background-color: #ffc8d8; color: #000000; } .pkg-content-decor { background-color: #aa55cc; } .index-decor { background-color: #ee77aa; } .functions-decor { background-color: #eeaa77; } .data-decor { background-color: #55aa55; } .author-decor { background-color: #7799ee; } .credits-decor { background-color: #7799ee; } .error-decor { background-color: #bb0000; } .grey { color: #909090; } .white { color: #ffffff; } .repr { color: #c040c0; } table.heading tr td.title { vertical-align: bottom; } table.heading tr td.extra { vertical-align: bottom; text-align: right; } .heading-text { font-family: helvetica, arial; } .bigsection { font-size: larger; } .title { font-size: x-large; } .code { font-family: monospace; } table { width: 100%; border-spacing : 0; border-collapse : collapse; border: 0; } td { padding: 2; } td.section-title { vertical-align: bottom; } td.multicolumn { width: 25%; vertical-align: bottom; } td.singlecolumn { width: 100%; }</style> |
| </head><body> |
| |
| <table class="heading"> |
| <tr class="heading-text decor"> |
| <td class="title"> <br><strong class="title"><a href="speechd.html" class="white">speechd</a>.client</strong></td> |
| <td class="extra"><a href=".">index</a><br><a href="file:/home/samy/ens/projet/1/speech/speech-dispatcher-git/src/api/python/speechd/client.py">/home/samy/ens/projet/1/speech/speech-dispatcher-git/src/api/python/speechd/client.py</a></td></tr></table> |
| <p><span class="code">Python API to Speech Dispatcher<br> |
| <br> |
| Basic Python client API to Speech Dispatcher is provided by the '<a href="#SSIPClient">SSIPClient</a>'<br> |
| class. This interface maps directly to available SSIP commands and logic.<br> |
| <br> |
| A more convenient interface is provided by the '<a href="#Speaker">Speaker</a>' class.</span></p> |
| <p> |
| <table class="section"> |
| <tr class="decor pkg-content-decor heading-text"> |
| <td class="section-title" colspan=3> <br><strong class="bigsection">Modules</strong></td></tr> |
| |
| <tr><td class="decor pkg-content-decor"><span class="code"> </span></td><td> </td> |
| <td class="singlecolumn"><table><tr><td class="multicolumn"><a href="os.html">os</a><br> |
| <a href="speechd.paths.html">speechd.paths</a><br> |
| </td><td class="multicolumn"><a href="socket.html">socket</a><br> |
| <a href="subprocess.html">subprocess</a><br> |
| </td><td class="multicolumn"><a href="tempfile.html">tempfile</a><br> |
| <a href="threading.html">threading</a><br> |
| </td><td class="multicolumn"><a href="time.html">time</a><br> |
| </td></tr></table></td></tr></table><p> |
| <table class="section"> |
| <tr class="decor index-decor heading-text"> |
| <td class="section-title" colspan=3> <br><strong class="bigsection">Classes</strong></td></tr> |
| |
| <tr><td class="decor index-decor"><span class="code"> </span></td><td> </td> |
| <td class="singlecolumn"><dl> |
| <dt class="heading-text"><a href="builtins.html#Exception">builtins.Exception</a>(<a href="builtins.html#BaseException">builtins.BaseException</a>) |
| </dt><dd> |
| <dl> |
| <dt class="heading-text"><a href="speechd.client.html#SSIPError">SSIPError</a> |
| </dt><dd> |
| <dl> |
| <dt class="heading-text"><a href="speechd.client.html#SSIPCommunicationError">SSIPCommunicationError</a> |
| </dt></dl> |
| </dd> |
| <dt class="heading-text"><a href="speechd.client.html#SSIPResponseError">SSIPResponseError</a> |
| </dt><dd> |
| <dl> |
| <dt class="heading-text"><a href="speechd.client.html#SSIPCommandError">SSIPCommandError</a> |
| </dt><dt class="heading-text"><a href="speechd.client.html#SSIPDataError">SSIPDataError</a> |
| </dt></dl> |
| </dd> |
| <dt class="heading-text"><a href="speechd.client.html#SpawnError">SpawnError</a> |
| </dt></dl> |
| </dd> |
| <dt class="heading-text"><a href="builtins.html#object">builtins.object</a> |
| </dt><dd> |
| <dl> |
| <dt class="heading-text"><a href="speechd.client.html#CallbackType">CallbackType</a> |
| </dt><dt class="heading-text"><a href="speechd.client.html#CommunicationMethod">CommunicationMethod</a> |
| </dt><dt class="heading-text"><a href="speechd.client.html#ConnectionMethod">ConnectionMethod</a> |
| </dt><dt class="heading-text"><a href="speechd.client.html#DataMode">DataMode</a> |
| </dt><dt class="heading-text"><a href="speechd.client.html#Priority">Priority</a> |
| </dt><dt class="heading-text"><a href="speechd.client.html#PunctuationMode">PunctuationMode</a> |
| </dt><dt class="heading-text"><a href="speechd.client.html#SSIPClient">SSIPClient</a> |
| </dt><dd> |
| <dl> |
| <dt class="heading-text"><a href="speechd.client.html#Client">Client</a> |
| </dt><dt class="heading-text"><a href="speechd.client.html#Speaker">Speaker</a> |
| </dt></dl> |
| </dd> |
| <dt class="heading-text"><a href="speechd.client.html#Scope">Scope</a> |
| </dt></dl> |
| </dd> |
| </dl> |
| <p> |
| <table class="section"> |
| <tr class="decor title-decor heading-text"> |
| <td class="section-title" colspan=3> <br><a name="CallbackType">class <strong>CallbackType</strong></a>(<a href="builtins.html#object">builtins.object</a>)</td></tr> |
| |
| <tr><td class="decor title-decor" rowspan=2><span class="code"> </span></td> |
| <td class="decor title-decor" colspan=2><span class="code">Constants describing the available types of callbacks<br> </span></td></tr> |
| <tr><td> </td> |
| <td class="singlecolumn">Data descriptors defined here:<br> |
| <dl><dt><strong>__dict__</strong></dt> |
| <dd><span class="code">dictionary for instance variables</span></dd> |
| </dl> |
| <dl><dt><strong>__weakref__</strong></dt> |
| <dd><span class="code">list of weak references to the object</span></dd> |
| </dl> |
| <hr> |
| Data and other attributes defined here:<br> |
| <dl><dt><strong>BEGIN</strong> = 'begin'</dl> |
| |
| <dl><dt><strong>CANCEL</strong> = 'cancel'</dl> |
| |
| <dl><dt><strong>END</strong> = 'end'</dl> |
| |
| <dl><dt><strong>INDEX_MARK</strong> = 'index_marks'</dl> |
| |
| <dl><dt><strong>PAUSE</strong> = 'pause'</dl> |
| |
| <dl><dt><strong>RESUME</strong> = 'resume'</dl> |
| |
| </td></tr></table> <p> |
| <table class="section"> |
| <tr class="decor title-decor heading-text"> |
| <td class="section-title" colspan=3> <br><a name="Client">class <strong>Client</strong></a>(<a href="speechd.client.html#SSIPClient">SSIPClient</a>)</td></tr> |
| |
| <tr><td class="decor title-decor" rowspan=2><span class="code"> </span></td> |
| <td class="decor title-decor" colspan=2><span class="code"><a href="#Client">Client</a>(name=None, client=None, **kwargs)<br> |
| <br> |
| A DEPRECATED backwards-compatible API.<br> |
| <br> |
| This Class is provided only for backwards compatibility with the previous<br> |
| unofficial API. It will be removed in future versions. Please use either<br> |
| '<a href="#SSIPClient">SSIPClient</a>' or '<a href="#Speaker">Speaker</a>' interface instead. As deprecated, the API is no<br> |
| longer documented.<br> </span></td></tr> |
| <tr><td> </td> |
| <td class="singlecolumn"><dl><dt>Method resolution order:</dt> |
| <dd><a href="speechd.client.html#Client">Client</a></dd> |
| <dd><a href="speechd.client.html#SSIPClient">SSIPClient</a></dd> |
| <dd><a href="builtins.html#object">builtins.object</a></dd> |
| </dl> |
| <hr> |
| Methods defined here:<br> |
| <dl><dt><a name="Client-__init__"><strong>__init__</strong></a>(self, name=None, client=None, **kwargs)</dt><dd><span class="code">Initialize the instance and connect to the server.<br> |
| <br> |
| Arguments:<br> |
| name -- client identification string<br> |
| component -- connection identification string. When one client opens<br> |
| multiple connections, this can be used to identify each of them.<br> |
| user -- user identification string (user name). When multi-user<br> |
| access is expected, this can be used to identify their connections.<br> |
| address -- server address as specified in Speech Dispatcher<br> |
| documentation (e.g. "unix:/run/user/joe/speech-dispatcher/speechd.sock"<br> |
| or "inet:192.168.0.85:6561")<br> |
| autospawn -- a flag to specify whether the library should<br> |
| try to start the server if it determines its not already<br> |
| running or not<br> |
| <br> |
| Deprecated arguments:<br> |
| method -- communication method to use, one of the constants defined in class<br> |
| <a href="#CommunicationMethod">CommunicationMethod</a><br> |
| socket_path -- for <a href="#CommunicationMethod">CommunicationMethod</a>.UNIX_SOCKET, socket<br> |
| path in filesystem. By default, this is $XDG_RUNTIME_DIR/speech-dispatcher/speechd.sock<br> |
| where $XDG_RUNTIME_DIR is determined using the XDG Base Directory<br> |
| Specification.<br> |
| host -- for <a href="#CommunicationMethod">CommunicationMethod</a>.INET_SOCKET, server hostname<br> |
| or IP address as a string. If None, the default value is<br> |
| taken from SPEECHD_HOST environment variable (if it<br> |
| exists) or from the DEFAULT_HOST attribute of this class.<br> |
| port -- for <a href="#CommunicationMethod">CommunicationMethod</a>.INET_SOCKET method, server<br> |
| port as number or None. If None, the default value is<br> |
| taken from SPEECHD_PORT environment variable (if it<br> |
| exists) or from the DEFAULT_PORT attribute of this class.<br> |
| <br> |
| For more information on client identification strings see Speech<br> |
| Dispatcher documentation.</span></dd></dl> |
| |
| <dl><dt><a name="Client-char"><strong>char</strong></a>(self, char, priority='text')</dt><dd><span class="code">Say given character.<br> |
| <br> |
| Arguments:<br> |
| char -- a character to be spoken. Either a Python unicode string or<br> |
| a UTF-8 encoded byte string.<br> |
| <br> |
| This method is non-blocking; it just sends the command, given<br> |
| message is queued on the server and the method returns immediately.</span></dd></dl> |
| |
| <dl><dt><a name="Client-key"><strong>key</strong></a>(self, key, priority='text')</dt><dd><span class="code">Say given key name.<br> |
| <br> |
| Arguments:<br> |
| key -- the key name (as defined in SSIP); string.<br> |
| <br> |
| This method is non-blocking; it just sends the command, given<br> |
| message is queued on the server and the method returns immediately.</span></dd></dl> |
| |
| <dl><dt><a name="Client-say"><strong>say</strong></a>(self, text, priority='message')</dt></dl> |
| |
| <dl><dt><a name="Client-sound_icon"><strong>sound_icon</strong></a>(self, sound_icon, priority='text')</dt><dd><span class="code">Output given sound_icon.<br> |
| <br> |
| Arguments:<br> |
| sound_icon -- the name of the sound icon as defined by SSIP; string.<br> |
| <br> |
| This method is non-blocking; it just sends the command, given message<br> |
| is queued on the server and the method returns immediately.</span></dd></dl> |
| |
| <hr> |
| Methods inherited from <a href="speechd.client.html#SSIPClient">SSIPClient</a>:<br> |
| <dl><dt><a name="Client-__del__"><strong>__del__</strong></a>(self)</dt><dd><span class="code">Close the connection</span></dd></dl> |
| |
| <dl><dt><a name="Client-block_begin"><strong>block_begin</strong></a>(self)</dt><dd><span class="code">Begin an SSIP block.<br> |
| <br> |
| See SSIP documentation for more details about blocks.</span></dd></dl> |
| |
| <dl><dt><a name="Client-block_end"><strong>block_end</strong></a>(self)</dt><dd><span class="code">Close an SSIP block.<br> |
| <br> |
| See SSIP documentation for more details about blocks.</span></dd></dl> |
| |
| <dl><dt><a name="Client-cancel"><strong>cancel</strong></a>(self, scope='self')</dt><dd><span class="code">Immediately stop speaking and discard messages in queues.<br> |
| <br> |
| Arguments:<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="Client-close"><strong>close</strong></a>(self)</dt><dd><span class="code">Close the connection to Speech Dispatcher.</span></dd></dl> |
| |
| <dl><dt><a name="Client-get_language"><strong>get_language</strong></a>(self)</dt><dd><span class="code">Get the current language.</span></dd></dl> |
| |
| <dl><dt><a name="Client-get_output_module"><strong>get_output_module</strong></a>(self)</dt><dd><span class="code">Get the current output module.</span></dd></dl> |
| |
| <dl><dt><a name="Client-get_pitch"><strong>get_pitch</strong></a>(self)</dt><dd><span class="code">Get the current pitch.</span></dd></dl> |
| |
| <dl><dt><a name="Client-get_punctuation"><strong>get_punctuation</strong></a>(self)</dt><dd><span class="code">Get the punctuation pronunciation level.</span></dd></dl> |
| |
| <dl><dt><a name="Client-get_rate"><strong>get_rate</strong></a>(self)</dt><dd><span class="code">Get the current speech rate (speed).</span></dd></dl> |
| |
| <dl><dt><a name="Client-get_volume"><strong>get_volume</strong></a>(self)</dt><dd><span class="code">Get the speech volume.</span></dd></dl> |
| |
| <dl><dt><a name="Client-list_output_modules"><strong>list_output_modules</strong></a>(self)</dt><dd><span class="code">Return names of all active output modules as a tuple of strings.</span></dd></dl> |
| |
| <dl><dt><a name="Client-list_synthesis_voices"><strong>list_synthesis_voices</strong></a>(self, language=None, variant=None)</dt><dd><span class="code">Return names of all available voices for the current output module.<br> |
| <br> |
| If language (possibly even variant) is set, only the list matching that<br> |
| language (possibly even variant) is returned.<br> |
| <br> |
| Returns a tuple of tripplets (name, language, variant).<br> |
| <br> |
| 'name' is a string, 'language' is an ISO 639-1 Alpha-2/3 language code<br> |
| and 'variant' is a string. Language and variant may be None.</span></dd></dl> |
| |
| <dl><dt><a name="Client-pause"><strong>pause</strong></a>(self, scope='self')</dt><dd><span class="code">Pause speaking and postpone other messages until resume.<br> |
| <br> |
| This method is non-blocking. However, speaking can continue for a<br> |
| short while even after it's called (typically to the end of the<br> |
| sentence).<br> |
| <br> |
| Arguments:<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="Client-resume"><strong>resume</strong></a>(self, scope='self')</dt><dd><span class="code">Resume speaking of the currently paused messages.<br> |
| <br> |
| This method is non-blocking. However, speaking can continue for a<br> |
| short while even after it's called (typically to the end of the<br> |
| sentence).<br> |
| <br> |
| Arguments:<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="Client-set_cap_let_recogn"><strong>set_cap_let_recogn</strong></a>(self, value, scope='self')</dt><dd><span class="code">Set capital letter recognition mode.<br> |
| <br> |
| Arguments:<br> |
| value -- one of 'none', 'spell', 'icon'. None means no signalization<br> |
| of capital letters, 'spell' means capital letters will be spelled<br> |
| with a synthetic voice and 'icon' means that the capital-letter icon<br> |
| will be prepended before each capital letter.<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="Client-set_data_mode"><strong>set_data_mode</strong></a>(self, value)</dt><dd><span class="code">Set the data mode for further speech commands.<br> |
| <br> |
| Arguments:<br> |
| value - one of the constants defined by the <a href="#DataMode">DataMode</a> class.</span></dd></dl> |
| |
| <dl><dt><a name="Client-set_debug"><strong>set_debug</strong></a>(self, val)</dt><dd><span class="code">Switch debugging on and off. When switched on,<br> |
| debugging files will be created in the chosen destination<br> |
| (see <a href="#Client-set_debug_destination">set_debug_destination</a>()) for Speech Dispatcher and all<br> |
| its running modules. All logging information will then be<br> |
| written into these files with maximal verbosity until switched<br> |
| off. You should always first call set_debug_destination.<br> |
| <br> |
| The intended use of this functionality is to switch debugging<br> |
| on for a period of time while the user will repeat the behavior<br> |
| and then send the logs to the appropriate bug-reporting place.<br> |
| <br> |
| Arguments:<br> |
| val -- a boolean value determining whether debugging<br> |
| is switched on or off<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="Client-set_debug_destination"><strong>set_debug_destination</strong></a>(self, path)</dt><dd><span class="code">Set debug destination.<br> |
| <br> |
| Arguments:<br> |
| path -- path (string) to the directory where debugging<br> |
| files will be created<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="Client-set_language"><strong>set_language</strong></a>(self, language, scope='self')</dt><dd><span class="code">Switch to a particular language for further speech commands.<br> |
| <br> |
| Arguments:<br> |
| language -- two/three letter language code according to <a href="https://www.rfc-editor.org/rfc/rfc1766.txt">RFC 1766</a> as string, possibly with a region qualification.<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="Client-set_output_module"><strong>set_output_module</strong></a>(self, name, scope='self')</dt><dd><span class="code">Switch to a particular output module.<br> |
| <br> |
| Arguments:<br> |
| name -- module (string) as returned by '<a href="#Client-list_output_modules">list_output_modules</a>()'.<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="Client-set_pause_context"><strong>set_pause_context</strong></a>(self, value, scope='self')</dt><dd><span class="code">Set the amount of context when resuming a paused message.<br> |
| <br> |
| Arguments:<br> |
| value -- a positive or negative value meaning how many chunks of data<br> |
| after or before the pause should be read when <a href="#Client-resume">resume</a>() is executed.<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="Client-set_pitch"><strong>set_pitch</strong></a>(self, value, scope='self')</dt><dd><span class="code">Set the pitch for further speech commands.<br> |
| <br> |
| Arguments:<br> |
| value -- integer value within the range from -100 to 100, with 0<br> |
| corresponding to the default pitch of the current speech synthesis<br> |
| output module, lower values meaning lower pitch and higher values<br> |
| meaning higher pitch.<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="Client-set_pitch_range"><strong>set_pitch_range</strong></a>(self, value, scope='self')</dt><dd><span class="code">Set the pitch range for further speech commands.<br> |
| <br> |
| Arguments:<br> |
| value -- integer value within the range from -100 to 100, with 0<br> |
| corresponding to the default pitch range of the current speech synthesis<br> |
| output module, lower values meaning lower pitch range and higher values<br> |
| meaning higher pitch range.<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="Client-set_priority"><strong>set_priority</strong></a>(self, priority)</dt><dd><span class="code">Set the priority category for the following messages.<br> |
| <br> |
| Arguments:<br> |
| priority -- one of the '<a href="#Priority">Priority</a>' constants.</span></dd></dl> |
| |
| <dl><dt><a name="Client-set_punctuation"><strong>set_punctuation</strong></a>(self, value, scope='self')</dt><dd><span class="code">Set the punctuation pronunciation level.<br> |
| <br> |
| Arguments:<br> |
| value -- one of the '<a href="#PunctuationMode">PunctuationMode</a>' constants.<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="Client-set_rate"><strong>set_rate</strong></a>(self, value, scope='self')</dt><dd><span class="code">Set the speech rate (speed) for further speech commands.<br> |
| <br> |
| Arguments:<br> |
| value -- integer value within the range from -100 to 100, with 0<br> |
| corresponding to the default speech rate of the current speech<br> |
| synthesis output module, lower values meaning slower speech and<br> |
| higher values meaning faster speech.<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="Client-set_spelling"><strong>set_spelling</strong></a>(self, value, scope='self')</dt><dd><span class="code">Toggle the spelling mode or on off.<br> |
| <br> |
| Arguments:<br> |
| value -- if 'True', all incoming messages will be spelled<br> |
| instead of being read as normal words. 'False' switches<br> |
| this behavior off.<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="Client-set_synthesis_voice"><strong>set_synthesis_voice</strong></a>(self, value, scope='self')</dt><dd><span class="code">Set voice by its real name.<br> |
| <br> |
| Arguments:<br> |
| value -- voice name as returned by '<a href="#Client-list_synthesis_voices">list_synthesis_voices</a>()'<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="Client-set_voice"><strong>set_voice</strong></a>(self, value, scope='self')</dt><dd><span class="code">Set voice by a symbolic name.<br> |
| <br> |
| Arguments:<br> |
| value -- one of the SSIP symbolic voice names: 'MALE1' .. 'MALE3',<br> |
| 'FEMALE1' ... 'FEMALE3', 'CHILD_MALE', 'CHILD_FEMALE'<br> |
| scope -- see the documentation of this class.<br> |
| <br> |
| Symbolic voice names are mapped to real synthesizer voices in the<br> |
| configuration of the output module. Use the method<br> |
| '<a href="#Client-set_synthesis_voice">set_synthesis_voice</a>()' if you want to work with real voices.</span></dd></dl> |
| |
| <dl><dt><a name="Client-set_volume"><strong>set_volume</strong></a>(self, value, scope='self')</dt><dd><span class="code">Set the speech volume for further speech commands.<br> |
| <br> |
| Arguments:<br> |
| value -- integer value within the range from -100 to 100, with 100<br> |
| corresponding to the default speech volume of the current speech<br> |
| synthesis output module, lower values meaning softer speech.<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="Client-speak"><strong>speak</strong></a>(self, text, callback=None, event_types=None)</dt><dd><span class="code">Say given message.<br> |
| <br> |
| Arguments:<br> |
| text -- message text to be spoken. This may be either a UTF-8<br> |
| encoded byte string or a Python unicode string.<br> |
| callback -- a callback handler for asynchronous event notifications.<br> |
| A callable <a href="builtins.html#object">object</a> (function) which accepts one positional argument<br> |
| `type' and one keyword argument `index_mark'. See below for more<br> |
| details.<br> |
| event_types -- a tuple of event types for which the callback should<br> |
| be called. Each item must be one of `<a href="#CallbackType">CallbackType</a>' constants.<br> |
| None (the default value) means to handle all event types. This<br> |
| argument is irrelevant when `callback' is not used.<br> |
| <br> |
| The callback function will be called whenever one of the events occurs.<br> |
| The event type will be passed as argument. Its value is one of the<br> |
| `<a href="#CallbackType">CallbackType</a>' constants. In case of an index mark event, additional<br> |
| keyword argument `index_mark' will be passed and will contain the index<br> |
| mark identifier as specified within the text.<br> |
| <br> |
| The callback function should not perform anything complicated and is<br> |
| not allowed to issue any further SSIP client commands. An attempt to<br> |
| do so would lead to a deadlock in SSIP communication.<br> |
| <br> |
| This method is non-blocking; it just sends the command, given<br> |
| message is queued on the server and the method returns immediately.</span></dd></dl> |
| |
| <dl><dt><a name="Client-stop"><strong>stop</strong></a>(self, scope='self')</dt><dd><span class="code">Immediately stop speaking the currently spoken message.<br> |
| <br> |
| Arguments:<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <hr> |
| Data descriptors inherited from <a href="speechd.client.html#SSIPClient">SSIPClient</a>:<br> |
| <dl><dt><strong>__dict__</strong></dt> |
| <dd><span class="code">dictionary for instance variables</span></dd> |
| </dl> |
| <dl><dt><strong>__weakref__</strong></dt> |
| <dd><span class="code">list of weak references to the object</span></dd> |
| </dl> |
| <hr> |
| Data and other attributes inherited from <a href="speechd.client.html#SSIPClient">SSIPClient</a>:<br> |
| <dl><dt><strong>DEFAULT_HOST</strong> = '127.0.0.1'</dl> |
| |
| <dl><dt><strong>DEFAULT_PORT</strong> = 6560</dl> |
| |
| <dl><dt><strong>DEFAULT_SOCKET_PATH</strong> = 'speech-dispatcher/speechd.sock'</dl> |
| |
| </td></tr></table> <p> |
| <table class="section"> |
| <tr class="decor title-decor heading-text"> |
| <td class="section-title" colspan=3> <br><a name="CommunicationMethod">class <strong>CommunicationMethod</strong></a>(<a href="builtins.html#object">builtins.object</a>)</td></tr> |
| |
| <tr><td class="decor title-decor" rowspan=2><span class="code"> </span></td> |
| <td class="decor title-decor" colspan=2><span class="code">Constants describing the possible methods of connection to server.<br> </span></td></tr> |
| <tr><td> </td> |
| <td class="singlecolumn">Data descriptors defined here:<br> |
| <dl><dt><strong>__dict__</strong></dt> |
| <dd><span class="code">dictionary for instance variables</span></dd> |
| </dl> |
| <dl><dt><strong>__weakref__</strong></dt> |
| <dd><span class="code">list of weak references to the object</span></dd> |
| </dl> |
| <hr> |
| Data and other attributes defined here:<br> |
| <dl><dt><strong>INET_SOCKET</strong> = 'inet_socket'</dl> |
| |
| <dl><dt><strong>UNIX_SOCKET</strong> = 'unix_socket'</dl> |
| |
| </td></tr></table> <p> |
| <table class="section"> |
| <tr class="decor title-decor heading-text"> |
| <td class="section-title" colspan=3> <br><a name="ConnectionMethod">class <strong>ConnectionMethod</strong></a>(<a href="builtins.html#object">builtins.object</a>)</td></tr> |
| |
| <tr><td class="decor title-decor" rowspan=2><span class="code"> </span></td> |
| <td class="decor title-decor" colspan=2><span class="code">Constants describing the possible methods of connection to server.<br> |
| <br> |
| Retained for backwards compatibility but DEPRECATED. See <a href="#CommunicationMethod">CommunicationMethod</a>.<br> </span></td></tr> |
| <tr><td> </td> |
| <td class="singlecolumn">Data descriptors defined here:<br> |
| <dl><dt><strong>__dict__</strong></dt> |
| <dd><span class="code">dictionary for instance variables</span></dd> |
| </dl> |
| <dl><dt><strong>__weakref__</strong></dt> |
| <dd><span class="code">list of weak references to the object</span></dd> |
| </dl> |
| <hr> |
| Data and other attributes defined here:<br> |
| <dl><dt><strong>INET_SOCKET</strong> = 'inet_socket'</dl> |
| |
| <dl><dt><strong>UNIX_SOCKET</strong> = 'unix_socket'</dl> |
| |
| </td></tr></table> <p> |
| <table class="section"> |
| <tr class="decor title-decor heading-text"> |
| <td class="section-title" colspan=3> <br><a name="DataMode">class <strong>DataMode</strong></a>(<a href="builtins.html#object">builtins.object</a>)</td></tr> |
| |
| <tr><td class="decor title-decor" rowspan=2><span class="code"> </span></td> |
| <td class="decor title-decor" colspan=2><span class="code">Constants specifying the type of data contained within messages<br> |
| to be spoken.<br> </span></td></tr> |
| <tr><td> </td> |
| <td class="singlecolumn">Data descriptors defined here:<br> |
| <dl><dt><strong>__dict__</strong></dt> |
| <dd><span class="code">dictionary for instance variables</span></dd> |
| </dl> |
| <dl><dt><strong>__weakref__</strong></dt> |
| <dd><span class="code">list of weak references to the object</span></dd> |
| </dl> |
| <hr> |
| Data and other attributes defined here:<br> |
| <dl><dt><strong>SSML</strong> = 'ssml'</dl> |
| |
| <dl><dt><strong>TEXT</strong> = 'text'</dl> |
| |
| </td></tr></table> <p> |
| <table class="section"> |
| <tr class="decor title-decor heading-text"> |
| <td class="section-title" colspan=3> <br><a name="Priority">class <strong>Priority</strong></a>(<a href="builtins.html#object">builtins.object</a>)</td></tr> |
| |
| <tr><td class="decor title-decor" rowspan=2><span class="code"> </span></td> |
| <td class="decor title-decor" colspan=2><span class="code">An enumeration of valid SSIP message priorities.<br> |
| <br> |
| The constants of this class should be used to specify the 'priority'<br> |
| argument for the '<a href="#Client">Client</a>' methods. For more information about message<br> |
| priorities and their interaction, see the SSIP documentation.<br> </span></td></tr> |
| <tr><td> </td> |
| <td class="singlecolumn">Data descriptors defined here:<br> |
| <dl><dt><strong>__dict__</strong></dt> |
| <dd><span class="code">dictionary for instance variables</span></dd> |
| </dl> |
| <dl><dt><strong>__weakref__</strong></dt> |
| <dd><span class="code">list of weak references to the object</span></dd> |
| </dl> |
| <hr> |
| Data and other attributes defined here:<br> |
| <dl><dt><strong>IMPORTANT</strong> = 'important'</dl> |
| |
| <dl><dt><strong>MESSAGE</strong> = 'message'</dl> |
| |
| <dl><dt><strong>NOTIFICATION</strong> = 'notification'</dl> |
| |
| <dl><dt><strong>PROGRESS</strong> = 'progress'</dl> |
| |
| <dl><dt><strong>TEXT</strong> = 'text'</dl> |
| |
| </td></tr></table> <p> |
| <table class="section"> |
| <tr class="decor title-decor heading-text"> |
| <td class="section-title" colspan=3> <br><a name="PunctuationMode">class <strong>PunctuationMode</strong></a>(<a href="builtins.html#object">builtins.object</a>)</td></tr> |
| |
| <tr><td class="decor title-decor" rowspan=2><span class="code"> </span></td> |
| <td class="decor title-decor" colspan=2><span class="code">Constants for selecting a punctuation mode.<br> |
| <br> |
| The mode determines which characters should be read.<br> </span></td></tr> |
| <tr><td> </td> |
| <td class="singlecolumn">Data descriptors defined here:<br> |
| <dl><dt><strong>__dict__</strong></dt> |
| <dd><span class="code">dictionary for instance variables</span></dd> |
| </dl> |
| <dl><dt><strong>__weakref__</strong></dt> |
| <dd><span class="code">list of weak references to the object</span></dd> |
| </dl> |
| <hr> |
| Data and other attributes defined here:<br> |
| <dl><dt><strong>ALL</strong> = 'all'</dl> |
| |
| <dl><dt><strong>MOST</strong> = 'most'</dl> |
| |
| <dl><dt><strong>NONE</strong> = 'none'</dl> |
| |
| <dl><dt><strong>SOME</strong> = 'some'</dl> |
| |
| </td></tr></table> <p> |
| <table class="section"> |
| <tr class="decor title-decor heading-text"> |
| <td class="section-title" colspan=3> <br><a name="SSIPClient">class <strong>SSIPClient</strong></a>(<a href="builtins.html#object">builtins.object</a>)</td></tr> |
| |
| <tr><td class="decor title-decor" rowspan=2><span class="code"> </span></td> |
| <td class="decor title-decor" colspan=2><span class="code"><a href="#SSIPClient">SSIPClient</a>(<br> |
| name,<br> |
| component='default',<br> |
| user='unknown',<br> |
| address=None,<br> |
| autospawn=None,<br> |
| host=None,<br> |
| port=None,<br> |
| method=None,<br> |
| socket_path=None<br> |
| )<br> |
| <br> |
| Basic Speech Dispatcher client interface.<br> |
| <br> |
| This class provides a Python interface to Speech Dispatcher functionality<br> |
| over an SSIP connection. The API maps directly to available SSIP commands.<br> |
| Each connection to Speech Dispatcher is represented by one instance of this<br> |
| class.<br> |
| <br> |
| Many commands take the 'scope' argument, thus it is shortly documented<br> |
| here. It is either one of '<a href="#Scope">Scope</a>' constants or a number of connection. By<br> |
| specifying the connection number, you are applying the command to a<br> |
| particular connection. This feature is only meant to be used by Speech<br> |
| Dispatcher control application, however. More datails can be found in<br> |
| Speech Dispatcher documentation.<br> |
| <br> |
| Here is a simple example:<br> |
| <br> |
| from speechd import client<br> |
| c = client.<a href="#SSIPClient">SSIPClient</a>("mytest")<br> |
| c.<a href="#SSIPClient-speak">speak</a>("hello, world!")<br> </span></td></tr> |
| <tr><td> </td> |
| <td class="singlecolumn">Methods defined here:<br> |
| <dl><dt><a name="SSIPClient-__del__"><strong>__del__</strong></a>(self)</dt><dd><span class="code">Close the connection</span></dd></dl> |
| |
| <dl><dt><a name="SSIPClient-__init__"><strong>__init__</strong></a>( |
| self, |
| name, |
| component='default', |
| user='unknown', |
| address=None, |
| autospawn=None, |
| host=None, |
| port=None, |
| method=None, |
| socket_path=None |
| )</dt><dd><span class="code">Initialize the instance and connect to the server.<br> |
| <br> |
| Arguments:<br> |
| name -- client identification string<br> |
| component -- connection identification string. When one client opens<br> |
| multiple connections, this can be used to identify each of them.<br> |
| user -- user identification string (user name). When multi-user<br> |
| access is expected, this can be used to identify their connections.<br> |
| address -- server address as specified in Speech Dispatcher<br> |
| documentation (e.g. "unix:/run/user/joe/speech-dispatcher/speechd.sock"<br> |
| or "inet:192.168.0.85:6561")<br> |
| autospawn -- a flag to specify whether the library should<br> |
| try to start the server if it determines its not already<br> |
| running or not<br> |
| <br> |
| Deprecated arguments:<br> |
| method -- communication method to use, one of the constants defined in class<br> |
| <a href="#CommunicationMethod">CommunicationMethod</a><br> |
| socket_path -- for <a href="#CommunicationMethod">CommunicationMethod</a>.UNIX_SOCKET, socket<br> |
| path in filesystem. By default, this is $XDG_RUNTIME_DIR/speech-dispatcher/speechd.sock<br> |
| where $XDG_RUNTIME_DIR is determined using the XDG Base Directory<br> |
| Specification.<br> |
| host -- for <a href="#CommunicationMethod">CommunicationMethod</a>.INET_SOCKET, server hostname<br> |
| or IP address as a string. If None, the default value is<br> |
| taken from SPEECHD_HOST environment variable (if it<br> |
| exists) or from the DEFAULT_HOST attribute of this class.<br> |
| port -- for <a href="#CommunicationMethod">CommunicationMethod</a>.INET_SOCKET method, server<br> |
| port as number or None. If None, the default value is<br> |
| taken from SPEECHD_PORT environment variable (if it<br> |
| exists) or from the DEFAULT_PORT attribute of this class.<br> |
| <br> |
| For more information on client identification strings see Speech<br> |
| Dispatcher documentation.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPClient-block_begin"><strong>block_begin</strong></a>(self)</dt><dd><span class="code">Begin an SSIP block.<br> |
| <br> |
| See SSIP documentation for more details about blocks.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPClient-block_end"><strong>block_end</strong></a>(self)</dt><dd><span class="code">Close an SSIP block.<br> |
| <br> |
| See SSIP documentation for more details about blocks.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPClient-cancel"><strong>cancel</strong></a>(self, scope='self')</dt><dd><span class="code">Immediately stop speaking and discard messages in queues.<br> |
| <br> |
| Arguments:<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPClient-char"><strong>char</strong></a>(self, char)</dt><dd><span class="code">Say given character.<br> |
| <br> |
| Arguments:<br> |
| char -- a character to be spoken. Either a Python unicode string or<br> |
| a UTF-8 encoded byte string.<br> |
| <br> |
| This method is non-blocking; it just sends the command, given<br> |
| message is queued on the server and the method returns immediately.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPClient-close"><strong>close</strong></a>(self)</dt><dd><span class="code">Close the connection to Speech Dispatcher.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPClient-get_language"><strong>get_language</strong></a>(self)</dt><dd><span class="code">Get the current language.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPClient-get_output_module"><strong>get_output_module</strong></a>(self)</dt><dd><span class="code">Get the current output module.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPClient-get_pitch"><strong>get_pitch</strong></a>(self)</dt><dd><span class="code">Get the current pitch.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPClient-get_punctuation"><strong>get_punctuation</strong></a>(self)</dt><dd><span class="code">Get the punctuation pronunciation level.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPClient-get_rate"><strong>get_rate</strong></a>(self)</dt><dd><span class="code">Get the current speech rate (speed).</span></dd></dl> |
| |
| <dl><dt><a name="SSIPClient-get_volume"><strong>get_volume</strong></a>(self)</dt><dd><span class="code">Get the speech volume.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPClient-key"><strong>key</strong></a>(self, key)</dt><dd><span class="code">Say given key name.<br> |
| <br> |
| Arguments:<br> |
| key -- the key name (as defined in SSIP); string.<br> |
| <br> |
| This method is non-blocking; it just sends the command, given<br> |
| message is queued on the server and the method returns immediately.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPClient-list_output_modules"><strong>list_output_modules</strong></a>(self)</dt><dd><span class="code">Return names of all active output modules as a tuple of strings.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPClient-list_synthesis_voices"><strong>list_synthesis_voices</strong></a>(self, language=None, variant=None)</dt><dd><span class="code">Return names of all available voices for the current output module.<br> |
| <br> |
| If language (possibly even variant) is set, only the list matching that<br> |
| language (possibly even variant) is returned.<br> |
| <br> |
| Returns a tuple of tripplets (name, language, variant).<br> |
| <br> |
| 'name' is a string, 'language' is an ISO 639-1 Alpha-2/3 language code<br> |
| and 'variant' is a string. Language and variant may be None.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPClient-pause"><strong>pause</strong></a>(self, scope='self')</dt><dd><span class="code">Pause speaking and postpone other messages until resume.<br> |
| <br> |
| This method is non-blocking. However, speaking can continue for a<br> |
| short while even after it's called (typically to the end of the<br> |
| sentence).<br> |
| <br> |
| Arguments:<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPClient-resume"><strong>resume</strong></a>(self, scope='self')</dt><dd><span class="code">Resume speaking of the currently paused messages.<br> |
| <br> |
| This method is non-blocking. However, speaking can continue for a<br> |
| short while even after it's called (typically to the end of the<br> |
| sentence).<br> |
| <br> |
| Arguments:<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPClient-set_cap_let_recogn"><strong>set_cap_let_recogn</strong></a>(self, value, scope='self')</dt><dd><span class="code">Set capital letter recognition mode.<br> |
| <br> |
| Arguments:<br> |
| value -- one of 'none', 'spell', 'icon'. None means no signalization<br> |
| of capital letters, 'spell' means capital letters will be spelled<br> |
| with a synthetic voice and 'icon' means that the capital-letter icon<br> |
| will be prepended before each capital letter.<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPClient-set_data_mode"><strong>set_data_mode</strong></a>(self, value)</dt><dd><span class="code">Set the data mode for further speech commands.<br> |
| <br> |
| Arguments:<br> |
| value - one of the constants defined by the <a href="#DataMode">DataMode</a> class.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPClient-set_debug"><strong>set_debug</strong></a>(self, val)</dt><dd><span class="code">Switch debugging on and off. When switched on,<br> |
| debugging files will be created in the chosen destination<br> |
| (see <a href="#SSIPClient-set_debug_destination">set_debug_destination</a>()) for Speech Dispatcher and all<br> |
| its running modules. All logging information will then be<br> |
| written into these files with maximal verbosity until switched<br> |
| off. You should always first call set_debug_destination.<br> |
| <br> |
| The intended use of this functionality is to switch debugging<br> |
| on for a period of time while the user will repeat the behavior<br> |
| and then send the logs to the appropriate bug-reporting place.<br> |
| <br> |
| Arguments:<br> |
| val -- a boolean value determining whether debugging<br> |
| is switched on or off<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPClient-set_debug_destination"><strong>set_debug_destination</strong></a>(self, path)</dt><dd><span class="code">Set debug destination.<br> |
| <br> |
| Arguments:<br> |
| path -- path (string) to the directory where debugging<br> |
| files will be created<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPClient-set_language"><strong>set_language</strong></a>(self, language, scope='self')</dt><dd><span class="code">Switch to a particular language for further speech commands.<br> |
| <br> |
| Arguments:<br> |
| language -- two/three letter language code according to <a href="https://www.rfc-editor.org/rfc/rfc1766.txt">RFC 1766</a> as string, possibly with a region qualification.<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPClient-set_output_module"><strong>set_output_module</strong></a>(self, name, scope='self')</dt><dd><span class="code">Switch to a particular output module.<br> |
| <br> |
| Arguments:<br> |
| name -- module (string) as returned by '<a href="#SSIPClient-list_output_modules">list_output_modules</a>()'.<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPClient-set_pause_context"><strong>set_pause_context</strong></a>(self, value, scope='self')</dt><dd><span class="code">Set the amount of context when resuming a paused message.<br> |
| <br> |
| Arguments:<br> |
| value -- a positive or negative value meaning how many chunks of data<br> |
| after or before the pause should be read when <a href="#SSIPClient-resume">resume</a>() is executed.<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPClient-set_pitch"><strong>set_pitch</strong></a>(self, value, scope='self')</dt><dd><span class="code">Set the pitch for further speech commands.<br> |
| <br> |
| Arguments:<br> |
| value -- integer value within the range from -100 to 100, with 0<br> |
| corresponding to the default pitch of the current speech synthesis<br> |
| output module, lower values meaning lower pitch and higher values<br> |
| meaning higher pitch.<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPClient-set_pitch_range"><strong>set_pitch_range</strong></a>(self, value, scope='self')</dt><dd><span class="code">Set the pitch range for further speech commands.<br> |
| <br> |
| Arguments:<br> |
| value -- integer value within the range from -100 to 100, with 0<br> |
| corresponding to the default pitch range of the current speech synthesis<br> |
| output module, lower values meaning lower pitch range and higher values<br> |
| meaning higher pitch range.<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPClient-set_priority"><strong>set_priority</strong></a>(self, priority)</dt><dd><span class="code">Set the priority category for the following messages.<br> |
| <br> |
| Arguments:<br> |
| priority -- one of the '<a href="#Priority">Priority</a>' constants.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPClient-set_punctuation"><strong>set_punctuation</strong></a>(self, value, scope='self')</dt><dd><span class="code">Set the punctuation pronunciation level.<br> |
| <br> |
| Arguments:<br> |
| value -- one of the '<a href="#PunctuationMode">PunctuationMode</a>' constants.<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPClient-set_rate"><strong>set_rate</strong></a>(self, value, scope='self')</dt><dd><span class="code">Set the speech rate (speed) for further speech commands.<br> |
| <br> |
| Arguments:<br> |
| value -- integer value within the range from -100 to 100, with 0<br> |
| corresponding to the default speech rate of the current speech<br> |
| synthesis output module, lower values meaning slower speech and<br> |
| higher values meaning faster speech.<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPClient-set_spelling"><strong>set_spelling</strong></a>(self, value, scope='self')</dt><dd><span class="code">Toggle the spelling mode or on off.<br> |
| <br> |
| Arguments:<br> |
| value -- if 'True', all incoming messages will be spelled<br> |
| instead of being read as normal words. 'False' switches<br> |
| this behavior off.<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPClient-set_synthesis_voice"><strong>set_synthesis_voice</strong></a>(self, value, scope='self')</dt><dd><span class="code">Set voice by its real name.<br> |
| <br> |
| Arguments:<br> |
| value -- voice name as returned by '<a href="#SSIPClient-list_synthesis_voices">list_synthesis_voices</a>()'<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPClient-set_voice"><strong>set_voice</strong></a>(self, value, scope='self')</dt><dd><span class="code">Set voice by a symbolic name.<br> |
| <br> |
| Arguments:<br> |
| value -- one of the SSIP symbolic voice names: 'MALE1' .. 'MALE3',<br> |
| 'FEMALE1' ... 'FEMALE3', 'CHILD_MALE', 'CHILD_FEMALE'<br> |
| scope -- see the documentation of this class.<br> |
| <br> |
| Symbolic voice names are mapped to real synthesizer voices in the<br> |
| configuration of the output module. Use the method<br> |
| '<a href="#SSIPClient-set_synthesis_voice">set_synthesis_voice</a>()' if you want to work with real voices.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPClient-set_volume"><strong>set_volume</strong></a>(self, value, scope='self')</dt><dd><span class="code">Set the speech volume for further speech commands.<br> |
| <br> |
| Arguments:<br> |
| value -- integer value within the range from -100 to 100, with 100<br> |
| corresponding to the default speech volume of the current speech<br> |
| synthesis output module, lower values meaning softer speech.<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPClient-sound_icon"><strong>sound_icon</strong></a>(self, sound_icon)</dt><dd><span class="code">Output given sound_icon.<br> |
| <br> |
| Arguments:<br> |
| sound_icon -- the name of the sound icon as defined by SSIP; string.<br> |
| <br> |
| This method is non-blocking; it just sends the command, given message<br> |
| is queued on the server and the method returns immediately.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPClient-speak"><strong>speak</strong></a>(self, text, callback=None, event_types=None)</dt><dd><span class="code">Say given message.<br> |
| <br> |
| Arguments:<br> |
| text -- message text to be spoken. This may be either a UTF-8<br> |
| encoded byte string or a Python unicode string.<br> |
| callback -- a callback handler for asynchronous event notifications.<br> |
| A callable <a href="builtins.html#object">object</a> (function) which accepts one positional argument<br> |
| `type' and one keyword argument `index_mark'. See below for more<br> |
| details.<br> |
| event_types -- a tuple of event types for which the callback should<br> |
| be called. Each item must be one of `<a href="#CallbackType">CallbackType</a>' constants.<br> |
| None (the default value) means to handle all event types. This<br> |
| argument is irrelevant when `callback' is not used.<br> |
| <br> |
| The callback function will be called whenever one of the events occurs.<br> |
| The event type will be passed as argument. Its value is one of the<br> |
| `<a href="#CallbackType">CallbackType</a>' constants. In case of an index mark event, additional<br> |
| keyword argument `index_mark' will be passed and will contain the index<br> |
| mark identifier as specified within the text.<br> |
| <br> |
| The callback function should not perform anything complicated and is<br> |
| not allowed to issue any further SSIP client commands. An attempt to<br> |
| do so would lead to a deadlock in SSIP communication.<br> |
| <br> |
| This method is non-blocking; it just sends the command, given<br> |
| message is queued on the server and the method returns immediately.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPClient-stop"><strong>stop</strong></a>(self, scope='self')</dt><dd><span class="code">Immediately stop speaking the currently spoken message.<br> |
| <br> |
| Arguments:<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <hr> |
| Data descriptors defined here:<br> |
| <dl><dt><strong>__dict__</strong></dt> |
| <dd><span class="code">dictionary for instance variables</span></dd> |
| </dl> |
| <dl><dt><strong>__weakref__</strong></dt> |
| <dd><span class="code">list of weak references to the object</span></dd> |
| </dl> |
| <hr> |
| Data and other attributes defined here:<br> |
| <dl><dt><strong>DEFAULT_HOST</strong> = '127.0.0.1'</dl> |
| |
| <dl><dt><strong>DEFAULT_PORT</strong> = 6560</dl> |
| |
| <dl><dt><strong>DEFAULT_SOCKET_PATH</strong> = 'speech-dispatcher/speechd.sock'</dl> |
| |
| </td></tr></table> <p> |
| <table class="section"> |
| <tr class="decor title-decor heading-text"> |
| <td class="section-title" colspan=3> <br><a name="SSIPCommandError">class <strong>SSIPCommandError</strong></a>(<a href="speechd.client.html#SSIPResponseError">SSIPResponseError</a>)</td></tr> |
| |
| <tr><td class="decor title-decor" rowspan=2><span class="code"> </span></td> |
| <td class="decor title-decor" colspan=2><span class="code"><a href="#SSIPCommandError">SSIPCommandError</a>(code, msg, data)<br> |
| <br> |
| <a href="builtins.html#Exception">Exception</a> raised on error response after sending command.<br> </span></td></tr> |
| <tr><td> </td> |
| <td class="singlecolumn"><dl><dt>Method resolution order:</dt> |
| <dd><a href="speechd.client.html#SSIPCommandError">SSIPCommandError</a></dd> |
| <dd><a href="speechd.client.html#SSIPResponseError">SSIPResponseError</a></dd> |
| <dd><a href="builtins.html#Exception">builtins.Exception</a></dd> |
| <dd><a href="builtins.html#BaseException">builtins.BaseException</a></dd> |
| <dd><a href="builtins.html#object">builtins.object</a></dd> |
| </dl> |
| <hr> |
| Methods defined here:<br> |
| <dl><dt><a name="SSIPCommandError-command"><strong>command</strong></a>(self)</dt><dd><span class="code">Return the command string which resulted in this error.</span></dd></dl> |
| |
| <hr> |
| Methods inherited from <a href="speechd.client.html#SSIPResponseError">SSIPResponseError</a>:<br> |
| <dl><dt><a name="SSIPCommandError-__init__"><strong>__init__</strong></a>(self, code, msg, data)</dt><dd><span class="code">Initialize self. See help(type(self)) for accurate signature.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPCommandError-code"><strong>code</strong></a>(self)</dt><dd><span class="code">Return the server response error code as integer number.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPCommandError-msg"><strong>msg</strong></a>(self)</dt><dd><span class="code">Return server response error message as string.</span></dd></dl> |
| |
| <hr> |
| Data descriptors inherited from <a href="speechd.client.html#SSIPResponseError">SSIPResponseError</a>:<br> |
| <dl><dt><strong>__weakref__</strong></dt> |
| <dd><span class="code">list of weak references to the object</span></dd> |
| </dl> |
| <hr> |
| Static methods inherited from <a href="builtins.html#Exception">builtins.Exception</a>:<br> |
| <dl><dt><a name="SSIPCommandError-__new__"><strong>__new__</strong></a>(*args, **kwargs)<span class="grey"><span class="heading-text"> class method of <a href="builtins.html#Exception">builtins.Exception</a></span></span></dt><dd><span class="code">Create and return a new <a href="builtins.html#object">object</a>. See help(type) for accurate signature.</span></dd></dl> |
| |
| <hr> |
| Methods inherited from <a href="builtins.html#BaseException">builtins.BaseException</a>:<br> |
| <dl><dt><a name="SSIPCommandError-__getattribute__"><strong>__getattribute__</strong></a>(self, name, /)</dt><dd><span class="code">Return getattr(self, name).</span></dd></dl> |
| |
| <dl><dt><a name="SSIPCommandError-__reduce__"><strong>__reduce__</strong></a>(self, /)</dt><dd><span class="code">Helper for pickle.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPCommandError-__repr__"><strong>__repr__</strong></a>(self, /)</dt><dd><span class="code">Return repr(self).</span></dd></dl> |
| |
| <dl><dt><a name="SSIPCommandError-__setstate__"><strong>__setstate__</strong></a>(self, object, /)</dt></dl> |
| |
| <dl><dt><a name="SSIPCommandError-__str__"><strong>__str__</strong></a>(self, /)</dt><dd><span class="code">Return str(self).</span></dd></dl> |
| |
| <dl><dt><a name="SSIPCommandError-add_note"><strong>add_note</strong></a>(self, object, /)</dt><dd><span class="code"><a href="builtins.html#Exception">Exception</a>.<a href="#SSIPCommandError-add_note">add_note</a>(note) --<br> |
| add a note to the exception</span></dd></dl> |
| |
| <dl><dt><a name="SSIPCommandError-with_traceback"><strong>with_traceback</strong></a>(self, object, /)</dt><dd><span class="code"><a href="builtins.html#Exception">Exception</a>.<a href="#SSIPCommandError-with_traceback">with_traceback</a>(tb) --<br> |
| set self.<strong>__traceback__</strong> to tb and return self.</span></dd></dl> |
| |
| <hr> |
| Data descriptors inherited from <a href="builtins.html#BaseException">builtins.BaseException</a>:<br> |
| <dl><dt><strong>__cause__</strong></dt> |
| <dd><span class="code">exception cause</span></dd> |
| </dl> |
| <dl><dt><strong>__context__</strong></dt> |
| <dd><span class="code">exception context</span></dd> |
| </dl> |
| <dl><dt><strong>__dict__</strong></dt> |
| </dl> |
| <dl><dt><strong>__suppress_context__</strong></dt> |
| </dl> |
| <dl><dt><strong>__traceback__</strong></dt> |
| </dl> |
| <dl><dt><strong>args</strong></dt> |
| </dl> |
| </td></tr></table> <p> |
| <table class="section"> |
| <tr class="decor title-decor heading-text"> |
| <td class="section-title" colspan=3> <br><a name="SSIPCommunicationError">class <strong>SSIPCommunicationError</strong></a>(<a href="speechd.client.html#SSIPError">SSIPError</a>)</td></tr> |
| |
| <tr><td class="decor title-decor" rowspan=2><span class="code"> </span></td> |
| <td class="decor title-decor" colspan=2><span class="code"><a href="#SSIPCommunicationError">SSIPCommunicationError</a>(description=None, original_exception=None, **kwargs)<br> |
| <br> |
| <a href="builtins.html#Exception">Exception</a> raised when trying to operate on a closed connection.<br> </span></td></tr> |
| <tr><td> </td> |
| <td class="singlecolumn"><dl><dt>Method resolution order:</dt> |
| <dd><a href="speechd.client.html#SSIPCommunicationError">SSIPCommunicationError</a></dd> |
| <dd><a href="speechd.client.html#SSIPError">SSIPError</a></dd> |
| <dd><a href="builtins.html#Exception">builtins.Exception</a></dd> |
| <dd><a href="builtins.html#BaseException">builtins.BaseException</a></dd> |
| <dd><a href="builtins.html#object">builtins.object</a></dd> |
| </dl> |
| <hr> |
| Methods defined here:<br> |
| <dl><dt><a name="SSIPCommunicationError-__init__"><strong>__init__</strong></a>(self, description=None, original_exception=None, **kwargs)</dt><dd><span class="code">Initialize self. See help(type(self)) for accurate signature.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPCommunicationError-__str__"><strong>__str__</strong></a>(self)</dt><dd><span class="code">Return str(self).</span></dd></dl> |
| |
| <dl><dt><a name="SSIPCommunicationError-additional_exception"><strong>additional_exception</strong></a>(self)</dt><dd><span class="code">Return an additional exception<br> |
| <br> |
| Additional exceptions araise from failed attempts to resolve<br> |
| the former problem</span></dd></dl> |
| |
| <dl><dt><a name="SSIPCommunicationError-description"><strong>description</strong></a>(self)</dt><dd><span class="code">Return error description</span></dd></dl> |
| |
| <dl><dt><a name="SSIPCommunicationError-original_exception"><strong>original_exception</strong></a>(self)</dt><dd><span class="code">Return the original exception if any<br> |
| <br> |
| If this exception is secondary, being caused by a lower<br> |
| level exception, return this original exception, otherwise<br> |
| None</span></dd></dl> |
| |
| <dl><dt><a name="SSIPCommunicationError-set_additional_exception"><strong>set_additional_exception</strong></a>(self, exception)</dt><dd><span class="code">Set an additional exception<br> |
| <br> |
| See method <a href="#SSIPCommunicationError-additional_exception">additional_exception</a>().</span></dd></dl> |
| |
| <hr> |
| Data descriptors inherited from <a href="speechd.client.html#SSIPError">SSIPError</a>:<br> |
| <dl><dt><strong>__weakref__</strong></dt> |
| <dd><span class="code">list of weak references to the object</span></dd> |
| </dl> |
| <hr> |
| Static methods inherited from <a href="builtins.html#Exception">builtins.Exception</a>:<br> |
| <dl><dt><a name="SSIPCommunicationError-__new__"><strong>__new__</strong></a>(*args, **kwargs)<span class="grey"><span class="heading-text"> class method of <a href="builtins.html#Exception">builtins.Exception</a></span></span></dt><dd><span class="code">Create and return a new <a href="builtins.html#object">object</a>. See help(type) for accurate signature.</span></dd></dl> |
| |
| <hr> |
| Methods inherited from <a href="builtins.html#BaseException">builtins.BaseException</a>:<br> |
| <dl><dt><a name="SSIPCommunicationError-__getattribute__"><strong>__getattribute__</strong></a>(self, name, /)</dt><dd><span class="code">Return getattr(self, name).</span></dd></dl> |
| |
| <dl><dt><a name="SSIPCommunicationError-__reduce__"><strong>__reduce__</strong></a>(self, /)</dt><dd><span class="code">Helper for pickle.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPCommunicationError-__repr__"><strong>__repr__</strong></a>(self, /)</dt><dd><span class="code">Return repr(self).</span></dd></dl> |
| |
| <dl><dt><a name="SSIPCommunicationError-__setstate__"><strong>__setstate__</strong></a>(self, object, /)</dt></dl> |
| |
| <dl><dt><a name="SSIPCommunicationError-add_note"><strong>add_note</strong></a>(self, object, /)</dt><dd><span class="code"><a href="builtins.html#Exception">Exception</a>.<a href="#SSIPCommunicationError-add_note">add_note</a>(note) --<br> |
| add a note to the exception</span></dd></dl> |
| |
| <dl><dt><a name="SSIPCommunicationError-with_traceback"><strong>with_traceback</strong></a>(self, object, /)</dt><dd><span class="code"><a href="builtins.html#Exception">Exception</a>.<a href="#SSIPCommunicationError-with_traceback">with_traceback</a>(tb) --<br> |
| set self.<strong>__traceback__</strong> to tb and return self.</span></dd></dl> |
| |
| <hr> |
| Data descriptors inherited from <a href="builtins.html#BaseException">builtins.BaseException</a>:<br> |
| <dl><dt><strong>__cause__</strong></dt> |
| <dd><span class="code">exception cause</span></dd> |
| </dl> |
| <dl><dt><strong>__context__</strong></dt> |
| <dd><span class="code">exception context</span></dd> |
| </dl> |
| <dl><dt><strong>__dict__</strong></dt> |
| </dl> |
| <dl><dt><strong>__suppress_context__</strong></dt> |
| </dl> |
| <dl><dt><strong>__traceback__</strong></dt> |
| </dl> |
| <dl><dt><strong>args</strong></dt> |
| </dl> |
| </td></tr></table> <p> |
| <table class="section"> |
| <tr class="decor title-decor heading-text"> |
| <td class="section-title" colspan=3> <br><a name="SSIPDataError">class <strong>SSIPDataError</strong></a>(<a href="speechd.client.html#SSIPResponseError">SSIPResponseError</a>)</td></tr> |
| |
| <tr><td class="decor title-decor" rowspan=2><span class="code"> </span></td> |
| <td class="decor title-decor" colspan=2><span class="code"><a href="#SSIPDataError">SSIPDataError</a>(code, msg, data)<br> |
| <br> |
| <a href="builtins.html#Exception">Exception</a> raised on error response after sending data.<br> </span></td></tr> |
| <tr><td> </td> |
| <td class="singlecolumn"><dl><dt>Method resolution order:</dt> |
| <dd><a href="speechd.client.html#SSIPDataError">SSIPDataError</a></dd> |
| <dd><a href="speechd.client.html#SSIPResponseError">SSIPResponseError</a></dd> |
| <dd><a href="builtins.html#Exception">builtins.Exception</a></dd> |
| <dd><a href="builtins.html#BaseException">builtins.BaseException</a></dd> |
| <dd><a href="builtins.html#object">builtins.object</a></dd> |
| </dl> |
| <hr> |
| Methods defined here:<br> |
| <dl><dt><a name="SSIPDataError-data"><strong>data</strong></a>(self)</dt><dd><span class="code">Return the data which resulted in this error.</span></dd></dl> |
| |
| <hr> |
| Methods inherited from <a href="speechd.client.html#SSIPResponseError">SSIPResponseError</a>:<br> |
| <dl><dt><a name="SSIPDataError-__init__"><strong>__init__</strong></a>(self, code, msg, data)</dt><dd><span class="code">Initialize self. See help(type(self)) for accurate signature.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPDataError-code"><strong>code</strong></a>(self)</dt><dd><span class="code">Return the server response error code as integer number.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPDataError-msg"><strong>msg</strong></a>(self)</dt><dd><span class="code">Return server response error message as string.</span></dd></dl> |
| |
| <hr> |
| Data descriptors inherited from <a href="speechd.client.html#SSIPResponseError">SSIPResponseError</a>:<br> |
| <dl><dt><strong>__weakref__</strong></dt> |
| <dd><span class="code">list of weak references to the object</span></dd> |
| </dl> |
| <hr> |
| Static methods inherited from <a href="builtins.html#Exception">builtins.Exception</a>:<br> |
| <dl><dt><a name="SSIPDataError-__new__"><strong>__new__</strong></a>(*args, **kwargs)<span class="grey"><span class="heading-text"> class method of <a href="builtins.html#Exception">builtins.Exception</a></span></span></dt><dd><span class="code">Create and return a new <a href="builtins.html#object">object</a>. See help(type) for accurate signature.</span></dd></dl> |
| |
| <hr> |
| Methods inherited from <a href="builtins.html#BaseException">builtins.BaseException</a>:<br> |
| <dl><dt><a name="SSIPDataError-__getattribute__"><strong>__getattribute__</strong></a>(self, name, /)</dt><dd><span class="code">Return getattr(self, name).</span></dd></dl> |
| |
| <dl><dt><a name="SSIPDataError-__reduce__"><strong>__reduce__</strong></a>(self, /)</dt><dd><span class="code">Helper for pickle.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPDataError-__repr__"><strong>__repr__</strong></a>(self, /)</dt><dd><span class="code">Return repr(self).</span></dd></dl> |
| |
| <dl><dt><a name="SSIPDataError-__setstate__"><strong>__setstate__</strong></a>(self, object, /)</dt></dl> |
| |
| <dl><dt><a name="SSIPDataError-__str__"><strong>__str__</strong></a>(self, /)</dt><dd><span class="code">Return str(self).</span></dd></dl> |
| |
| <dl><dt><a name="SSIPDataError-add_note"><strong>add_note</strong></a>(self, object, /)</dt><dd><span class="code"><a href="builtins.html#Exception">Exception</a>.<a href="#SSIPDataError-add_note">add_note</a>(note) --<br> |
| add a note to the exception</span></dd></dl> |
| |
| <dl><dt><a name="SSIPDataError-with_traceback"><strong>with_traceback</strong></a>(self, object, /)</dt><dd><span class="code"><a href="builtins.html#Exception">Exception</a>.<a href="#SSIPDataError-with_traceback">with_traceback</a>(tb) --<br> |
| set self.<strong>__traceback__</strong> to tb and return self.</span></dd></dl> |
| |
| <hr> |
| Data descriptors inherited from <a href="builtins.html#BaseException">builtins.BaseException</a>:<br> |
| <dl><dt><strong>__cause__</strong></dt> |
| <dd><span class="code">exception cause</span></dd> |
| </dl> |
| <dl><dt><strong>__context__</strong></dt> |
| <dd><span class="code">exception context</span></dd> |
| </dl> |
| <dl><dt><strong>__dict__</strong></dt> |
| </dl> |
| <dl><dt><strong>__suppress_context__</strong></dt> |
| </dl> |
| <dl><dt><strong>__traceback__</strong></dt> |
| </dl> |
| <dl><dt><strong>args</strong></dt> |
| </dl> |
| </td></tr></table> <p> |
| <table class="section"> |
| <tr class="decor title-decor heading-text"> |
| <td class="section-title" colspan=3> <br><a name="SSIPError">class <strong>SSIPError</strong></a>(<a href="builtins.html#Exception">builtins.Exception</a>)</td></tr> |
| |
| <tr><td class="decor title-decor" rowspan=2><span class="code"> </span></td> |
| <td class="decor title-decor" colspan=2><span class="code">Common base class for exceptions during SSIP communication.<br> </span></td></tr> |
| <tr><td> </td> |
| <td class="singlecolumn"><dl><dt>Method resolution order:</dt> |
| <dd><a href="speechd.client.html#SSIPError">SSIPError</a></dd> |
| <dd><a href="builtins.html#Exception">builtins.Exception</a></dd> |
| <dd><a href="builtins.html#BaseException">builtins.BaseException</a></dd> |
| <dd><a href="builtins.html#object">builtins.object</a></dd> |
| </dl> |
| <hr> |
| Data descriptors defined here:<br> |
| <dl><dt><strong>__weakref__</strong></dt> |
| <dd><span class="code">list of weak references to the object</span></dd> |
| </dl> |
| <hr> |
| Methods inherited from <a href="builtins.html#Exception">builtins.Exception</a>:<br> |
| <dl><dt><a name="SSIPError-__init__"><strong>__init__</strong></a>(self, /, *args, **kwargs)</dt><dd><span class="code">Initialize self. See help(type(self)) for accurate signature.</span></dd></dl> |
| |
| <hr> |
| Static methods inherited from <a href="builtins.html#Exception">builtins.Exception</a>:<br> |
| <dl><dt><a name="SSIPError-__new__"><strong>__new__</strong></a>(*args, **kwargs)<span class="grey"><span class="heading-text"> class method of <a href="builtins.html#Exception">builtins.Exception</a></span></span></dt><dd><span class="code">Create and return a new <a href="builtins.html#object">object</a>. See help(type) for accurate signature.</span></dd></dl> |
| |
| <hr> |
| Methods inherited from <a href="builtins.html#BaseException">builtins.BaseException</a>:<br> |
| <dl><dt><a name="SSIPError-__getattribute__"><strong>__getattribute__</strong></a>(self, name, /)</dt><dd><span class="code">Return getattr(self, name).</span></dd></dl> |
| |
| <dl><dt><a name="SSIPError-__reduce__"><strong>__reduce__</strong></a>(self, /)</dt><dd><span class="code">Helper for pickle.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPError-__repr__"><strong>__repr__</strong></a>(self, /)</dt><dd><span class="code">Return repr(self).</span></dd></dl> |
| |
| <dl><dt><a name="SSIPError-__setstate__"><strong>__setstate__</strong></a>(self, object, /)</dt></dl> |
| |
| <dl><dt><a name="SSIPError-__str__"><strong>__str__</strong></a>(self, /)</dt><dd><span class="code">Return str(self).</span></dd></dl> |
| |
| <dl><dt><a name="SSIPError-add_note"><strong>add_note</strong></a>(self, object, /)</dt><dd><span class="code"><a href="builtins.html#Exception">Exception</a>.<a href="#SSIPError-add_note">add_note</a>(note) --<br> |
| add a note to the exception</span></dd></dl> |
| |
| <dl><dt><a name="SSIPError-with_traceback"><strong>with_traceback</strong></a>(self, object, /)</dt><dd><span class="code"><a href="builtins.html#Exception">Exception</a>.<a href="#SSIPError-with_traceback">with_traceback</a>(tb) --<br> |
| set self.<strong>__traceback__</strong> to tb and return self.</span></dd></dl> |
| |
| <hr> |
| Data descriptors inherited from <a href="builtins.html#BaseException">builtins.BaseException</a>:<br> |
| <dl><dt><strong>__cause__</strong></dt> |
| <dd><span class="code">exception cause</span></dd> |
| </dl> |
| <dl><dt><strong>__context__</strong></dt> |
| <dd><span class="code">exception context</span></dd> |
| </dl> |
| <dl><dt><strong>__dict__</strong></dt> |
| </dl> |
| <dl><dt><strong>__suppress_context__</strong></dt> |
| </dl> |
| <dl><dt><strong>__traceback__</strong></dt> |
| </dl> |
| <dl><dt><strong>args</strong></dt> |
| </dl> |
| </td></tr></table> <p> |
| <table class="section"> |
| <tr class="decor title-decor heading-text"> |
| <td class="section-title" colspan=3> <br><a name="SSIPResponseError">class <strong>SSIPResponseError</strong></a>(<a href="builtins.html#Exception">builtins.Exception</a>)</td></tr> |
| |
| <tr><td class="decor title-decor" rowspan=2><span class="code"> </span></td> |
| <td class="decor title-decor" colspan=2><span class="code"><a href="#SSIPResponseError">SSIPResponseError</a>(code, msg, data)<br> |
| <br> |
| <br> </span></td></tr> |
| <tr><td> </td> |
| <td class="singlecolumn"><dl><dt>Method resolution order:</dt> |
| <dd><a href="speechd.client.html#SSIPResponseError">SSIPResponseError</a></dd> |
| <dd><a href="builtins.html#Exception">builtins.Exception</a></dd> |
| <dd><a href="builtins.html#BaseException">builtins.BaseException</a></dd> |
| <dd><a href="builtins.html#object">builtins.object</a></dd> |
| </dl> |
| <hr> |
| Methods defined here:<br> |
| <dl><dt><a name="SSIPResponseError-__init__"><strong>__init__</strong></a>(self, code, msg, data)</dt><dd><span class="code">Initialize self. See help(type(self)) for accurate signature.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPResponseError-code"><strong>code</strong></a>(self)</dt><dd><span class="code">Return the server response error code as integer number.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPResponseError-msg"><strong>msg</strong></a>(self)</dt><dd><span class="code">Return server response error message as string.</span></dd></dl> |
| |
| <hr> |
| Data descriptors defined here:<br> |
| <dl><dt><strong>__weakref__</strong></dt> |
| <dd><span class="code">list of weak references to the object</span></dd> |
| </dl> |
| <hr> |
| Static methods inherited from <a href="builtins.html#Exception">builtins.Exception</a>:<br> |
| <dl><dt><a name="SSIPResponseError-__new__"><strong>__new__</strong></a>(*args, **kwargs)<span class="grey"><span class="heading-text"> class method of <a href="builtins.html#Exception">builtins.Exception</a></span></span></dt><dd><span class="code">Create and return a new <a href="builtins.html#object">object</a>. See help(type) for accurate signature.</span></dd></dl> |
| |
| <hr> |
| Methods inherited from <a href="builtins.html#BaseException">builtins.BaseException</a>:<br> |
| <dl><dt><a name="SSIPResponseError-__getattribute__"><strong>__getattribute__</strong></a>(self, name, /)</dt><dd><span class="code">Return getattr(self, name).</span></dd></dl> |
| |
| <dl><dt><a name="SSIPResponseError-__reduce__"><strong>__reduce__</strong></a>(self, /)</dt><dd><span class="code">Helper for pickle.</span></dd></dl> |
| |
| <dl><dt><a name="SSIPResponseError-__repr__"><strong>__repr__</strong></a>(self, /)</dt><dd><span class="code">Return repr(self).</span></dd></dl> |
| |
| <dl><dt><a name="SSIPResponseError-__setstate__"><strong>__setstate__</strong></a>(self, object, /)</dt></dl> |
| |
| <dl><dt><a name="SSIPResponseError-__str__"><strong>__str__</strong></a>(self, /)</dt><dd><span class="code">Return str(self).</span></dd></dl> |
| |
| <dl><dt><a name="SSIPResponseError-add_note"><strong>add_note</strong></a>(self, object, /)</dt><dd><span class="code"><a href="builtins.html#Exception">Exception</a>.<a href="#SSIPResponseError-add_note">add_note</a>(note) --<br> |
| add a note to the exception</span></dd></dl> |
| |
| <dl><dt><a name="SSIPResponseError-with_traceback"><strong>with_traceback</strong></a>(self, object, /)</dt><dd><span class="code"><a href="builtins.html#Exception">Exception</a>.<a href="#SSIPResponseError-with_traceback">with_traceback</a>(tb) --<br> |
| set self.<strong>__traceback__</strong> to tb and return self.</span></dd></dl> |
| |
| <hr> |
| Data descriptors inherited from <a href="builtins.html#BaseException">builtins.BaseException</a>:<br> |
| <dl><dt><strong>__cause__</strong></dt> |
| <dd><span class="code">exception cause</span></dd> |
| </dl> |
| <dl><dt><strong>__context__</strong></dt> |
| <dd><span class="code">exception context</span></dd> |
| </dl> |
| <dl><dt><strong>__dict__</strong></dt> |
| </dl> |
| <dl><dt><strong>__suppress_context__</strong></dt> |
| </dl> |
| <dl><dt><strong>__traceback__</strong></dt> |
| </dl> |
| <dl><dt><strong>args</strong></dt> |
| </dl> |
| </td></tr></table> <p> |
| <table class="section"> |
| <tr class="decor title-decor heading-text"> |
| <td class="section-title" colspan=3> <br><a name="Scope">class <strong>Scope</strong></a>(<a href="builtins.html#object">builtins.object</a>)</td></tr> |
| |
| <tr><td class="decor title-decor" rowspan=2><span class="code"> </span></td> |
| <td class="decor title-decor" colspan=2><span class="code">An enumeration of valid SSIP command scopes.<br> |
| <br> |
| The constants of this class should be used to specify the 'scope' argument<br> |
| for the '<a href="#Client">Client</a>' methods.<br> </span></td></tr> |
| <tr><td> </td> |
| <td class="singlecolumn">Data descriptors defined here:<br> |
| <dl><dt><strong>__dict__</strong></dt> |
| <dd><span class="code">dictionary for instance variables</span></dd> |
| </dl> |
| <dl><dt><strong>__weakref__</strong></dt> |
| <dd><span class="code">list of weak references to the object</span></dd> |
| </dl> |
| <hr> |
| Data and other attributes defined here:<br> |
| <dl><dt><strong>ALL</strong> = 'all'</dl> |
| |
| <dl><dt><strong>SELF</strong> = 'self'</dl> |
| |
| </td></tr></table> <p> |
| <table class="section"> |
| <tr class="decor title-decor heading-text"> |
| <td class="section-title" colspan=3> <br><a name="SpawnError">class <strong>SpawnError</strong></a>(<a href="builtins.html#Exception">builtins.Exception</a>)</td></tr> |
| |
| <tr><td class="decor title-decor" rowspan=2><span class="code"> </span></td> |
| <td class="decor title-decor" colspan=2><span class="code">Indicates failure in server autospawn.<br> </span></td></tr> |
| <tr><td> </td> |
| <td class="singlecolumn"><dl><dt>Method resolution order:</dt> |
| <dd><a href="speechd.client.html#SpawnError">SpawnError</a></dd> |
| <dd><a href="builtins.html#Exception">builtins.Exception</a></dd> |
| <dd><a href="builtins.html#BaseException">builtins.BaseException</a></dd> |
| <dd><a href="builtins.html#object">builtins.object</a></dd> |
| </dl> |
| <hr> |
| Data descriptors defined here:<br> |
| <dl><dt><strong>__weakref__</strong></dt> |
| <dd><span class="code">list of weak references to the object</span></dd> |
| </dl> |
| <hr> |
| Methods inherited from <a href="builtins.html#Exception">builtins.Exception</a>:<br> |
| <dl><dt><a name="SpawnError-__init__"><strong>__init__</strong></a>(self, /, *args, **kwargs)</dt><dd><span class="code">Initialize self. See help(type(self)) for accurate signature.</span></dd></dl> |
| |
| <hr> |
| Static methods inherited from <a href="builtins.html#Exception">builtins.Exception</a>:<br> |
| <dl><dt><a name="SpawnError-__new__"><strong>__new__</strong></a>(*args, **kwargs)<span class="grey"><span class="heading-text"> class method of <a href="builtins.html#Exception">builtins.Exception</a></span></span></dt><dd><span class="code">Create and return a new <a href="builtins.html#object">object</a>. See help(type) for accurate signature.</span></dd></dl> |
| |
| <hr> |
| Methods inherited from <a href="builtins.html#BaseException">builtins.BaseException</a>:<br> |
| <dl><dt><a name="SpawnError-__getattribute__"><strong>__getattribute__</strong></a>(self, name, /)</dt><dd><span class="code">Return getattr(self, name).</span></dd></dl> |
| |
| <dl><dt><a name="SpawnError-__reduce__"><strong>__reduce__</strong></a>(self, /)</dt><dd><span class="code">Helper for pickle.</span></dd></dl> |
| |
| <dl><dt><a name="SpawnError-__repr__"><strong>__repr__</strong></a>(self, /)</dt><dd><span class="code">Return repr(self).</span></dd></dl> |
| |
| <dl><dt><a name="SpawnError-__setstate__"><strong>__setstate__</strong></a>(self, object, /)</dt></dl> |
| |
| <dl><dt><a name="SpawnError-__str__"><strong>__str__</strong></a>(self, /)</dt><dd><span class="code">Return str(self).</span></dd></dl> |
| |
| <dl><dt><a name="SpawnError-add_note"><strong>add_note</strong></a>(self, object, /)</dt><dd><span class="code"><a href="builtins.html#Exception">Exception</a>.<a href="#SpawnError-add_note">add_note</a>(note) --<br> |
| add a note to the exception</span></dd></dl> |
| |
| <dl><dt><a name="SpawnError-with_traceback"><strong>with_traceback</strong></a>(self, object, /)</dt><dd><span class="code"><a href="builtins.html#Exception">Exception</a>.<a href="#SpawnError-with_traceback">with_traceback</a>(tb) --<br> |
| set self.<strong>__traceback__</strong> to tb and return self.</span></dd></dl> |
| |
| <hr> |
| Data descriptors inherited from <a href="builtins.html#BaseException">builtins.BaseException</a>:<br> |
| <dl><dt><strong>__cause__</strong></dt> |
| <dd><span class="code">exception cause</span></dd> |
| </dl> |
| <dl><dt><strong>__context__</strong></dt> |
| <dd><span class="code">exception context</span></dd> |
| </dl> |
| <dl><dt><strong>__dict__</strong></dt> |
| </dl> |
| <dl><dt><strong>__suppress_context__</strong></dt> |
| </dl> |
| <dl><dt><strong>__traceback__</strong></dt> |
| </dl> |
| <dl><dt><strong>args</strong></dt> |
| </dl> |
| </td></tr></table> <p> |
| <table class="section"> |
| <tr class="decor title-decor heading-text"> |
| <td class="section-title" colspan=3> <br><a name="Speaker">class <strong>Speaker</strong></a>(<a href="speechd.client.html#SSIPClient">SSIPClient</a>)</td></tr> |
| |
| <tr><td class="decor title-decor" rowspan=2><span class="code"> </span></td> |
| <td class="decor title-decor" colspan=2><span class="code"><a href="#Speaker">Speaker</a>(<br> |
| name,<br> |
| component='default',<br> |
| user='unknown',<br> |
| address=None,<br> |
| autospawn=None,<br> |
| host=None,<br> |
| port=None,<br> |
| method=None,<br> |
| socket_path=None<br> |
| )<br> |
| <br> |
| Extended Speech Dispatcher Interface.<br> |
| <br> |
| This class provides an extended intercace to Speech Dispatcher<br> |
| functionality and tries to hide most of the lower level details of SSIP<br> |
| (such as a more sophisticated handling of blocks and priorities and<br> |
| advanced event notifications) under a more convenient API.<br> |
| <br> |
| Please note that the API is not yet stabilized and thus is subject to<br> |
| change! Please contact the authors if you plan using it and/or if you have<br> |
| any suggestions.<br> |
| <br> |
| Well, in fact this class is currently not implemented at all. It is just a<br> |
| draft. The intention is to hide the SSIP details and provide a generic<br> |
| interface practical for screen readers.<br> </span></td></tr> |
| <tr><td> </td> |
| <td class="singlecolumn"><dl><dt>Method resolution order:</dt> |
| <dd><a href="speechd.client.html#Speaker">Speaker</a></dd> |
| <dd><a href="speechd.client.html#SSIPClient">SSIPClient</a></dd> |
| <dd><a href="builtins.html#object">builtins.object</a></dd> |
| </dl> |
| <hr> |
| Methods inherited from <a href="speechd.client.html#SSIPClient">SSIPClient</a>:<br> |
| <dl><dt><a name="Speaker-__del__"><strong>__del__</strong></a>(self)</dt><dd><span class="code">Close the connection</span></dd></dl> |
| |
| <dl><dt><a name="Speaker-__init__"><strong>__init__</strong></a>( |
| self, |
| name, |
| component='default', |
| user='unknown', |
| address=None, |
| autospawn=None, |
| host=None, |
| port=None, |
| method=None, |
| socket_path=None |
| )</dt><dd><span class="code">Initialize the instance and connect to the server.<br> |
| <br> |
| Arguments:<br> |
| name -- client identification string<br> |
| component -- connection identification string. When one client opens<br> |
| multiple connections, this can be used to identify each of them.<br> |
| user -- user identification string (user name). When multi-user<br> |
| access is expected, this can be used to identify their connections.<br> |
| address -- server address as specified in Speech Dispatcher<br> |
| documentation (e.g. "unix:/run/user/joe/speech-dispatcher/speechd.sock"<br> |
| or "inet:192.168.0.85:6561")<br> |
| autospawn -- a flag to specify whether the library should<br> |
| try to start the server if it determines its not already<br> |
| running or not<br> |
| <br> |
| Deprecated arguments:<br> |
| method -- communication method to use, one of the constants defined in class<br> |
| <a href="#CommunicationMethod">CommunicationMethod</a><br> |
| socket_path -- for <a href="#CommunicationMethod">CommunicationMethod</a>.UNIX_SOCKET, socket<br> |
| path in filesystem. By default, this is $XDG_RUNTIME_DIR/speech-dispatcher/speechd.sock<br> |
| where $XDG_RUNTIME_DIR is determined using the XDG Base Directory<br> |
| Specification.<br> |
| host -- for <a href="#CommunicationMethod">CommunicationMethod</a>.INET_SOCKET, server hostname<br> |
| or IP address as a string. If None, the default value is<br> |
| taken from SPEECHD_HOST environment variable (if it<br> |
| exists) or from the DEFAULT_HOST attribute of this class.<br> |
| port -- for <a href="#CommunicationMethod">CommunicationMethod</a>.INET_SOCKET method, server<br> |
| port as number or None. If None, the default value is<br> |
| taken from SPEECHD_PORT environment variable (if it<br> |
| exists) or from the DEFAULT_PORT attribute of this class.<br> |
| <br> |
| For more information on client identification strings see Speech<br> |
| Dispatcher documentation.</span></dd></dl> |
| |
| <dl><dt><a name="Speaker-block_begin"><strong>block_begin</strong></a>(self)</dt><dd><span class="code">Begin an SSIP block.<br> |
| <br> |
| See SSIP documentation for more details about blocks.</span></dd></dl> |
| |
| <dl><dt><a name="Speaker-block_end"><strong>block_end</strong></a>(self)</dt><dd><span class="code">Close an SSIP block.<br> |
| <br> |
| See SSIP documentation for more details about blocks.</span></dd></dl> |
| |
| <dl><dt><a name="Speaker-cancel"><strong>cancel</strong></a>(self, scope='self')</dt><dd><span class="code">Immediately stop speaking and discard messages in queues.<br> |
| <br> |
| Arguments:<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="Speaker-char"><strong>char</strong></a>(self, char)</dt><dd><span class="code">Say given character.<br> |
| <br> |
| Arguments:<br> |
| char -- a character to be spoken. Either a Python unicode string or<br> |
| a UTF-8 encoded byte string.<br> |
| <br> |
| This method is non-blocking; it just sends the command, given<br> |
| message is queued on the server and the method returns immediately.</span></dd></dl> |
| |
| <dl><dt><a name="Speaker-close"><strong>close</strong></a>(self)</dt><dd><span class="code">Close the connection to Speech Dispatcher.</span></dd></dl> |
| |
| <dl><dt><a name="Speaker-get_language"><strong>get_language</strong></a>(self)</dt><dd><span class="code">Get the current language.</span></dd></dl> |
| |
| <dl><dt><a name="Speaker-get_output_module"><strong>get_output_module</strong></a>(self)</dt><dd><span class="code">Get the current output module.</span></dd></dl> |
| |
| <dl><dt><a name="Speaker-get_pitch"><strong>get_pitch</strong></a>(self)</dt><dd><span class="code">Get the current pitch.</span></dd></dl> |
| |
| <dl><dt><a name="Speaker-get_punctuation"><strong>get_punctuation</strong></a>(self)</dt><dd><span class="code">Get the punctuation pronunciation level.</span></dd></dl> |
| |
| <dl><dt><a name="Speaker-get_rate"><strong>get_rate</strong></a>(self)</dt><dd><span class="code">Get the current speech rate (speed).</span></dd></dl> |
| |
| <dl><dt><a name="Speaker-get_volume"><strong>get_volume</strong></a>(self)</dt><dd><span class="code">Get the speech volume.</span></dd></dl> |
| |
| <dl><dt><a name="Speaker-key"><strong>key</strong></a>(self, key)</dt><dd><span class="code">Say given key name.<br> |
| <br> |
| Arguments:<br> |
| key -- the key name (as defined in SSIP); string.<br> |
| <br> |
| This method is non-blocking; it just sends the command, given<br> |
| message is queued on the server and the method returns immediately.</span></dd></dl> |
| |
| <dl><dt><a name="Speaker-list_output_modules"><strong>list_output_modules</strong></a>(self)</dt><dd><span class="code">Return names of all active output modules as a tuple of strings.</span></dd></dl> |
| |
| <dl><dt><a name="Speaker-list_synthesis_voices"><strong>list_synthesis_voices</strong></a>(self, language=None, variant=None)</dt><dd><span class="code">Return names of all available voices for the current output module.<br> |
| <br> |
| If language (possibly even variant) is set, only the list matching that<br> |
| language (possibly even variant) is returned.<br> |
| <br> |
| Returns a tuple of tripplets (name, language, variant).<br> |
| <br> |
| 'name' is a string, 'language' is an ISO 639-1 Alpha-2/3 language code<br> |
| and 'variant' is a string. Language and variant may be None.</span></dd></dl> |
| |
| <dl><dt><a name="Speaker-pause"><strong>pause</strong></a>(self, scope='self')</dt><dd><span class="code">Pause speaking and postpone other messages until resume.<br> |
| <br> |
| This method is non-blocking. However, speaking can continue for a<br> |
| short while even after it's called (typically to the end of the<br> |
| sentence).<br> |
| <br> |
| Arguments:<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="Speaker-resume"><strong>resume</strong></a>(self, scope='self')</dt><dd><span class="code">Resume speaking of the currently paused messages.<br> |
| <br> |
| This method is non-blocking. However, speaking can continue for a<br> |
| short while even after it's called (typically to the end of the<br> |
| sentence).<br> |
| <br> |
| Arguments:<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="Speaker-set_cap_let_recogn"><strong>set_cap_let_recogn</strong></a>(self, value, scope='self')</dt><dd><span class="code">Set capital letter recognition mode.<br> |
| <br> |
| Arguments:<br> |
| value -- one of 'none', 'spell', 'icon'. None means no signalization<br> |
| of capital letters, 'spell' means capital letters will be spelled<br> |
| with a synthetic voice and 'icon' means that the capital-letter icon<br> |
| will be prepended before each capital letter.<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="Speaker-set_data_mode"><strong>set_data_mode</strong></a>(self, value)</dt><dd><span class="code">Set the data mode for further speech commands.<br> |
| <br> |
| Arguments:<br> |
| value - one of the constants defined by the <a href="#DataMode">DataMode</a> class.</span></dd></dl> |
| |
| <dl><dt><a name="Speaker-set_debug"><strong>set_debug</strong></a>(self, val)</dt><dd><span class="code">Switch debugging on and off. When switched on,<br> |
| debugging files will be created in the chosen destination<br> |
| (see <a href="#Speaker-set_debug_destination">set_debug_destination</a>()) for Speech Dispatcher and all<br> |
| its running modules. All logging information will then be<br> |
| written into these files with maximal verbosity until switched<br> |
| off. You should always first call set_debug_destination.<br> |
| <br> |
| The intended use of this functionality is to switch debugging<br> |
| on for a period of time while the user will repeat the behavior<br> |
| and then send the logs to the appropriate bug-reporting place.<br> |
| <br> |
| Arguments:<br> |
| val -- a boolean value determining whether debugging<br> |
| is switched on or off<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="Speaker-set_debug_destination"><strong>set_debug_destination</strong></a>(self, path)</dt><dd><span class="code">Set debug destination.<br> |
| <br> |
| Arguments:<br> |
| path -- path (string) to the directory where debugging<br> |
| files will be created<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="Speaker-set_language"><strong>set_language</strong></a>(self, language, scope='self')</dt><dd><span class="code">Switch to a particular language for further speech commands.<br> |
| <br> |
| Arguments:<br> |
| language -- two/three letter language code according to <a href="https://www.rfc-editor.org/rfc/rfc1766.txt">RFC 1766</a> as string, possibly with a region qualification.<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="Speaker-set_output_module"><strong>set_output_module</strong></a>(self, name, scope='self')</dt><dd><span class="code">Switch to a particular output module.<br> |
| <br> |
| Arguments:<br> |
| name -- module (string) as returned by '<a href="#Speaker-list_output_modules">list_output_modules</a>()'.<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="Speaker-set_pause_context"><strong>set_pause_context</strong></a>(self, value, scope='self')</dt><dd><span class="code">Set the amount of context when resuming a paused message.<br> |
| <br> |
| Arguments:<br> |
| value -- a positive or negative value meaning how many chunks of data<br> |
| after or before the pause should be read when <a href="#Speaker-resume">resume</a>() is executed.<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="Speaker-set_pitch"><strong>set_pitch</strong></a>(self, value, scope='self')</dt><dd><span class="code">Set the pitch for further speech commands.<br> |
| <br> |
| Arguments:<br> |
| value -- integer value within the range from -100 to 100, with 0<br> |
| corresponding to the default pitch of the current speech synthesis<br> |
| output module, lower values meaning lower pitch and higher values<br> |
| meaning higher pitch.<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="Speaker-set_pitch_range"><strong>set_pitch_range</strong></a>(self, value, scope='self')</dt><dd><span class="code">Set the pitch range for further speech commands.<br> |
| <br> |
| Arguments:<br> |
| value -- integer value within the range from -100 to 100, with 0<br> |
| corresponding to the default pitch range of the current speech synthesis<br> |
| output module, lower values meaning lower pitch range and higher values<br> |
| meaning higher pitch range.<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="Speaker-set_priority"><strong>set_priority</strong></a>(self, priority)</dt><dd><span class="code">Set the priority category for the following messages.<br> |
| <br> |
| Arguments:<br> |
| priority -- one of the '<a href="#Priority">Priority</a>' constants.</span></dd></dl> |
| |
| <dl><dt><a name="Speaker-set_punctuation"><strong>set_punctuation</strong></a>(self, value, scope='self')</dt><dd><span class="code">Set the punctuation pronunciation level.<br> |
| <br> |
| Arguments:<br> |
| value -- one of the '<a href="#PunctuationMode">PunctuationMode</a>' constants.<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="Speaker-set_rate"><strong>set_rate</strong></a>(self, value, scope='self')</dt><dd><span class="code">Set the speech rate (speed) for further speech commands.<br> |
| <br> |
| Arguments:<br> |
| value -- integer value within the range from -100 to 100, with 0<br> |
| corresponding to the default speech rate of the current speech<br> |
| synthesis output module, lower values meaning slower speech and<br> |
| higher values meaning faster speech.<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="Speaker-set_spelling"><strong>set_spelling</strong></a>(self, value, scope='self')</dt><dd><span class="code">Toggle the spelling mode or on off.<br> |
| <br> |
| Arguments:<br> |
| value -- if 'True', all incoming messages will be spelled<br> |
| instead of being read as normal words. 'False' switches<br> |
| this behavior off.<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="Speaker-set_synthesis_voice"><strong>set_synthesis_voice</strong></a>(self, value, scope='self')</dt><dd><span class="code">Set voice by its real name.<br> |
| <br> |
| Arguments:<br> |
| value -- voice name as returned by '<a href="#Speaker-list_synthesis_voices">list_synthesis_voices</a>()'<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="Speaker-set_voice"><strong>set_voice</strong></a>(self, value, scope='self')</dt><dd><span class="code">Set voice by a symbolic name.<br> |
| <br> |
| Arguments:<br> |
| value -- one of the SSIP symbolic voice names: 'MALE1' .. 'MALE3',<br> |
| 'FEMALE1' ... 'FEMALE3', 'CHILD_MALE', 'CHILD_FEMALE'<br> |
| scope -- see the documentation of this class.<br> |
| <br> |
| Symbolic voice names are mapped to real synthesizer voices in the<br> |
| configuration of the output module. Use the method<br> |
| '<a href="#Speaker-set_synthesis_voice">set_synthesis_voice</a>()' if you want to work with real voices.</span></dd></dl> |
| |
| <dl><dt><a name="Speaker-set_volume"><strong>set_volume</strong></a>(self, value, scope='self')</dt><dd><span class="code">Set the speech volume for further speech commands.<br> |
| <br> |
| Arguments:<br> |
| value -- integer value within the range from -100 to 100, with 100<br> |
| corresponding to the default speech volume of the current speech<br> |
| synthesis output module, lower values meaning softer speech.<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <dl><dt><a name="Speaker-sound_icon"><strong>sound_icon</strong></a>(self, sound_icon)</dt><dd><span class="code">Output given sound_icon.<br> |
| <br> |
| Arguments:<br> |
| sound_icon -- the name of the sound icon as defined by SSIP; string.<br> |
| <br> |
| This method is non-blocking; it just sends the command, given message<br> |
| is queued on the server and the method returns immediately.</span></dd></dl> |
| |
| <dl><dt><a name="Speaker-speak"><strong>speak</strong></a>(self, text, callback=None, event_types=None)</dt><dd><span class="code">Say given message.<br> |
| <br> |
| Arguments:<br> |
| text -- message text to be spoken. This may be either a UTF-8<br> |
| encoded byte string or a Python unicode string.<br> |
| callback -- a callback handler for asynchronous event notifications.<br> |
| A callable <a href="builtins.html#object">object</a> (function) which accepts one positional argument<br> |
| `type' and one keyword argument `index_mark'. See below for more<br> |
| details.<br> |
| event_types -- a tuple of event types for which the callback should<br> |
| be called. Each item must be one of `<a href="#CallbackType">CallbackType</a>' constants.<br> |
| None (the default value) means to handle all event types. This<br> |
| argument is irrelevant when `callback' is not used.<br> |
| <br> |
| The callback function will be called whenever one of the events occurs.<br> |
| The event type will be passed as argument. Its value is one of the<br> |
| `<a href="#CallbackType">CallbackType</a>' constants. In case of an index mark event, additional<br> |
| keyword argument `index_mark' will be passed and will contain the index<br> |
| mark identifier as specified within the text.<br> |
| <br> |
| The callback function should not perform anything complicated and is<br> |
| not allowed to issue any further SSIP client commands. An attempt to<br> |
| do so would lead to a deadlock in SSIP communication.<br> |
| <br> |
| This method is non-blocking; it just sends the command, given<br> |
| message is queued on the server and the method returns immediately.</span></dd></dl> |
| |
| <dl><dt><a name="Speaker-stop"><strong>stop</strong></a>(self, scope='self')</dt><dd><span class="code">Immediately stop speaking the currently spoken message.<br> |
| <br> |
| Arguments:<br> |
| scope -- see the documentation of this class.</span></dd></dl> |
| |
| <hr> |
| Data descriptors inherited from <a href="speechd.client.html#SSIPClient">SSIPClient</a>:<br> |
| <dl><dt><strong>__dict__</strong></dt> |
| <dd><span class="code">dictionary for instance variables</span></dd> |
| </dl> |
| <dl><dt><strong>__weakref__</strong></dt> |
| <dd><span class="code">list of weak references to the object</span></dd> |
| </dl> |
| <hr> |
| Data and other attributes inherited from <a href="speechd.client.html#SSIPClient">SSIPClient</a>:<br> |
| <dl><dt><strong>DEFAULT_HOST</strong> = '127.0.0.1'</dl> |
| |
| <dl><dt><strong>DEFAULT_PORT</strong> = 6560</dl> |
| |
| <dl><dt><strong>DEFAULT_SOCKET_PATH</strong> = 'speech-dispatcher/speechd.sock'</dl> |
| |
| </td></tr></table></td></tr></table> |
| </body></html> |