speech-dispatcher-0.8/0000775000175000017500000000000012113401631011747 500000000000000speech-dispatcher-0.8/src/0000775000175000017500000000000012113401631012536 500000000000000speech-dispatcher-0.8/src/api/0000775000175000017500000000000012113401632013310 500000000000000speech-dispatcher-0.8/src/api/cl/0000775000175000017500000000000011777240701013723 500000000000000speech-dispatcher-0.8/src/api/cl/elisp.lisp0000664000175000017500000000314611777240701015654 00000000000000;;; Elisp compatibility functions ;; Author: Milan Zamazal ;; Copyright (C) 2004 Brailcom, o.p.s. ;; COPYRIGHT NOTICE ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2 of the License, or ;; (at your option) any later version. ;; This program is distributed in the hope that it will be useful, but ;; WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ;; for more details. ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, write to the Free Software ;; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. (in-package :ssip) (defmacro while (condition &body body) `(loop while ,condition do (progn ,@body))) (defun plist-get-internal (plist prop) (cond ((null plist) nil) ((eq (car plist) prop) (cdr plist)) (t (plist-get-internal (nthcdr 2 plist) prop)))) (defun plist-get (plist prop) (first (plist-get-internal plist prop))) (defun plist-member (plist prop) (not (null (plist-get-internal plist prop)))) (defun plist-put (plist prop val) (let ((value (plist-get-internal plist prop))) (if value (progn (rplaca value val) plist) (list* prop val plist)))) (defun user-login-name () (or (getenv "LOGNAME") (getenv "USER"))) (defun concat (&rest args) (apply #'concatenate 'string args)) speech-dispatcher-0.8/src/api/cl/README0000664000175000017500000000112211777240701014517 00000000000000This is a simple Common Lisp interface to Speech Dispatcher through the Speech Synthesis Interface Protocol (SSIP). Currently, there is no documentation, read the sources. The simplest use can be as follows: (asdf:operate-on-system 'asdf:load-op :ssip) (ssip:say-text "Hello, world!") It works with CLisp and SBCL, but it should be easy to port to other systems, just add the support to sysdep.lisp. Feel free to contact us with any questions regarding the Common Lisp interface at the Speech Dispatcher mailing list . -- Milan Zamazal speech-dispatcher-0.8/src/api/cl/ssip.lisp0000664000175000017500000005244611777240701015525 00000000000000;;; Speech Synthesis Interface Protocol (SSIP) interface ;; Author: Milan Zamazal ;; Copyright (C) 2004 Brailcom, o.p.s. ;; COPYRIGHT NOTICE ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2 of the License, or ;; (at your option) any later version. ;; This program is distributed in the hope that it will be useful, but ;; WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ;; for more details. ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, write to the Free Software ;; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ;;; Note: This library was ported from the Elisp library, so don't wonder much ;;; about elispisms found here... (in-package :ssip) ;;; Exported variables (defvar *application-name* "lisp" "String defining current application name.") (defvar *client-name* "default" "String defining current client name. This variable's value defines which connection is used when communicating via SSIP, each connection has its own client name. Usually, you select the proper client (connection) by assigning a value to this variable locally through `let'.") (defvar *language* nil "If non-nil, it is an RFC 1766 language code, as a string. If text is read and this variable is non-nil, the text is read in the given language.") (defvar *spell* nil "If non-nil, any spoken text is spelled.") ;;; Internal constants and configuration variables (defparameter +version+ "$Id: ssip.lisp,v 1.3 2006-02-17 13:18:55 pdm Exp $" "Version stamp of the source file. Useful only for diagnosing problems.") (defvar *language-codes* '(("czech" . "cs") ("english" . "en") ("french" . "fr") ("german" . "de")) "Mapping of LANG values to language ISO codes.") (defvar *default-voice* "male1") (defvar *default-language* (or (cdr (assoc (getenv "LANG") *language-codes* :test #'string=)) "en")) (defparameter +parameter-names+ '((client-name . "CLIENT_NAME") (language . "LANGUAGE") (message-priority . "PRIORITY") (punctuation-mode . "PUNCTUATION") (pause-context . "PAUSE_CONTEXT") (capital-character-mode . "CAP_LET_RECOGN") (voice . "VOICE") (rate . "RATE") (pitch . "PITCH") (spelling-mode . "SPELLING") (output-module . "OUTPUT_MODULE") )) (defparameter +list-parameter-names+ '((voices . "VOICES"))) (defparameter +parameter-value-mappings+ '((message-priority (:important . "IMPORTANT") (:message . "MESSAGE") (:text . "TEXT") (:notification . "NOTIFICATION") (:progress . "PROGRESS") ) (punctuation-mode (:none . "none") (:some . "some") (:all . "all")) (capital-character-mode (:none . "none") (:spell . "spell") (:icon . "icon")) (spelling-mode (t . "on") (nil . "off")))) (defparameter +volatile-parameters+ '(output-module)) (defparameter +punctuation-modes+ '(("none" . none) ("some" . some) ("all" . all))) (defparameter +capital-character-modes+ '(("none" . none) ("spell" . spell) ("icon" . icon))) ;;; Internal variables (defstruct connection name host port (failure-p nil) stream (paused-p nil) (in-block nil) (transaction-state nil) (parameters ()) (forced-priority nil) (last-command nil)) (defstruct request string (transaction-state '(nil nil))) (defvar *connections* (make-hash-table :test #'equal) "Hash table mapping client names to `connection' instances.") (defvar *connection* nil "Current connection.") ;;; Utilities (defmacro iterate-clients (&rest body) `(maphash #'(lambda (*client-name* _) (declare (ignore _)) ,@body) *connections*)) (defmacro iterate-connections (&rest body) `(maphash #'(lambda (_ *connection*) (declare (ignore _)) ,@body) *connections*)) (defun connection-names () "Return the list of all present connection names." (let ((names '())) (iterate-clients (push *client-name* names)) names)) (defmacro with-current-connection (&rest body) `(let ((*connection* (get-connection))) ,@body)) (defmacro with-connection-setting (var value &rest body) (let ((accessor (intern (concat "CONNECTION-" (symbol-name var)))) (orig-value (gensym))) `(let ((,orig-value (,accessor *connection*))) (setf (,accessor *connection*) ,value) (unwind-protect (progn ,@body) (setf (,accessor *connection*) ,orig-value))))) (defmacro with-connection-parameters (parameters &rest body) (let (($parameters (gensym)) ($orig-parameters (gensym)) ($cparameters (gensym)) ($p (gensym)) ($v (gensym)) ($orig-v (gensym)) ($pv (gensym))) `(let* ((,$parameters ,parameters) (,$orig-parameters ())) (unwind-protect (progn (while ,$parameters (let* ((,$p (first ,$parameters)) (,$v (second ,$parameters)) (,$cparameters (connection-parameters *connection*)) (,$orig-v (plist-get ,$cparameters ,$p))) (when (and (not (equal ,$v ,$orig-v)) (or ,$v (not (member ,$p '(language))))) (when (plist-member ,$cparameters ,$p) (push (cons ,$p ,$orig-v) ,$orig-parameters)) (set-parameter ,$p ,$v))) (setq ,$parameters (nthcdr 2 ,$parameters))) ,@body) (dolist (,$pv ,$orig-parameters) (set-parameter (car ,$pv) (cdr ,$pv))))))) ;;; Process management functions (defun get-connection (&optional (name *client-name*) (create-if-needed t)) (or (gethash name *connections*) (and create-if-needed (let ((*client-name* name)) (open-connection))))) (defun close-connection-stream (connection) (let ((stream (connection-stream connection))) (when stream (ignore-errors (close-network-stream stream))) (setf (connection-stream connection) nil))) (defun open-connection (&optional host port &key quiet force-reopen) "Open SSIP connection to given HOST and PORT. If the connection corresponding to the current `*client-name*' value already exists, close it and reopen again, with the same connection parameters. The optional arguments HOST and PORT identify the speechd server location differing from the values of `speechd-host' and `speechd-port'. If the key argument QUIET is non-nil, don't report failures and quit silently. If the key argument FORCE-REOPEN is non-nil, try to reopen an existent connection even if it previously failed. Return the opened connection on success, nil otherwise." (let ((connection (gethash *client-name* *connections*))) (let ((host (or host *host*)) (port (or port *port*))) (when connection (close-connection connection) (setq host (connection-host connection) port (connection-port connection))) (let* ((name *client-name*) (default-parameters (append (cdr (assoc *client-name* *connection-parameters* :test #'string=)) (cdr (assoc t *connection-parameters*)))) (parameters (if connection (append (connection-parameters connection) default-parameters) default-parameters)) (stream (when (or (not connection) (not (connection-failure-p connection)) force-reopen) (ignore-errors (open-network-stream host port))))) (when (and (not stream) (not quiet)) (error "Connection to SSIP failed")) (setq connection (make-connection :name name :host host :port port :stream stream :failure-p (not stream))) (setf (gethash name *connections*) connection) (when stream (set-connection-name name) (setq parameters (append parameters (list 'language *default-language* 'voice *default-voice*))) (let ((already-set '(client-name))) (while parameters (destructuring-bind (parameter value . next) parameters (unless (member parameter already-set) (push parameter already-set) (set-parameter parameter value)) (setq parameters next))))) (let ((priority (and connection (plist-get default-parameters 'message-priority)))) (when priority (set-parameter 'message-priority priority) (setf (connection-forced-priority connection) t))))) connection)) (defun close-connection (&optional (name *client-name*)) "Close speechd connection named NAME." (let ((connection (get-connection name nil))) (when connection (close-connection-stream connection) (remhash name *connections*)))) (defun reopen-connection () "Close and open again all the connections to speechd." (iterate-clients (open-connection :quiet t :force-reopen t))) (defun running-p () "Return non-nil, if the current speechd client name process is running." (let ((connection (get-connection))) (and connection (connection-stream connection)))) ;;; Process communication functions (defun permanent-connection-failure (connection) (close-connection-stream connection) (setf (connection-failure-p connection) t (connection-paused-p connection) nil (connection-transaction-state connection) nil (connection-parameters connection) ())) (defun send-string (string) (with-current-connection (let ((stream (connection-stream *connection*))) (when stream (unwind-protect (format stream "~A" string) (when (not (running-p)) (permanent-connection-failure *connection*))))))) (defun process-request (request) (with-current-connection ;; Ensure proper transaction state (let* ((state-spec (request-transaction-state request)) (required-state (first state-spec)) (new-state (second state-spec))) (labels ((check-state (reopen-if-needed) (let ((current-state (connection-transaction-state *connection*))) (when (and (not (eq current-state required-state)) (not (eq current-state new-state))) (cond ((and (eq required-state 'in-data) (not (eq new-state nil))) (send-data-begin)) ((eq required-state nil) (send-data-end)))) (setq current-state (connection-transaction-state *connection*)) (if (and reopen-if-needed (not (eq current-state required-state)) (not (eq current-state new-state)) (not (connection-failure-p *connection*))) (progn (open-connection) (setq *connection* (get-connection)) (check-state nil)) (eq current-state required-state))))) ;; Continue only if the state can be set properly after reopen, ;; otherwise give up and ignore the request completely. ;; This also works for the "." command when in non-data state. (when (check-state t) (send-string (request-string request)) ;; Read command answer (unless (equal state-spec '(in-data in-data)) (destructuring-bind (answer-line . data-lines) (loop with stream = (connection-stream *connection*) for line = (read-line stream) for lines = (list line) then (cons line lines) while (and (> (length line) 3) (char= (char line 3) #\-)) finally (return lines)) (let* ((code (subseq answer-line 0 3)) (answer (subseq answer-line 4)) (success (member (char code 0) '(#\1 #\2))) (data (and success (mapcar #'(lambda (line) (subseq line 4)) data-lines)))) (when success (setf (connection-transaction-state *connection*) new-state)) (list success data code answer))))))))) (defun send-request (request) (with-current-connection (process-request request))) (defparameter +block-commands+ '(("speak") ("sound_icon") ("char") ("key") ("quit") ("block" ("end")) ("set" ("self" ("rate" "pitch" "voice" "language"))))) (defun block-command-p (command &optional allowed) (unless allowed (setq allowed +block-commands+)) (let* ((match (assoc (first command) allowed :test #'string-equal)) (rest-allowed (cdr match))) (and match (or (not rest-allowed) (block-command-p (rest command) rest-allowed))))) (defun send-command (command &optional (transaction-state '(nil nil))) (unless (listp command) (setq command (list command))) (with-current-connection (setf (connection-last-command *connection*) command) (when (or (not (connection-in-block *connection*)) (block-command-p command)) (send-request (make-request :string (format nil "~{~A~^ ~}~A~A" command #\Return #\Linefeed) :transaction-state transaction-state))))) (defun send-data-begin () (send-command "SPEAK" '(nil in-data))) (defun send-data (text) (let ((text* text)) (flet ((send (string) (unless (string= string "") (send-request (make-request :string string :transaction-state '(in-data in-data)))))) (loop with eol = (format nil "~A~A" #\Return #\Linefeed) for length = (length text*) for nlpos = (or (position #\Linefeed text*) length) for dotted = (and (> (length text*) 0) (char= (char text* 0) #\.)) until (string= text* "") do (progn (when dotted (send ".")) (send (subseq text* 0 nlpos)) (send eol) (setq text* (subseq text* (min (1+ nlpos) length)))))))) (defun send-data-end () (send-command "." '(in-data nil))) ;;; Value retrieval functions (defun list-values (parameter) (second (send-command (list "LIST" (cdr (assoc parameter +list-parameter-names+)))))) ;;; Parameter setting functions (defun convert-numeric (number) (cond ((< number -100) -100) ((> number 100) 100) (t number))) (defun transform-parameter-value (parameter value) (cond ((stringp value) value) ((integerp value) (format nil "~D" (convert-numeric value))) ((symbolp value) (cdr (assoc value (cdr (assoc parameter +parameter-value-mappings+))))))) (defun set-parameter (parameter value) (with-current-connection (let* ((plist (connection-parameters *connection*)) (orig-value (if (plist-member plist parameter) (plist-get plist parameter) 'unknown))) (when (or (member parameter +volatile-parameters+) (and (not (equal orig-value value)) (or (not (eq parameter 'message-priority)) (not (connection-forced-priority *connection*))))) (let ((answer (send-command (let ((p (cdr (assoc parameter +parameter-names+))) (v (transform-parameter-value parameter value))) (unless p (error "Invalid parameter name: `~A'" parameter)) (unless v (error "Invalid parameter value: ~A=~A" parameter value)) (list "SET" "self" p v))))) (setq *connection* (get-connection)) (when (first answer) (setf (connection-parameters *connection*) (plist-put (connection-parameters *connection*) parameter value)))))))) (defun set-connection-name (name) (set-parameter 'client-name (format nil "~A:~A:~A" (user-login-name) *application-name* name))) (defun set-language (language) "Set language of the current client connection to LANGUAGE. Language must be an RFC 1766 language code, as a string." (set-parameter 'language language) (setq *language* language)) ;;; Blocks (defmacro with-block (parameters &rest body) "Set PARAMETERS and enclose BODY by an SSIP block. Before invoking BODY, the BLOCK BEGIN command is sent, and the BLOCK END command is sent afterwards. PARAMETERS is a property list defining parameters to be set before sending the BLOCK BEGIN command. The property-value pairs correspond to the arguments of the `set-parameter' function." `(with-current-connection (with-connection-parameters ,parameters (if (and *connection* (connection-in-block *connection*)) (progn ,@body) (let ((block-connection *connection*)) (send-command '("BLOCK BEGIN")) (unwind-protect (progn (with-current-connection (when *connection* (setf (connection-in-block *connection*) t))) ,@body) (let ((*connection* block-connection)) (when *connection* (setf (connection-in-block *connection*) nil) (let ((*client-name* (connection-name *connection*))) (send-command '("BLOCK END"))))))))))) ;;; Speaking functions (defun say-text (text &key (priority *default-text-priority*)) "Speak the given TEXT, represented by a string. The key argument `priority' defines the priority of the message and must be one of the symbols `important', `message', `text', `notification' or `progress'." (set-parameter 'message-priority priority) (unless (string= text "") (send-data-begin) (send-data text) (send-data-end))) (defun say-sound (name &key (priority *default-sound-priority*)) "Play an auditory icon. NAME is the name of the icon, any string acceptable by speechd. The key argument `priority' defines the priority of the message and must be one of the symbols `important', `message', `text', `notification' or `progress'." (set-parameter 'message-priority priority) (send-command (list "SOUND_ICON" name))) (defun say-char (char &key (priority *default-char-priority*)) "Speak the given CHAR, any UTF-8 character. The key argument `priority' defines the priority of the message and must be one of the symbols `important', `message', `text', `notification' or `progress'." (set-parameter 'message-priority priority) (with-current-connection (with-connection-parameters `(language ,*language*) (send-command (list "CHAR" (format nil "~A" (case char (? "space") (?\n "linefeed") (t (format nil "~A" char))))))))) ;;; Control functions (defun control-command (command all &optional repeatable) (cond ((not all) (when (or repeatable (not (equal (first (connection-last-command (get-connection))) command))) (send-command (list command "self")))) ((numberp all) (iterate-clients (control-command command nil))) (t (send-command (list command "all"))))) (defun cancel (&optional all) "Stop speaking all the messages sent through the current client so far. If the universal argument is given, stop speaking messages of all clients. If a numeric argument is given, stop speaking messages of all current Emacs session clients." (control-command "CANCEL" all)) (defun stop (&optional all) "Stop speaking the currently spoken message (if any) of this client. If the optional argument ALL is non-nil, stop speaking the currently spoken messages of all clients." (control-command "STOP" all t)) (defun pause (&optional all) "Pause speaking in the current client. If the optional argument ALL is non-nil, pause speaking in all clients." (if all (iterate-connections (setf (connection-paused-p *connection*) t)) (setf (connection-paused-p (get-connection)) t)) (control-command "PAUSE" (not (not all)))) (defun resume (&optional all) "Resume previously stopped speaking in the current client. If the optional argument ALL is non-nil, resume speaking messages of all clients." (when (or all (connection-paused-p (get-connection))) (control-command "RESUME" (not (not all))) (if all (setf (connection-paused-p (get-connection)) nil) (iterate-connections (setf (connection-paused-p *connection*) nil))))) speech-dispatcher-0.8/src/api/cl/package.lisp0000664000175000017500000000230711777240701016131 00000000000000;;; Package definition ;; Author: Milan Zamazal ;; Copyright (C) 2004 Brailcom, o.p.s. ;; COPYRIGHT NOTICE ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2 of the License, or ;; (at your option) any later version. ;; This program is distributed in the hope that it will be useful, but ;; WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ;; for more details. ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, write to the Free Software ;; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. (in-package :cl-user) (defpackage :ssip (:use :cl) (:export ;; configuration.lisp #:*application-name* #:*client-name* #:*language* #:*spell* ;; ssip.lisp #:connection-names #:set-language #:open-connection #:close-connection #:reopen-connection #:say-text #:say-sound #:say-char #:cancel #:stop #:pause #:resume )) speech-dispatcher-0.8/src/api/cl/ChangeLog0000664000175000017500000000030311777240701015411 000000000000002004-01-20 Milan Zamazal * sysdep.lisp (open-network-stream): Socket creation for SBCL fixed. * ssip.lisp: Exportable symbolic parameter values converted to keywords. speech-dispatcher-0.8/src/api/cl/configuration.lisp0000664000175000017500000000453711777240701017414 00000000000000;;; Configuration variables ;; Author: Milan Zamazal ;; Copyright (C) 2004 Brailcom, o.p.s. ;; COPYRIGHT NOTICE ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2 of the License, or ;; (at your option) any later version. ;; This program is distributed in the hope that it will be useful, but ;; WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ;; for more details. ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, write to the Free Software ;; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. (in-package :ssip) (defvar *host* "localhost" "Name of the default host running speechd to connect to.") (defvar *port* (or (ignore-errors (car (read-from-string (getenv "SPEECHD_PORT")))) 6560) "Default port of speechd.") (defvar *default-text-priority* :text "Default Speech Dispatcher priority of sent texts.") (defvar *default-sound-priority* :message "Default Speech Dispatcher priority of sent sound icons.") (defvar *default-char-priority* :notification "Default Speech Dispatcher priority of sent single letters.") (defvar *connection-parameters* '() "Alist of connection names and their parameters. Each element of the list is of the form (CONNECTION-NAME . PARAMETERS), where CONNECTION-NAME is a connection name as expected to be in `speechd-client-name' and PARAMETERS is a property list with the pairs of parameter identifiers and parameter values. Valid parameter names are the following symbols: language, message-priority, punctuation-mode, capital-character-mode, voice, rate, pitch, output-module. See the corresponding speechd-set-* functions for valid parameter values. If the symbol t is specified as the connection name, the element defines default connection parameters if no connection specification applies. Only one such an element is allowed in the whole alist. The message-priority parameter has a special meaning: It overrides priority of all messages sent through the connection. You must reopen the connections to apply the changes to this variable.") speech-dispatcher-0.8/src/api/cl/ssip.asd0000664000175000017500000000173511777240701015320 00000000000000;; Copyright (C) 2004 Brailcom, o.p.s. ;; COPYRIGHT NOTICE ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2 of the License, or ;; (at your option) any later version. ;; This program is distributed in the hope that it will be useful, but ;; WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ;; for more details. ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, write to the Free Software ;; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. (in-package :asdf) (defsystem :ssip :depends-on (:regex #+SBCL :sb-bsd-sockets) :components ((:file "package") (:file "sysdep") (:file "elisp") (:file "configuration") (:file "ssip")) :serial t) speech-dispatcher-0.8/src/api/cl/sysdep.lisp0000664000175000017500000000306611777240701016050 00000000000000;;; System dependent functions ;; Author: Milan Zamazal ;; Copyright (C) 2004 Brailcom, o.p.s. ;; COPYRIGHT NOTICE ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2 of the License, or ;; (at your option) any later version. ;; This program is distributed in the hope that it will be useful, but ;; WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ;; for more details. ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, write to the Free Software ;; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. (in-package :ssip) (defun getenv (var) #+SBCL (sb-ext:posix-getenv var) #+CLISP (ext:getenv var)) #+CLISP (defparameter +encoding+ (ext:make-encoding :charset 'charset:utf-8 :line-terminator :unix)) (defun open-network-stream (host port) #+CLISP (socket:socket-connect port host :external-format +encoding+) #+SBCL (let ((s (make-instance 'sb-bsd-sockets:inet-socket :type :stream :protocol :tcp))) (sb-bsd-sockets:socket-connect s (sb-bsd-sockets:host-ent-address (sb-bsd-sockets:get-host-by-name host)) port) (sb-bsd-sockets:socket-make-stream s :input t :output t :buffering :none)) ) (defun close-network-stream (stream) #+(or SBCL CLISP) (close stream)) speech-dispatcher-0.8/src/api/python/0000775000175000017500000000000012113401632014631 500000000000000speech-dispatcher-0.8/src/api/python/README0000664000175000017500000000054411777240701015451 00000000000000This is a Python interface to SSIP. Full range of SSIP commands is implemented including callback handling. See the section "Python API" in Speech Dispatcher documentation for more information. If you have any questions, suggestions, etc., feel free to contact us at the mailing list . -- Tomas Cerha speech-dispatcher-0.8/src/api/python/ChangeLog0000664000175000017500000004137611777240701016353 000000000000002008-12-17 Hynek Hanke * Makefile.in: Create conf/desktop/ directory for installation. 2008-12-10 Hynek Hanke * speechd_config/config.py (Tests.diagnostics.decide_to_test): Set port in ~/.profile and place speechd.desktop in ~/.config/autostart * Makefile.in (all): Handle speechd.desktop. 2008-11-26 Hynek Hanke * Makefile.in (maintainer-clean): Maintainer-clean does clean. 2008-10-15 Hynek Hanke * Makefile.in: Respect ${DESTDIR}. 2008-08-11 Hynek Hanke * speechd_config/config.py (Tests.audio_try_play): Use proper os.path.join for constructing path to the testing wav file. 2008-07-31 Hynek Hanke * speechd_config/config.py (Tests.diagnostics): Only try hearing test if Speech Dispatcher was started successfuly. (Tests.diagnostics.decide_to_test): Do not ask whether to start/restart but first try to stop and then subsequently start via /etc/init.d/ (this covers both cases). 2008-07-14 Hynek Hanke * Makefile.in (clean): Delete speechd_config/paths.py (install): Include prefix correctly. (sysconfdir): Define sysconfdir. 2008-07-12 Hynek Hanke * speechd_config/config.py (Tests.diagnostics.decide_to_test): AudioOutput method is the proper parameter name, not DefaultAudioOutput. 2008-07-11 Hynek Hanke * speechd_config/config.py (Options.__init__): Added basic description into help message. * Makefile.in (all): Typo in directory paths. * speechd_config/config.py (Options.__init__): Include summary message into help. 2008-07-10 Hynek Hanke * speechd_config/config.py (Options): Restructured. test_spd_say: New test. Handle SPEECHD_PORT correctly. (Tests.write_diagnostics_results): New method. Use TMPDIR correctly. (Configuration. (Configure.speechd_start_system): Allow also restart. Bugfixes. 2008-07-09 Hynek Hanke * speechd_config/config.py (Tests.diagnostics.decide_to_test): Also include configuration into debugging archive. * speechd_config/spd-conf: Do not call main() since it will be called automatically on import. * speechd_config/config.py: Typo. * Makefile.in (all): speechd_config/paths.py generation moved from install. * setup.py (speechd_config) New module. * Makefile.in (speechd_config): New module. Write necessary paths into speech_config/conf_path.py 2008-06-27 Hynek Hanke * speechd/client.py (SSIPClient.set_debug): New method. (SSIPClient.set_debug_destination): New method. (SSIPClient.set_debug): New method. (SSIPClient.set_debug_destination): New method. 2008-02-19 Tomas Cerha * README: New file. * speechd/client.py (SSIPClient.__init__): Docstring improved. 2008-02-04 Hynek Hanke * Makefile.in: New file. Propagate $prefix correctly. 2008-01-29 Tomas Cerha * speechd/client.py (SSIPClient.__init__): Use the environment variable `SPEECHD_HOST' if defined. 2007-11-25 Tomas Cerha * speechd/client.py: Handle TypeError while SPEECHD_PORT value conversion. 2007-11-22 Tomas Cerha * speechd/client.py (SSIPClient.__init__): Use the environment variable `SPEECHD_PORT' if defined. 2007-07-11 Tomas Cerha * speechd/client.py (SSIPClient.list_synthesis_voices.split): Convert empty strings to `None'. Docstring improved. 2007-07-10 Tomas Cerha * speechd/_test.py (AutomaticTest.test_callbacks): Test also the `END' callback, which doesn't currently work with Flite. 2007-07-04 Tomas Cerha * speechd/client.py (SSIPClient.resume, SSIPClient.pause): Send the right SSIP commands. 2007-07-03 Tomas Cerha * speechd/client.py (_SSIP_Connection._recv_response): Raise exception if the communication thread is not alive. 2007-07-02 Tomas Cerha * speechd/client.py (SSIPCommunicationError): New class. (_SSIP_Connection._recv_response): Quit if the communication thread is not alive. (_SSIP_Connection.send_command, _SSIP_Connection.send_data): Raise `SSIPCommunicationError' on socket error. 2007-07-02 Hynek Hanke * speechd/_test.py: Voice list test uncommented. 2007-06-26 Tomas Cerha * speechd/_test.py (VoiceTest.test_lists): New test. * speechd/client.py (SSIPClient.list_output_modules) (SSIPClient.list_synthesis_voices, SSIPClient.set_output_module) (SSIPClient.set_synthesis_voice): New methods. 2007-05-03 Hynek Hanke * Makefile (clean): Remove build. 2007-02-21 Tomas Cerha * speechd/_test.py (AutomaticTest.test_callbacks): Added warning. 2007-02-17 Hynek Hanke * speechd/_test.py (AutomaticTest.test_callbacks): Removed comment about Scope.SELF not working. Added TODO comment about fixing this test. 2007-02-05 Tomas Cerha * speechd/client.py (_SSIP_Connection.__init__): Thread name changed. (SSIPClient.__init__): Allocate lock. (SSIPClient._callback_handler): Lock before accessing `self._callbacks'. (SSIPClient.speak): Added more doc. Lock before accessing `self._callbacks'. 2007-01-29 Tomas Cerha * speechd/client.py (SSIPClient._callback_handler) (SSIPClient.speak): Removed prints. * speechd/_test.py (SSIPClientTest.check_callbacks): Wait for callbacks after canceling messages. (TestSuite): Class removed. (tests): Instance removed. (SSIPClientTest): Class split into `AutomaticTest' and `VoiceTest'. (_SSIPClientTest, AutomaticTest, VoiceTest): New classes. (SpeakerTest): Class removed. (get_tests): Function removed. 2007-01-26 Tomas Cerha * speechd/_test.py (SSIPClientTest.check_callbacks): New test. (SSIPClientTest.check_notification): Temporarily commented out. * speechd/client.py (_SSIP_Connection._CALLBACK_TYPE_MAP): New constant. (_SSIP_Connection.__init__): Initialize `self._callback' instead of `self._callbacks'. (_SSIP_Connection._communication): Docstring reformatted. The whole event dispatching rewritten to use `_CALLBACK_TYPE_MAP' and use a single callback function. (_SSIP_Connection.send_command): Docstring typo fixed. (_SSIP_Connection.send_data): Docstring typo fixed. (_SSIP_Connection.send_data): Return also server response data. (_SSIP_Connection.set_callback): Argument `events' removed. Docstring updated and extended. (SSIPClient.__init__): Find out and store the client id. Register callback and turn on notifications for all supported event types. (SSIPClient._callback_handler): New method. (SSIPClient.speak): New keyword arguments `callback' and `event_types'. Docstring extended. Convert `text' to `utf-8' if it is a unicode instance. (SSIPClient.char): Convert `char' to `utf-8' if it is a unicode instance. (SSIPClient.set_notification): Method removed. (SSIPClient.close): Only operate on `self._conn' if it is defined. 2006-11-05 Hynek Hanke * speechd/client.py: IMPORTANT: On initialization of the connection, new lateral thread is started to handle the communication. This thread is terminated when the connection is closed. (_SSIP_Connection._com_buffer): New attribute. (_SSIP_Connection._callbacks): New attribute. (_SSIP_Connection._ssip_reply_semaphore): New attribute. (_SSIP_Connection._communication_thread): New attribute. (_SSIP_Connection.send_command): 'or isinstance(args[0], int)' added back again. This is valid SSIP. (SSIPClient.set_notification): New public API function. * speechd/_test.py (SSIPClientTest.check_notification.my_callback): New test. * speechd/client.py (_SSIP_Connection.__init__): Start the self._communication method in a new thread. (_SSIP_Connection._recv_response): 1->True (_SSIP_Connection._recv_message): Renamed from _recv_response. (SSIPClient.__del__): New destructor. 2006-08-09 Hynek Hanke * setup.py: Use /usr/bin/env instead of /usr/bin/python * Makefile (install): Install with correct prefix. 2006-07-13 Hynek Hanke * Makefile: Only attempt to use distutils if python is installed. 2006-07-11 Hynek Hanke * speechd/client.py: Typos in docstrings. (Speaker): Docstring clarification. Method say() removed. 2006-07-11 Tomas Cerha * speechd/_test.py: `Client' -> `SSIPClient'. (ClientTest): -> `SSIPClientTest'. (SSIPClientTest.check_escapes) (SSIPClientTest.check_voice_properties) (SSIPClientTest.check_other_commands): `say' -> `speak'. (SpeakerTest): New test class. * speechd/client.py (Module): Docstring updated. (Client): Class renamed to `SSIPClient'. (SSIPClient): Docstring improved. (SSIPClient.__init__): Don't initialize `self._current_priority'. (SSIPClient.set_priority): Added docstring. Always send the command. Don't check `self._current_priority'. (SSIPClient.say): Method renamed to `speak'. (SSIPClient.speak, SSIPClient.char, SSIPClient.key) (SSIPClient.sound_icon): The arguent `priority' removed. Don't set the priority here. (Speaker): New class. (Client): New class. 2006-07-10 Tomas Cerha * speechd/_test.py: Import `speechd' not `client'. (Client): Renamed to `ClientTest'. (ClientTest._client): New method. (ClientTest.check_escapes, ClientTest.check_voice_properties) (ClientTest.check_other_commands): New methods. (ClientTest.check_it): Method split into the above new methods. * speechd/client.py: Don't import `string'. (SSIPCommandError, SSIPDataError): Docstrings improved. (_SSIP_Connection.NEWLINE): Renamed to `_NEWLINE'. (_SSIP_Connection.END_OF_DATA_SINGLE): Renamed to `_END_OF_DATA_MARKER'. (_SSIP_Connection.END_OF_DATA_ESCAPED_SINGLE): Renamed to `_END_OF_DATA_MARKER_ESCAPED'. (_SSIP_Connection.END_OF_DATA_BEGIN) (_SSIP_Connection.END_OF_DATA_ESCAPED_BEGIN): Constants removed. (_SSIP_Connection.END_OF_DATA): Renamed to `_END_OF_DATA'. (_SSIP_Connection.END_OF_DATA_ESCAPED): Renamed to `_END_OF_DATA_ESCAPED'. (_SSIP_Connection._readline): Docstring improved. `self.NEWLINE' -> `self._NEWLINE'. (_SSIP_Connection.send_command): `self.NEWLINE' -> `self._NEWLINE'. (_SSIP_Connection.send_data): Use new constant names. (Client.__init__): Initialize the `_priority' attribute to None. (Client._set_priority): Only set the priority if it is different than the last priority stored in the `_priority' attribute. Set this attribute on change. (Client.char): Replace the space by `space' as required by SSIP. (Client.__init__): `self._priority' renamed to `self._current_priority'. (Client._set_priority): Renamed to `_set_priority'. (Client.set_priority): `self._priority' -> `self._current_priority'. (Client.char, Client.key, Client.sound_icon, Client.say): `self._set_priority' -> `self.set_priority'. (Client.pause): Improved docstring formatting. * speechd/util.py: File removed. 2006-06-28 Tomas Cerha * speechd/client.py (SSIPCommandError) (_CommunicationError): Renamed to `SSIPError'. (CommandError): Renamed to `SSIPCommandError'. (SendDataError): Renamed to `SSIPDataError'. (_SSIP_Connection.send_command): Added an assertion on the 'scope' argument for certain commands. (_SSIP_Connection.send_command): `CommandError' -> `SSIPCommandError'. (_SSIP_Connection.send_data): `SendDataError' -> `SSIPDataError'. (Scope, Priority): New classes. (Client): Derive from `object'. Some doc added. (Client.__init__): The `port' default value set to `None'. (Client.__set_priority): Renamed to `_set_priority()'. (Client._set_priority): Use the `Priority' constants for assertion. (__check_scope): Method removed. (Client.say, Client.char, Client.key, Client.sound_icon): Use `Priority' constants for default values. `__set_priority()' -> `_set_priority()'. Docstrings updated. (Client.char): Don't replace space by "space". (Client.cancel, Client.stop, Client.resume, Client.set_language) (Client.set_pitch, Client.set_rate, Client.set_volume) (Client.set_punctuation, Client.set_spelling) (Client.set_cap_let_recogn, Client.set_voice) (Client.set_pause_context): Use `Scope' constants for default values. Don't call `__check_scope()'. Docstrings updated. (Client.say): Only set the priority if it's not a 'MESSAGE'. (Client.set_rate, _SSIP_Connection.send_command): Use the `Scope' constants for assertions. (_SSIP_Connection.close): Unset the `_socket' attribute. (PunctuationMode): New class. (Client.__init__, Client._set_priority): Use the `Scope' constants. (Client.say): Don't set the priority if it is 'MESSAGE'. (Client.set_pitch, Client.set_rate, Client.set_volume) (Client.set_voice, Client.set_pause_context): Use `isinstance' instead of comparint types. (Client.set_punctuation): Use the 'PunctuationMode' constants for assertions. 2006-06-27 Tomas Cerha * speechd/client.py (_SSIP_Connection.__init__): Initialize the `_buffer' attribute. (_SSIP_Connection._readline): Read data from the socket using a buffer, not character by character... (Client.__init__): Require the `name' argument. Changed the default value of `user' to `unknown' and `component' to `default'. (Client.pause): Cosmetical change. 2003-11-20 Tomas Cerha * speechd/client.py (Client): Changed the port number. * speechd/_test.py (get_tests): Don't set the language. 2003-07-22 Tomas Cerha * speechd/_test.py (Client.check_it): Added tests for `set_rate()' and `set_pitch()' methods. (Client.check_it): Added test for Czech language. * speechd/client.py: `Speech Daemon' changed to `Speech Dispatcher'. (_SSIP_Connection): New Class. (Client.RECV_BUFFER_SIZE, Client.SSIP_NEWLINE) (Client._SSIP_END_OF_DATA, Client._SSIP_END_OF_DATA_ESCAPED): Constants removed. (_Socket): Class removed. (Client.__init__): Use `_SSIP_Conection' instead of plain socket. (Client._send_command, Client._send_data, Client._recv_response): Methods removed. (Client.close): Close `self._conn' instead of `self._socket'. (Client.say, Client.stop): Use `self._conn.send_command()' instead of `self._send_command()'. (Client.set_language): New method. (Client.set_pitch): New method. (Client.set_pitch): New method. (Client.get_client_list): Use `self._conn.send_command()' instead of `self._send_command()'. 2003-07-17 Tomas Cerha * speechd/_test.py (Client.check_it): Pass a new `user' argument to `Client' constructor. * speechd/client.py (Client.__init__._Socket): New class. (Client.__init__): Use `_Socket' instead of `socket.socket'. (Client._recv_response): Use `_Socket.readline()'. (module): The commented out C library code removed. (Client.say): Use new priority names. (Client.__init__): Arguments `client_name' and `connection_name' replaced by `user', `client' and `component'. Send `self' in the 'SET self CLIENT_NAME' command. 2003-03-30 Tomas Cerha * speechd/client.py (Client.SPEECH_PORT): Updated docstring. (Client.RECV_BUFFER_SIZE, Client.SSIP_NEWLINE) (Client._SSIP_END_OF_DATA, Client._SSIP_END_OF_DATA_ESCAPED): New constants. (Client._send_command, Client._send_data, Client._recv_response): Use them. (Client._send_data, Client._recv_response): Rewritten, to handle multiline responses. Return response data as third item of returned tuple. (Client.close): Don't send `BYE' command. (Client.say): Don't return server response (isolate client from those details). (Client.get_client_list): New method. 2003-03-29 Tomas Cerha * speechd/client.py (SPEECH_PORT, RECV_BUFFER_SIZE): Moved to class `Client'. (Client): Documentation added. (Client.SPEECH_PORT, Client.RECV_BUFFER_SIZE): New constants. (Client.__init__): `SPEECH_PORT' -> `self.SPEECH_PORT' (Client._send_command): Cosmetic changes. (Client._send_data): Cosmetic changes. (Client._recv_response): Commant added. `RECV_BUFFER_SIZE' -> `self.RECV_BUFFER_SIZE'. (Client.close): Documentation added. (Client.stop): New keyword argument `all'. (Client.say): Documentation added. Return the value of respose code and message. 2003-03-27 Tomas Cerha * speechd/client.py: Import `string' module. (SPEECH_PORT): Added docstring. (RECV_BUFFER_SIZE): New constant. (_CommunicationError): New class. (CommandError): New class. (SendDataError.data): New class. (Client.__init__): Make `client_name' and `conn_name' keyword args. (Client._send_command): Convert `args' to strings. Handle server response. Return resonse code and message. (Client._send_data): New method. (Client._recv_response): New method. (Client.close): Before closing socket send a `BYE' command. (Client.stop): New method. (Client.say): New method. * speechd/_test.py (Client.check_it): Test the `say()' method. speech-dispatcher-0.8/src/api/python/speechd/0000775000175000017500000000000012113401632016244 500000000000000speech-dispatcher-0.8/src/api/python/speechd/paths.py.in0000664000175000017500000000005511777240701020277 00000000000000SPD_SPAWN_CMD = "@bindir@/speech-dispatcher" speech-dispatcher-0.8/src/api/python/speechd/client.py0000664000175000017500000012766511777240701020052 00000000000000# Copyright (C) 2003-2008 Brailcom, o.p.s. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA """Python API to Speech Dispatcher Basic Python client API to Speech Dispatcher is provided by the 'SSIPClient' class. This interface maps directly to available SSIP commands and logic. A more convenient interface is provided by the 'Speaker' class. """ #TODO: Blocking variants for speak, char, key, sound_icon. import socket, sys, os, subprocess, time, tempfile try: import threading except: import dummy_threading as threading from . import paths class CallbackType(object): """Constants describing the available types of callbacks""" INDEX_MARK = 'index_marks' """Index mark events are reported when the place they were included into the text by the client application is reached when speaking them""" BEGIN = 'begin' """The begin event is reported when Speech Dispatcher starts actually speaking the message.""" END = 'end' """The end event is reported after the message has terminated and there is no longer any sound from it being produced""" CANCEL = 'cancel' """The cancel event is reported when a message is canceled either on request of the user, because of prioritization of messages or due to an error""" PAUSE = 'pause' """The pause event is reported after speaking of a message was paused. It no longer produces any audio.""" RESUME = 'resume' """The resume event is reported right after speaking of a message was resumed after previous pause.""" class SSIPError(Exception): """Common base class for exceptions during SSIP communication.""" class SSIPCommunicationError(SSIPError): """Exception raised when trying to operate on a closed connection.""" _additional_exception = None def __init__(self, description=None, original_exception=None, **kwargs): self._original_exception = original_exception self._description = description super(SSIPError, self).__init__(**kwargs) def original_exception(self): """Return the original exception if any If this exception is secondary, being caused by a lower level exception, return this original exception, otherwise None""" return self._original_exception def set_additional_exception(self, exception): """Set an additional exception See method additional_exception(). """ self._additional_exception = exception def additional_exception(self): """Return an additional exception Additional exceptions araise from failed attempts to resolve the former problem""" return self._additional_exception def description(self): """Return error description""" return self._description def __str__(self): msgs = [] if self.description(): msgs.append(self.description()) if self.original_exception: msgs.append("Original error: " + str(self.original_exception())) if self.additional_exception: msgs.append("Additional error: " + str(self.additional_exception())) return "\n".join(msgs) class SSIPResponseError(Exception): def __init__(self, code, msg, data): Exception.__init__(self, "%s: %s" % (code, msg)) self._code = code self._msg = msg self._data = data def code(self): """Return the server response error code as integer number.""" return self._code def msg(self): """Return server response error message as string.""" return self._msg class SSIPCommandError(SSIPResponseError): """Exception raised on error response after sending command.""" def command(self): """Return the command string which resulted in this error.""" return self._data class SSIPDataError(SSIPResponseError): """Exception raised on error response after sending data.""" def data(self): """Return the data which resulted in this error.""" return self._data class SpawnError(Exception): """Indicates failure in server autospawn.""" class CommunicationMethod(object): """Constants describing the possible methods of connection to server.""" UNIX_SOCKET = 'unix_socket' """Unix socket communication using a filesystem path""" INET_SOCKET = 'inet_socket' """Inet socket communication using a host and port""" class _SSIP_Connection(object): """Implemantation of low level SSIP communication.""" _NEWLINE = b"\r\n" _END_OF_DATA_MARKER = b'.' _END_OF_DATA_MARKER_ESCAPED = b'..' _END_OF_DATA = _NEWLINE + _END_OF_DATA_MARKER + _NEWLINE _END_OF_DATA_ESCAPED = _NEWLINE + _END_OF_DATA_MARKER_ESCAPED + _NEWLINE # Constants representing \r\n. and \r\n.. _RAW_DOTLINE = _NEWLINE + _END_OF_DATA_MARKER _ESCAPED_DOTLINE = _NEWLINE + _END_OF_DATA_MARKER_ESCAPED _CALLBACK_TYPE_MAP = {700: CallbackType.INDEX_MARK, 701: CallbackType.BEGIN, 702: CallbackType.END, 703: CallbackType.CANCEL, 704: CallbackType.PAUSE, 705: CallbackType.RESUME, } def __init__(self, communication_method, socket_path, host, port): """Init connection: open the socket to server, initialize buffers, launch a communication handling thread. """ if communication_method == CommunicationMethod.UNIX_SOCKET: socket_family = socket.AF_UNIX socket_connect_args = socket_path elif communication_method == CommunicationMethod.INET_SOCKET: assert host and port socket_family = socket.AF_INET socket_connect_args = (socket.gethostbyname(host), port) else: raise ValueError("Unsupported communication method") try: self._socket = socket.socket(socket_family, socket.SOCK_STREAM) self._socket.connect(socket_connect_args) except socket.error as ex: raise SSIPCommunicationError("Can't open socket using method " + communication_method, original_exception = ex) self._buffer = b"" self._com_buffer = [] self._callback = None self._ssip_reply_semaphore = threading.Semaphore(0) self._communication_thread = \ threading.Thread(target=self._communication, kwargs={}, name="SSIP client communication thread") self._communication_thread.start() def close(self): """Close the server connection, destroy the communication thread.""" # Read-write shutdown here is necessary, otherwise the socket.recv() # function in the other thread won't return at last on some platforms. try: self._socket.shutdown(socket.SHUT_RDWR) except socket.error: pass self._socket.close() # Wait for the other thread to terminate self._communication_thread.join() def _communication(self): """Handle incomming socket communication. Listens for all incomming communication on the socket, dispatches events and puts all other replies into self._com_buffer list in the already parsed form as (code, msg, data). Each time a new item is appended to the _com_buffer list, the corresponding semaphore 'self._ssip_reply_semaphore' is incremented. This method is designed to run in a separate thread. The thread can be interrupted by closing the socket on which it is listening for reading.""" while True: try: code, msg, data = self._recv_message() except IOError: # If the socket has been closed, exit the thread sys.exit() if code//100 != 7: # This is not an index mark nor an event self._com_buffer.append((code, msg, data)) self._ssip_reply_semaphore.release() continue # Ignore the event if no callback function has been registered. if self._callback is not None: type = self._CALLBACK_TYPE_MAP[code] if type == CallbackType.INDEX_MARK: kwargs = {'index_mark': data[2]} else: kwargs = {} # Get message and client ID of the event msg_id, client_id = map(int, data[:2]) self._callback(msg_id, client_id, type, **kwargs) def _readline(self): """Read one whole line from the socket. Blocks until the line delimiter ('_NEWLINE') is read. """ pointer = self._buffer.find(self._NEWLINE) while pointer == -1: try: d = self._socket.recv(1024) except: raise IOError if len(d) == 0: raise IOError self._buffer += d pointer = self._buffer.find(self._NEWLINE) line = self._buffer[:pointer] self._buffer = self._buffer[pointer+len(self._NEWLINE):] return line.decode('utf-8') def _recv_message(self): """Read server response or a callback and return the triplet (code, msg, data).""" data = [] c = None while True: line = self._readline() assert len(line) >= 4, "Malformed data received from server!" code, sep, text = line[:3], line[3], line[4:] assert code.isalnum() and (c is None or code == c) and \ sep in ('-', ' '), "Malformed data received from server!" if sep == ' ': msg = text return int(code), msg, tuple(data) data.append(text) def _recv_response(self): """Read server response from the communication thread and return the triplet (code, msg, data).""" # TODO: This check is dumb but seems to work. The main thread # hangs without it, when the Speech Dispatcher connection is lost. if not self._communication_thread.isAlive(): raise SSIPCommunicationError self._ssip_reply_semaphore.acquire() # The list is sorted, read the first item response = self._com_buffer[0] del self._com_buffer[0] return response def send_command(self, command, *args): """Send SSIP command with given arguments and read server response. Arguments can be of any data type -- they are all stringified before being sent to the server. Returns a triplet (code, msg, data), where 'code' is a numeric SSIP response code as an integer, 'msg' is an SSIP rsponse message as string and 'data' is a tuple of strings (all lines of response data) when a response contains some data. 'SSIPCommandError' is raised in case of non 2xx return code. See SSIP documentation for more information about server responses and codes. 'IOError' is raised when the socket was closed by the remote side. """ if __debug__: if command in ('SET', 'CANCEL', 'STOP',): assert args[0] in (Scope.SELF, Scope.ALL) \ or isinstance(args[0], int) cmd = ' '.join((command,) + tuple(map(str, args))) try: self._socket.send(cmd.encode('utf-8') + self._NEWLINE) except socket.error: raise SSIPCommunicationError("Speech Dispatcher connection lost.") code, msg, data = self._recv_response() if code//100 != 2: raise SSIPCommandError(code, msg, cmd) return code, msg, data def send_data(self, data): """Send multiline data and read server response. Returned value is the same as for 'send_command()' method. 'SSIPDataError' is raised in case of non 2xx return code. See SSIP documentation for more information about server responses and codes. 'IOError' is raised when the socket was closed by the remote side. """ data = data.encode('utf-8') # Escape the end-of-data marker even if present at the beginning # The start of the string is also the start of a line. if data.startswith(self._END_OF_DATA_MARKER): l = len(self._END_OF_DATA_MARKER) data = self._END_OF_DATA_MARKER_ESCAPED + data[l:] # Escape the end of data marker at the start of each subsequent # line. We can do that by simply replacing \r\n. with \r\n.., # since the start of a line is immediately preceded by \r\n, # when the line is not the beginning of the string. data = data.replace(self._RAW_DOTLINE, self._ESCAPED_DOTLINE) try: self._socket.send(data + self._END_OF_DATA) except socket.error: raise SSIPCommunicationError("Speech Dispatcher connection lost.") code, msg, response_data = self._recv_response() if code//100 != 2: raise SSIPDataError(code, msg, data) return code, msg, response_data def set_callback(self, callback): """Register a callback function for handling asynchronous events. Arguments: callback -- a callable object (function) which will be called to handle asynchronous events (arguments described below). Passing `None' results in removing the callback function and ignoring events. Just one callback may be registered. Attempts to register a second callback will result in the former callback being replaced. The callback function must accept three positional arguments ('message_id', 'client_id', 'event_type') and an optional keyword argument 'index_mark' (when INDEX_MARK events are turned on). Note, that setting the callback function doesn't turn the events on. The user is responsible to turn them on by sending the appropriate `SET NOTIFICATION' command. """ self._callback = callback class _CallbackHandler(object): """Internal object which handles callbacks.""" def __init__(self, client_id): self._client_id = client_id self._callbacks = {} self._lock = threading.Lock() def __call__(self, msg_id, client_id, type, **kwargs): if client_id != self._client_id: # TODO: does that ever happen? return self._lock.acquire() try: try: callback, event_types = self._callbacks[msg_id] except KeyError: pass else: if event_types is None or type in event_types: callback(type, **kwargs) if type in (CallbackType.END, CallbackType.CANCEL): del self._callbacks[msg_id] finally: self._lock.release() def add_callback(self, msg_id, callback, event_types): self._lock.acquire() try: self._callbacks[msg_id] = (callback, event_types) finally: self._lock.release() class Scope(object): """An enumeration of valid SSIP command scopes. The constants of this class should be used to specify the 'scope' argument for the 'Client' methods. """ SELF = 'self' """The command (mostly a setting) applies to current connection only.""" ALL = 'all' """The command applies to all current Speech Dispatcher connections.""" class Priority(object): """An enumeration of valid SSIP message priorities. The constants of this class should be used to specify the 'priority' argument for the 'Client' methods. For more information about message priorities and their interaction, see the SSIP documentation. """ IMPORTANT = 'important' TEXT = 'text' MESSAGE = 'message' NOTIFICATION = 'notification' PROGRESS = 'progress' class PunctuationMode(object): """Constants for selecting a punctuation mode. The mode determines which characters should be read. """ ALL = 'all' """Read all punctuation characters.""" NONE = 'none' """Don't read any punctuation character at all.""" SOME = 'some' """Only the user-defined punctuation characters are read. The set of characters is specified in Speech Dispatcher configuration. """ class DataMode(object): """Constants specifying the type of data contained within messages to be spoken. """ TEXT = 'text' """Data is plain text.""" SSML = 'ssml' """Data is SSML (Speech Synthesis Markup Language).""" class SSIPClient(object): """Basic Speech Dispatcher client interface. This class provides a Python interface to Speech Dispatcher functionality over an SSIP connection. The API maps directly to available SSIP commands. Each connection to Speech Dispatcher is represented by one instance of this class. Many commands take the 'scope' argument, thus it is shortly documented here. It is either one of 'Scope' constants or a number of connection. By specifying the connection number, you are applying the command to a particular connection. This feature is only meant to be used by Speech Dispatcher control application, however. More datails can be found in Speech Dispatcher documentation. """ DEFAULT_HOST = '127.0.0.1' """Default host for server connections.""" DEFAULT_PORT = 6560 """Default port number for server connections.""" DEFAULT_SOCKET_PATH = "speech-dispatcher/speechd.sock" """Default name of the communication unix socket""" def __init__(self, name, component='default', user='unknown', address=None, autospawn=None, # Deprecated -> host=None, port=None, method=None, socket_path=None): """Initialize the instance and connect to the server. Arguments: name -- client identification string component -- connection identification string. When one client opens multiple connections, this can be used to identify each of them. user -- user identification string (user name). When multi-user acces is expected, this can be used to identify their connections. address -- server address as specified in Speech Dispatcher documentation (e.g. "unix:/run/user/joe/speech-dispatcher/speechd.sock" or "inet:192.168.0.85:6561") autospawn -- a flag to specify whether the library should try to start the server if it determines its not already running or not Deprecated arguments: method -- communication method to use, one of the constants defined in class CommunicationMethod socket_path -- for CommunicationMethod.UNIX_SOCKET, socket path in filesystem. By default, this is $XDG_RUNTIME_DIR/speech-dispatcher/speechd.sock where $XDG_RUNTIME_DIR is determined using the XDG Base Directory Specification. host -- for CommunicationMethod.INET_SOCKET, server hostname or IP address as a string. If None, the default value is taken from SPEECHD_HOST environment variable (if it exists) or from the DEFAULT_HOST attribute of this class. port -- for CommunicationMethod.INET_SOCKET method, server port as number or None. If None, the default value is taken from SPEECHD_PORT environment variable (if it exists) or from the DEFAULT_PORT attribute of this class. For more information on client identification strings see Speech Dispatcher documentation. """ _home = os.path.expanduser("~") _runtime_dir = os.environ.get('XDG_RUNTIME_DIR', os.environ.get('XDG_CACHE_HOME', os.path.join(_home, '.cache'))) _sock_path = os.path.join(_runtime_dir, self.DEFAULT_SOCKET_PATH) # Resolve connection parameters: connection_args = {'communication_method': CommunicationMethod.UNIX_SOCKET, 'socket_path': _sock_path, 'host': self.DEFAULT_HOST, 'port': self.DEFAULT_PORT, } # Respect address method argument and SPEECHD_ADDRESS environemt variable _address = address or os.environ.get("SPEECHD_ADDRESS") if _address: connection_args.update(self._connection_arguments_from_address(_address)) # Respect the old (deprecated) key arguments and environment variables # TODO: Remove this section in 0.8 release else: # Read the environment variables env_speechd_host = os.environ.get("SPEECHD_HOST") try: env_speechd_port = int(os.environ.get("SPEECHD_PORT")) except: env_speechd_port = None env_speechd_socket_path = os.environ.get("SPEECHD_SOCKET") # Prefer old (deprecated) function arguments, but if # not specified and old (deprecated) environment variable # is set, use the value of the environment variable if method: connection_args['method'] = method if port: connection_args['port'] = port elif env_speechd_port: connection_args['port'] = env_speechd_port if socket_path: connection_args['socket_path'] = socket_path elif env_speechd_socket_path: connection_args['socket_path'] = env_speechd_socket_path self._connect_with_autospawn(connection_args, autospawn) self._initialize_connection(user, name, component) def _connect_with_autospawn(self, connection_args, autospawn): """Establish new connection (and/or autospawn server)""" try: self._conn = _SSIP_Connection(**connection_args) except SSIPCommunicationError as ce: # Suppose server might not be running, try the autospawn mechanism if autospawn != False: # Autospawn is however not guaranteed to start the server. The server # will decide, based on it's configuration, whether to honor the request. try: self._server_spawn(connection_args) except SpawnError as se: ce.set_additional_exception(se) raise ce self._conn = _SSIP_Connection(**connection_args) else: raise def _initialize_connection(self, user, name, component): """Initialize connection -- Set client name, get id, register callbacks etc.""" full_name = '%s:%s:%s' % (user, name, component) self._conn.send_command('SET', Scope.SELF, 'CLIENT_NAME', full_name) code, msg, data = self._conn.send_command('HISTORY', 'GET', 'CLIENT_ID') self._client_id = int(data[0]) self._callback_handler = _CallbackHandler(self._client_id) self._conn.set_callback(self._callback_handler) for event in (CallbackType.INDEX_MARK, CallbackType.BEGIN, CallbackType.END, CallbackType.CANCEL, CallbackType.PAUSE, CallbackType.RESUME): self._conn.send_command('SET', 'self', 'NOTIFICATION', event, 'on') def _connection_arguments_from_address(self, address): """Parse a Speech Dispatcher address line and return a dictionary of connection arguments""" connection_args = {} address_params = address.split(":") try: _method = address_params[0] except: raise SSIPCommunicationErrror("Wrong format of server address") connection_args['communication_method'] = _method if _method == CommunicationMethod.UNIX_SOCKET: try: connection_args['socket_path'] = address_params[1] except IndexError: pass # The additional parameters was not set, let's stay with defaults elif _method == CommunicationMethod.INET_SOCKET: try: connection_args['host'] = address_params[1] connection_args['port'] = int(address_params[2]) except ValueError: # Failed conversion to int raise SSIPCommunicationError("Third parameter of inet_socket address must be a port number") except IndexError: pass # The additional parameters was not set, let's stay with defaults else: raise SSIPCommunicationError("Unknown communication method in address."); return connection_args def __del__(self): """Close the connection""" self.close() def _server_spawn(self, connection_args): """Attempts to spawn the speech-dispatcher server.""" # Check whether we are not connecting to a remote host # TODO: This is a hack. inet sockets specific code should # belong to _SSIPConnection. We do not however have an _SSIPConnection # yet. if connection_args['communication_method'] == 'inet_socket': addrinfos = socket.getaddrinfo(connection_args['host'], connection_args['port']) # Check resolved addrinfos for presence of localhost ip_addresses = [addrinfo[4][0] for addrinfo in addrinfos] localhost=False for ip in ip_addresses: if ip.startswith("127.") or ip == "::1": connection_args['host'] = ip localhost=True if not localhost: # The hostname didn't resolve on localhost in neither case, # do not spawn server on localhost... raise SpawnError( "Can't start server automatically (autospawn), requested address %s " "resolves on %s which seems to be a remote host. You must start the " "server manually or choose another connection address." % (connection_args['host'], str(ip_addresses),)) if os.path.exists(paths.SPD_SPAWN_CMD): connection_params = [] for param, value in connection_args.items(): if param not in ["host",]: connection_params += ["--"+param.replace("_","-"), str(value)] server = subprocess.Popen([paths.SPD_SPAWN_CMD, "--spawn"]+connection_params, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout_reply, stderr_reply = server.communicate() retcode = server.wait() if retcode != 0: raise SpawnError("Server refused to autospawn, stating this reason: %s" % (stderr_reply,)) return server.pid else: raise SpawnError("Can't find Speech Dispatcher spawn command %s" % (paths.SPD_SPAWN_CMD,)) def set_priority(self, priority): """Set the priority category for the following messages. Arguments: priority -- one of the 'Priority' constants. """ assert priority in (Priority.IMPORTANT, Priority.MESSAGE, Priority.TEXT, Priority.NOTIFICATION, Priority.PROGRESS), priority self._conn.send_command('SET', Scope.SELF, 'PRIORITY', priority) def set_data_mode(self, value): """Set the data mode for further speech commands. Arguments: value - one of the constants defined by the DataMode class. """ if value == DataMode.SSML: ssip_val = 'on' elif value == DataMode.TEXT: ssip_val = 'off' else: raise ValueError( 'Value "%s" is not one of the constants from the DataMode class.' % \ value) self._conn.send_command('SET', Scope.SELF, 'SSML_MODE', ssip_val) def speak(self, text, callback=None, event_types=None): """Say given message. Arguments: text -- message text to be spoken. This may be either a UTF-8 encoded byte string or a Python unicode string. callback -- a callback handler for asynchronous event notifications. A callable object (function) which accepts one positional argument `type' and one keyword argument `index_mark'. See below for more details. event_types -- a tuple of event types for which the callback should be called. Each item must be one of `CallbackType' constants. None (the default value) means to handle all event types. This argument is irrelevant when `callback' is not used. The callback function will be called whenever one of the events occurs. The event type will be passed as argument. Its value is one of the `CallbackType' constants. In case of an index mark event, additional keyword argument `index_mark' will be passed and will contain the index mark identifier as specified within the text. The callback function should not perform anything complicated and is not allowed to issue any further SSIP client commands. An attempt to do so would lead to a deadlock in SSIP communication. This method is non-blocking; it just sends the command, given message is queued on the server and the method returns immediately. """ self._conn.send_command('SPEAK') result = self._conn.send_data(text) if callback: msg_id = int(result[2][0]) # TODO: Here we risk, that the callback arrives earlier, than we # add the item to `self._callback_handler'. Such a situation will # lead to the callback being ignored. self._callback_handler.add_callback(msg_id, callback, event_types) return result def char(self, char): """Say given character. Arguments: char -- a character to be spoken. Either a Python unicode string or a UTF-8 encoded byte string. This method is non-blocking; it just sends the command, given message is queued on the server and the method returns immediately. """ self._conn.send_command('CHAR', char.replace(' ', 'space')) def key(self, key): """Say given key name. Arguments: key -- the key name (as defined in SSIP); string. This method is non-blocking; it just sends the command, given message is queued on the server and the method returns immediately. """ self._conn.send_command('KEY', key) def sound_icon(self, sound_icon): """Output given sound_icon. Arguments: sound_icon -- the name of the sound icon as defined by SSIP; string. This method is non-blocking; it just sends the command, given message is queued on the server and the method returns immediately. """ self._conn.send_command('SOUND_ICON', sound_icon) def cancel(self, scope=Scope.SELF): """Immediately stop speaking and discard messages in queues. Arguments: scope -- see the documentation of this class. """ self._conn.send_command('CANCEL', scope) def stop(self, scope=Scope.SELF): """Immediately stop speaking the currently spoken message. Arguments: scope -- see the documentation of this class. """ self._conn.send_command('STOP', scope) def pause(self, scope=Scope.SELF): """Pause speaking and postpone other messages until resume. This method is non-blocking. However, speaking can continue for a short while even after it's called (typically to the end of the sentence). Arguments: scope -- see the documentation of this class. """ self._conn.send_command('PAUSE', scope) def resume(self, scope=Scope.SELF): """Resume speaking of the currently paused messages. This method is non-blocking. However, speaking can continue for a short while even after it's called (typically to the end of the sentence). Arguments: scope -- see the documentation of this class. """ self._conn.send_command('RESUME', scope) def list_output_modules(self): """Return names of all active output modules as a tuple of strings.""" code, msg, data = self._conn.send_command('LIST', 'OUTPUT_MODULES') return data def list_synthesis_voices(self): """Return names of all available voices for the current output module. Returns a tuple of tripplets (name, language, dialect). 'name' is a string, 'language' is an ISO 639-1 Alpha-2 language code and 'dialect' is a string. Language and dialect may be None. """ try: code, msg, data = self._conn.send_command('LIST', 'SYNTHESIS_VOICES') except SSIPCommandError: return () def split(item): name, lang, dialect = tuple(item.rsplit(' ', 3)) return (name, lang or None, dialect or None) return tuple([split(item) for item in data]) def set_language(self, language, scope=Scope.SELF): """Switch to a particular language for further speech commands. Arguments: language -- two letter language code according to RFC 1776 as string. scope -- see the documentation of this class. """ assert isinstance(language, str) and len(language) == 2 self._conn.send_command('SET', scope, 'LANGUAGE', language) def set_output_module(self, name, scope=Scope.SELF): """Switch to a particular output module. Arguments: name -- module (string) as returned by 'list_output_modules()'. scope -- see the documentation of this class. """ self._conn.send_command('SET', scope, 'OUTPUT_MODULE', name) def set_pitch(self, value, scope=Scope.SELF): """Set the pitch for further speech commands. Arguments: value -- integer value within the range from -100 to 100, with 0 corresponding to the default pitch of the current speech synthesis output module, lower values meaning lower pitch and higher values meaning higher pitch. scope -- see the documentation of this class. """ assert isinstance(value, int) and -100 <= value <= 100, value self._conn.send_command('SET', scope, 'PITCH', value) def set_rate(self, value, scope=Scope.SELF): """Set the speech rate (speed) for further speech commands. Arguments: value -- integer value within the range from -100 to 100, with 0 corresponding to the default speech rate of the current speech synthesis output module, lower values meaning slower speech and higher values meaning faster speech. scope -- see the documentation of this class. """ assert isinstance(value, int) and -100 <= value <= 100 self._conn.send_command('SET', scope, 'RATE', value) def set_volume(self, value, scope=Scope.SELF): """Set the speech volume for further speech commands. Arguments: value -- integer value within the range from -100 to 100, with 100 corresponding to the default speech volume of the current speech synthesis output module, lower values meaning softer speech. scope -- see the documentation of this class. """ assert isinstance(value, int) and -100 <= value <= 100 self._conn.send_command('SET', scope, 'VOLUME', value) def set_punctuation(self, value, scope=Scope.SELF): """Set the punctuation pronounciation level. Arguments: value -- one of the 'PunctuationMode' constants. scope -- see the documentation of this class. """ assert value in (PunctuationMode.ALL, PunctuationMode.SOME, PunctuationMode.NONE), value self._conn.send_command('SET', scope, 'PUNCTUATION', value) def set_spelling(self, value, scope=Scope.SELF): """Toogle the spelling mode or on off. Arguments: value -- if 'True', all incomming messages will be spelled instead of being read as normal words. 'False' switches this behavior off. scope -- see the documentation of this class. """ assert value in [True, False] if value == True: self._conn.send_command('SET', scope, 'SPELLING', "on") else: self._conn.send_command('SET', scope, 'SPELLING', "off") def set_cap_let_recogn(self, value, scope=Scope.SELF): """Set capital letter recognition mode. Arguments: value -- one of 'none', 'spell', 'icon'. None means no signalization of capital letters, 'spell' means capital letters will be spelled with a syntetic voice and 'icon' means that the capital-letter icon will be prepended before each capital letter. scope -- see the documentation of this class. """ assert value in ("none", "spell", "icon") self._conn.send_command('SET', scope, 'CAP_LET_RECOGN', value) def set_voice(self, value, scope=Scope.SELF): """Set voice by a symbolic name. Arguments: value -- one of the SSIP symbolic voice names: 'MALE1' .. 'MALE3', 'FEMALE1' ... 'FEMALE3', 'CHILD_MALE', 'CHILD_FEMALE' scope -- see the documentation of this class. Symbolic voice names are mapped to real synthesizer voices in the configuration of the output module. Use the method 'set_synthesis_voice()' if you want to work with real voices. """ assert isinstance(value, str) and \ value.lower() in ("male1", "male2", "male3", "female1", "female2", "female3", "child_male", "child_female") self._conn.send_command('SET', scope, 'VOICE', value) def set_synthesis_voice(self, value, scope=Scope.SELF): """Set voice by its real name. Arguments: value -- voice name as returned by 'list_synthesis_voices()' scope -- see the documentation of this class. """ self._conn.send_command('SET', scope, 'SYNTHESIS_VOICE', value) def set_pause_context(self, value, scope=Scope.SELF): """Set the amount of context when resuming a paused message. Arguments: value -- a positive or negative value meaning how many chunks of data after or before the pause should be read when resume() is executed. scope -- see the documentation of this class. """ assert isinstance(value, int) self._conn.send_command('SET', scope, 'PAUSE_CONTEXT', value) def set_debug(self, val): """Switch debugging on and off. When switched on, debugging files will be created in the chosen destination (see set_debug_destination()) for Speech Dispatcher and all its running modules. All logging information will then be written into these files with maximal verbosity until switched off. You should always first call set_debug_destination. The intended use of this functionality is to switch debuging on for a period of time while the user will repeat the behavior and then send the logs to the appropriate bug-reporting place. Arguments: val -- a boolean value determining whether debugging is switched on or off scope -- see the documentation of this class. """ assert isinstance(val, bool) if val == True: ssip_val = "ON" else: ssip_val = "OFF" self._conn.send_command('SET', scope.ALL, 'DEBUG', ssip_val) def set_debug_destination(self, path): """Set debug destination. Arguments: path -- path (string) to the directory where debuging files will be created scope -- see the documentation of this class. """ assert isinstance(val, string) self._conn.send_command('SET', scope.ALL, 'DEBUG_DESTINATION', val) def block_begin(self): """Begin an SSIP block. See SSIP documentation for more details about blocks. """ self._conn.send_command('BLOCK', 'BEGIN') def block_end(self): """Close an SSIP block. See SSIP documentation for more details about blocks. """ self._conn.send_command('BLOCK', 'END') def close(self): """Close the connection to Speech Dispatcher.""" if hasattr(self, '_conn'): self._conn.close() del self._conn class Client(SSIPClient): """A DEPRECATED backwards-compatible API. This Class is provided only for backwards compatibility with the prevoius unofficial API. It will be removed in future versions. Please use either 'SSIPClient' or 'Speaker' interface instead. As deprecated, the API is no longer documented. """ def __init__(self, name=None, client=None, **kwargs): name = name or client or 'python' super(Client, self).__init__(name, **kwargs) def say(self, text, priority=Priority.MESSAGE): self.set_priority(priority) self.speak(text) def char(self, char, priority=Priority.TEXT): self.set_priority(priority) super(Client, self).char(char) def key(self, key, priority=Priority.TEXT): self.set_priority(priority) super(Client, self).key(key) def sound_icon(self, sound_icon, priority=Priority.TEXT): self.set_priority(priority) super(Client, self).sound_icon(sound_icon) class Speaker(SSIPClient): """Extended Speech Dispatcher Interface. This class provides an extended intercace to Speech Dispatcher functionality and tries to hide most of the lower level details of SSIP (such as a more sophisticated handling of blocks and priorities and advanced event notifications) under a more convenient API. Please note that the API is not yet stabilized and thus is subject to change! Please contact the authors if you plan using it and/or if you have any suggestions. Well, in fact this class is currently not implemented at all. It is just a draft. The intention is to hide the SSIP details and provide a generic interface practical for screen readers. """ # Deprecated but retained for backwards compatibility # This class was introduced in 0.7 but later renamed to CommunicationMethod class ConnectionMethod(object): """Constants describing the possible methods of connection to server. Retained for backwards compatibility but DEPRECATED. See CommunicationMethod.""" UNIX_SOCKET = 'unix_socket' """Unix socket communication using a filesystem path""" INET_SOCKET = 'inet_socket' """Inet socket communication using a host and port""" speech-dispatcher-0.8/src/api/python/speechd/__init__.py0000664000175000017500000000140311777240701020310 00000000000000# Copyright (C) 2001, 2002 Brailcom, o.p.s. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA from .client import * speech-dispatcher-0.8/src/api/python/speechd/_test.py0000664000175000017500000001201011777240701017663 00000000000000#!/usr/bin/env python # Copyright (C) 2003, 2006, 2007 Brailcom, o.p.s. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public Licensex1 as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA import unittest import time from .client import PunctuationMode, CallbackType, SSIPClient, Scope, Speaker class _SSIPClientTest(unittest.TestCase): def setUp(self): self._client = SSIPClient('test') self._client.set_language('en') self._client.set_rate(30) def tearDown(self): self._client.close() class AutomaticTest(_SSIPClientTest): """A set of tests which may be evaluated automatically. Please put all tests which require a user to listen to their output to the VoiceTest below. """ def test_callbacks(self): # TODO: This needs to be fixed. There is no guarantee that # the message will start in one second nor is there any # guarantee that it will start at all. It can be interrupted # by other applications etc. Also there is no guarantee that # the cancel will arrive on time and the end callback will be # received on time. Also the combination cancel/end does not have # to work as expected and SD and the interface can still be ok. # -- Hynek Hanke self._client.set_output_module('flite') called = {CallbackType.BEGIN: [], CallbackType.CANCEL: [], CallbackType.END: []} self._client.speak("This message should get interrupted. It is " "hopefully long enough to last more than 1 second.", callback=lambda type: called[type].append('msg1')) self._client.speak("This second message should not be spoken at all.", callback=lambda type: called[type].append('msg2')) time.sleep(1) self._client.cancel() self._client.speak("Hi.", callback=lambda type: called[type].append('msg3')) # Wait for pending events... time.sleep(3) started, canceled, ended = [called[t] for t in (CallbackType.BEGIN, CallbackType.CANCEL, CallbackType.END)] assert started == ['msg1', 'msg3'] and ended == ['msg3'] and \ 'msg1' in canceled and 'msg2' in canceled and \ 'msg3' not in canceled, \ (called, "This failure only indicates a possible error. The test " "depends on proper timing and results may warry depending " "on the used output module and other conditions. See the " "code of this test method if you want to investigate " "further.") class VoiceTest(_SSIPClientTest): """This set of tests requires a user to listen to it. The success or failure of the tests defined here can not be detected automatically. """ def test_escapes(self): c = self._client c.speak("Testing data escapes:") c.set_punctuation(PunctuationMode.ALL) c.speak(".") c.speak("Marker at the end.\r\n.\r\n") c.speak(".\r\nMarker at the beginning.") def test_voice_properties(self): c = self._client c.speak("Testing voice properties:") c.set_pitch(-100) c.speak("I am fat Billy") c.set_pitch(100) c.speak("I am slim Willy") c.set_pitch(0) c.set_rate(100) c.speak("I am quick Dick.") c.set_rate(-80) c.speak("I am slow Joe.") c.set_rate(0) c.set_pitch(100) c.set_volume(-50) c.speak("I am quiet Mariette.") c.set_volume(100) c.speak("I am noisy Daisy.") def test_other_commands(self): c = self._client c.speak("Testing other commands:") c.char("a") c.key("shift_b") c.sound_icon("empty") def test_lists(self): c = self._client for module in c.list_output_modules(): c.set_output_module(module) print("**", module) c.speak(module +"using default voice") for name, lang, dialect in c.list_synthesis_voices(): print(" -", module, name, lang, dialect) c.set_synthesis_voice(name) c.speak(module +" using voice "+ name) if __name__ == '__main__': unittest.main() speech-dispatcher-0.8/src/api/python/speechd/Makefile.am0000664000175000017500000000066511777240701020244 00000000000000## Process this file with automake to produce Makefile.in speechd_pythondir = $(pyexecdir)/speechd speechd_python_PYTHON = __init__.py _test.py client.py nodist_speechd_python_PYTHON = paths.py edit = sed \ -e 's:@bindir[@]:$(bindir):g' paths.py: Makefile rm -f $@ srcdir=; \ test -f ./$@.in || srcdir=$(srcdir)/; \ $(edit) $${srcdir}$@.in > $@ paths.py: $(srcdir)/paths.py.in CLEANFILES = paths.py EXTRA_DIST = paths.py.in speech-dispatcher-0.8/src/api/python/speechd/Makefile.in0000664000175000017500000004177612113401437020253 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/api/python/speechd DIST_COMMON = $(speechd_python_PYTHON) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__py_compile = PYTHON=$(PYTHON) $(SHELL) $(py_compile) am__installdirs = "$(DESTDIR)$(speechd_pythondir)" \ "$(DESTDIR)$(speechd_pythondir)" py_compile = $(top_srcdir)/py-compile DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOTCONF_CFLAGS = @DOTCONF_CFLAGS@ DOTCONF_LIBS = @DOTCONF_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ EXTRA_ESPEAK_LIBS = @EXTRA_ESPEAK_LIBS@ EXTRA_SOCKET_LIBS = @EXTRA_SOCKET_LIBS@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GMODULE_CFLAGS = @GMODULE_CFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTHREAD_CFLAGS = @GTHREAD_CFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBAO_CFLAGS = @LIBAO_CFLAGS@ LIBAO_LIBS = @LIBAO_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_SPD_AGE = @LIB_SPD_AGE@ LIB_SPD_CURRENT = @LIB_SPD_CURRENT@ LIB_SPD_REVISION = @LIB_SPD_REVISION@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NAS_LIBS = @NAS_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ PULSE_CFLAGS = @PULSE_CFLAGS@ PULSE_LIBS = @PULSE_LIBS@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RDYNAMIC = @RDYNAMIC@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SNDFILE_CFLAGS = @SNDFILE_CFLAGS@ SNDFILE_LIBS = @SNDFILE_LIBS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ audio_dlopen_modules = @audio_dlopen_modules@ audiodir = @audiodir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ clientconfdir = @clientconfdir@ clientconforigdir = @clientconforigdir@ datadir = @datadir@ datarootdir = @datarootdir@ default_audio_method = @default_audio_method@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ flite_basic = @flite_basic@ flite_kal = @flite_kal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ ibmtts_include = @ibmtts_include@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ modulebindir = @modulebindir@ moduleconfdir = @moduleconfdir@ moduleconforigdir = @moduleconforigdir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ snddatadir = @snddatadir@ spdconfdir = @spdconfdir@ spdconforigdir = @spdconforigdir@ spddesktopconforigdir = @spddesktopconforigdir@ spdincludedir = @spdincludedir@ spdlibdir = @spdlibdir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ speechd_pythondir = $(pyexecdir)/speechd speechd_python_PYTHON = __init__.py _test.py client.py nodist_speechd_python_PYTHON = paths.py edit = sed \ -e 's:@bindir[@]:$(bindir):g' CLEANFILES = paths.py EXTRA_DIST = paths.py.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/api/python/speechd/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/api/python/speechd/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-nodist_speechd_pythonPYTHON: $(nodist_speechd_python_PYTHON) @$(NORMAL_INSTALL) test -z "$(speechd_pythondir)" || $(MKDIR_P) "$(DESTDIR)$(speechd_pythondir)" @list='$(nodist_speechd_python_PYTHON)'; dlist=; list2=; test -n "$(speechd_pythondir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \ if test -f $$b$$p; then \ $(am__strip_dir) \ dlist="$$dlist $$f"; \ list2="$$list2 $$b$$p"; \ else :; fi; \ done; \ for file in $$list2; do echo $$file; done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(speechd_pythondir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(speechd_pythondir)" || exit $$?; \ done || exit $$?; \ if test -n "$$dlist"; then \ $(am__py_compile) --destdir "$(DESTDIR)" \ --basedir "$(speechd_pythondir)" $$dlist; \ else :; fi uninstall-nodist_speechd_pythonPYTHON: @$(NORMAL_UNINSTALL) @list='$(nodist_speechd_python_PYTHON)'; test -n "$(speechd_pythondir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ dir='$(DESTDIR)$(speechd_pythondir)'; \ filesc=`echo "$$files" | sed 's|$$|c|'`; \ fileso=`echo "$$files" | sed 's|$$|o|'`; \ st=0; \ for files in "$$files" "$$filesc" "$$fileso"; do \ $(am__uninstall_files_from_dir) || st=$$?; \ done; \ exit $$st install-speechd_pythonPYTHON: $(speechd_python_PYTHON) @$(NORMAL_INSTALL) test -z "$(speechd_pythondir)" || $(MKDIR_P) "$(DESTDIR)$(speechd_pythondir)" @list='$(speechd_python_PYTHON)'; dlist=; list2=; test -n "$(speechd_pythondir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \ if test -f $$b$$p; then \ $(am__strip_dir) \ dlist="$$dlist $$f"; \ list2="$$list2 $$b$$p"; \ else :; fi; \ done; \ for file in $$list2; do echo $$file; done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(speechd_pythondir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(speechd_pythondir)" || exit $$?; \ done || exit $$?; \ if test -n "$$dlist"; then \ $(am__py_compile) --destdir "$(DESTDIR)" \ --basedir "$(speechd_pythondir)" $$dlist; \ else :; fi uninstall-speechd_pythonPYTHON: @$(NORMAL_UNINSTALL) @list='$(speechd_python_PYTHON)'; test -n "$(speechd_pythondir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ dir='$(DESTDIR)$(speechd_pythondir)'; \ filesc=`echo "$$files" | sed 's|$$|c|'`; \ fileso=`echo "$$files" | sed 's|$$|o|'`; \ st=0; \ for files in "$$files" "$$filesc" "$$fileso"; do \ $(am__uninstall_files_from_dir) || st=$$?; \ done; \ exit $$st tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: for dir in "$(DESTDIR)$(speechd_pythondir)" "$(DESTDIR)$(speechd_pythondir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-nodist_speechd_pythonPYTHON \ install-speechd_pythonPYTHON install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-nodist_speechd_pythonPYTHON \ uninstall-speechd_pythonPYTHON .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man \ install-nodist_speechd_pythonPYTHON install-pdf install-pdf-am \ install-ps install-ps-am install-speechd_pythonPYTHON \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-nodist_speechd_pythonPYTHON \ uninstall-speechd_pythonPYTHON paths.py: Makefile rm -f $@ srcdir=; \ test -f ./$@.in || srcdir=$(srcdir)/; \ $(edit) $${srcdir}$@.in > $@ paths.py: $(srcdir)/paths.py.in # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: speech-dispatcher-0.8/src/api/python/speechd_config/0000775000175000017500000000000012113401632017571 500000000000000speech-dispatcher-0.8/src/api/python/speechd_config/paths.py.in0000664000175000017500000000022611777240701021624 00000000000000SPD_CONF_ORIG_PATH="@spdconforigdir@" SPD_CONF_PATH="@spdconfdir@" SPD_SOUND_DATA_PATH="@snddatadir@" SPD_DESKTOP_CONF_PATH="@spddesktopconforigdir@" speech-dispatcher-0.8/src/api/python/speechd_config/config.py0000664000175000017500000010535712000024002021326 00000000000000# config.py - A simple dialog based tool for basic configuration of # Speech Dispatcher and problem diagnostics. # # Copyright (C) 2008, 2010 Brailcom, o.p.s. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA import sys import os import shutil import fileinput import socket import time import datetime from optparse import OptionParser from xdg import BaseDirectory # Configuration and sound data paths from . import paths def report(msg): """Output information messages for the user on stdout and if desired, by espeak synthesis""" print(msg) if options.use_espeak_synthesis: os.system("espeak \"" + msg + "\"") def input_audio_icon(): """Produce a sound for the event 'input requested' used in question()""" if options.use_espeak_synthesis: os.system("espeak \"Type in\"") def question(text, default): """Ask a simple question and suggest the default value""" while 1: if isinstance(default, bool): if default == True: default_str = "yes" else: default_str = "no" else: default_str = str(default) report(text + " ["+default_str+"] :") input_audio_icon() if not options.dont_ask: str_inp = input(">") # On plain enter, return default if options.dont_ask or (len(str_inp) == 0): return default # If a value was typed, check it and convert it elif isinstance(default, bool): if str_inp in ["yes","y", "Y", "true","t", "1"]: return True elif str_inp in ["no", "n", "N", "false", "f", "0"]: return False else: report ("Unknown answer (type 'yes' or 'no')") continue elif isinstance(default, int): return int(str_inp) elif isinstance(default, str): return str_inp else: raise TypeError("Invalid type for the default value") def question_with_suggested_answers(text, default, suggest): """Ask a question with suggested answers. If the answer typed is not in 'suggest', the user is notified and given an opportunity to correct his choice""" reply = question(text, default) while reply not in suggest: report("""The value you have chosen is not among the suggested values. You have chosen '%s'.""" % reply) report("The suggested values are " + str(suggest)) correct = question("Do you want to correct your answer?", True) if correct == True: reply = question(text, default) else: return reply return reply def question_with_required_answers(text, default, required): """Ask a question and repeat it until the answer typed in is in 'required'""" reply = question(text, default) while reply not in required: report("You have chosen '%s'. Please choose one of %s" % (reply, str(required))) reply = question(text, default) return reply class Options(object): """Configuration for spdconf""" _conf_options = \ { 'create_user_configuration': { 'descr' : "Create Speech Dispatcher configuration for the given user", 'doc' : None, 'type' : bool, 'default' : False, 'command_line' : ('-u', '--create-user-conf'), }, 'config_basic_settings_user': { 'descr' : "Configure basic settings in user configuration", 'doc' : None, 'type' : bool, 'default' : False, 'command_line' : ('-c', '--config-basic-settings-user'), }, 'config_basic_settings_system': { 'descr' : "Configure basic settings in system-wide configuration", 'doc' : None, 'type' : bool, 'default' : False, 'command_line' : ('-C', '--config-basic-settings-system'), }, 'diagnostics': { 'descr' : "Diagnose problems with the current setup", 'doc' : None, 'type' : bool, 'default' : False, 'command_line' : ('-d', '--diagnostics'), }, 'test_spd_say': { 'descr' : "Test connection to Speech Dispatcher using spd-say", 'doc' : None, 'type' : bool, 'default' : False, 'command_line' : ('-s', '--test-spd-say'), }, 'test_festival': { 'descr' : "Test whether Festival works as a server", 'doc' : None, 'type' : bool, 'default' : False, 'command_line' : ('', '--test-festival'), }, 'test_espeak': { 'descr' : "Test whether Espeak works as a standalone binary", 'doc' : None, 'type' : bool, 'default' : False, 'command_line' : ('', '--test-espeak'), }, 'test_alsa': { 'descr' : "Test ALSA audio", 'doc' : None, 'type' : bool, 'default' : False, 'command_line' : ('', '--test-alsa'), }, 'test_pulse': { 'descr' : "Test Pulse Audio", 'doc' : None, 'type' : bool, 'default' : False, 'command_line' : ('', '--test-pulse'), }, 'use_espeak_synthesis': { 'descr' : "Use espeak to synthesize messages", 'doc' : None, 'type' : bool, 'default' : False, 'command_line' : ('-e', '--espeak'), }, 'dont_ask': { 'descr' : "Do not ask any questions, always use default values", 'doc' : None, 'type' : bool, 'default' : False, 'command_line' : ('-n', '--dont-ask'), }, 'debug': { 'descr' : "Debug a problem and generate a report", 'doc' : None, 'type' : bool, 'default' : False, 'command_line' : ('-D', '--debug'), }, } def __init__(self): usage = """%prog [options] A simple dialog based tool for basic configuration of Speech Dispatcher and problem diagnostics.""" self.cmdline_parser = OptionParser(usage) for option, definition in self._conf_options.items(): # Set object attributes to default values def_val = definition.get('default', None) setattr(self, option, def_val) # Fill in the cmdline_parser object if 'command_line' in definition: descr = definition.get('descr', None) type = definition.get('type', None) if 'arg_map' in definition: type, map = definition['arg_map'] if type == str: type_str = 'string' elif type == int: type_str = 'int' elif type == float: type_str = 'float' elif type == bool: type_str = None else: raise TypeError("Unknown type") if type != bool: self.cmdline_parser.add_option(type=type_str, dest=option, help=descr, *definition['command_line']) else: # type == bool self.cmdline_parser.add_option(action="store_true", dest=option, help=descr, *definition['command_line']) # Set options according to command line flags (cmdline_options, args) = self.cmdline_parser.parse_args() for option, definition in self._conf_options.items(): val = getattr(cmdline_options, option, None) if val != None: if 'arg_map' in definition: former_type, map = definition['arg_map'] try: val = map[val] except KeyError: raise ValueError("Invalid option value: " + str(val)) setattr(self, option, val) #if len(args) != 0: # raise ValueError("This command takes no positional arguments (without - or -- prefix)") class Tests: """Tests of functionality of Speech Dispatcher and its dependencies and methods for determination of proper paths""" def __init__(self): self.festival_socket = None def user_conf_dir(self): """Return user configuration directory""" return os.path.join(BaseDirectory.xdg_config_home, "speech-dispatcher") def system_conf_dir(self): """Determine system configuration directory""" return paths.SPD_CONF_PATH def user_conf_dir_exists(self): """Determine whether user configuration directory exists""" return os.path.exists(self.user_conf_dir()) def festival_connect(self, host="localhost", port=1314): """ Try to connect to festival and determine whether it is possible. On success self.festival_socket is initialized with the openned socket. """ self.festival_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: self.festival_socket.connect((socket.gethostbyname(host), port)) except socket.error as e: (num, reson) = e.args report("""ERROR: It was not possible to connect to Festival on the given host and port. Connection failed with error %d : %s .""" % (num, reson)) report("""Hint: Most likely, your Festival server is not running now or not at the default port %d. Try /etc/init.d/festival start or run 'festival --server' from the command line.""" % port) return False return True def festival_with_freebsoft_utils(self): """Test whether festival works and contains working festival-freebsoft-utils. """ if not self.festival_socket: if not self.festival_connect(): return False self.festival_socket.send(bytes("(require 'speech-dispatcher)\n", "ascii")) reply = str(self.festival_socket.recv(1024)) if "LP" in reply: report("Festival contains freebsoft-utils.") return True else: report("""ERROR: Your Festival server is working but it doesn't seem to load festival-freebsoft-utils. You need to install festival-freebsoft-utils to be able to use Festival with Speech Dispatcher.""") return False def python_speechd_in_path(self): """Try whether python speechd library is importable""" try: import speechd except: report("""Python can't find the Speech Dispatcher library. Is it installed? This won't prevent Speech Dispatcher to work, but no Python applications like Orca will be able to use it. Search for package like python-speechd, download and install it""") return False return True def audio_try_play(self, type): """Try to play a sound through the standard playback utility for the given audio method.""" wavfile = os.path.join(paths.SPD_SOUND_DATA_PATH,"test.wav") if type == 'alsa': cmd = "aplay" + " " + wavfile elif type == 'pulse': cmd = "paplay" + " " + wavfile else: raise NotImplementedError("Test for this audio system is not implemented") try: ret = os.system(cmd) except: report("""Can't execute the %s command, this audio output might not be available on your system, but it might also be a false warning. Please make sure your audio is working.""") reply = question("Are you sure that %s audio is working?" % type, False) return reply if ret: report("Can't play audio via\n %s" % cmd) report("""Your audio doesn't seem to work, please fix audio first or choose a different method.""") return False reply = question("Did you hear the sound?", True) if not reply: report("""Please examine the above output from the sound playback utility. If everything seems right, are you sure your audio is loud enough and not muted in the mixer? Please fix your audio system first or choose a different audio output method in configuration.""") return False else: report("Audio output '%s' works" % type) return True def test_spd_say(self): """Test Speech Dispatcher using spd_say""" report("Testing Speech Dispatcher using spd_say") while True: try: ret = os.system("spd-say -P important \"Speech Dispatcher works\"") except: report("""Can't execute the spd-say binary, it is very likely that Speech Dispatcher is not installed.""") return False hearing_test = question("Did you hear the message about Speech Dispatcher working?", True) if hearing_test: report("Speech Dispatcher is installed and working!") return True else: report("Speech Dispatcher is installed but there is some problem") return False def test_festival(self): """Test whether Festival works as a server""" report("Testing whether Festival works as a server") ret = self.festival_with_freebsoft_utils() if not ret: report("Festival server is not working.") return False else: report("Festival server seems to work correctly") return True def test_espeak(self): """Test the espeak utility""" report("Testing whether Espeak works") while True: try: os.system("espeak \"Espeak seems to work\"") except: report("""Can't execute the espeak binary, it is likely that espeak is not installed.""") return False report("Espeak is installed") return True def test_alsa(self): """Test ALSA sound output""" report("Testing ALSA sound output") return self.audio_try_play(type='alsa') def test_pulse(self): """Test Pulse Audio sound output""" report("Testing PULSE sound output") return self.audio_try_play(type='pulse') def diagnostics(self, speechd_running = True, output_modules=[], audio_output=[]): """Perform a complete diagnostics""" working_modules = [] working_audio = [] if speechd_running: # Test whether Speech Dispatcher works if self.test_spd_say(): spd_say_working = True skip = question("Speech Dispatcher works. Do you want to skip other tests?", True) if skip: return {'spd_say_working': True} else: spd_say_working = False else: spd_say_working = False if not spd_say_working: if not question(""" Speech Dispatcher isn't running or we can't connect to it (see above), do you want to proceed with other tests? (They can help to determine what is wrong)""", True): return {'spd_say_working': False} def decide_to_test(identifier, name, listing): """"Ask the user whether to test a specific capability""" if ((identifier in listing) or (not len(listing) and question("Do you want to test the %s now?" % name, True))): return True else: return False if decide_to_test('festival', "Festival synthesizer", output_modules): if self.test_festival(): working_modules += ["festival"] if decide_to_test('espeak', "Espeak synthesizer", output_modules): if self.test_espeak(): working_modules += ["espeak"] if decide_to_test('alsa', "ALSA sound system", audio_output): if self.test_alsa(): working_audio += ["alsa"] if decide_to_test('pulse', "Pulse Audio sound system", audio_output): if self.test_pulse(): working_audio += ["pulse"] report("Testing whether Python Speech Dispatcher library is in path and importable") python_speechd_working = test.python_speechd_in_path() return {'spd_say_working': spd_say_working, 'audio': working_audio, 'synthesizers': working_modules, 'python_speechd' : python_speechd_working} def write_diagnostics_results(self, results): """Write out diagnostics results using report()""" report(""" Diagnostics results:""") if 'spd_say_working' in results: if results['spd_say_working']: report("Speech Dispatcher is working") else: report("Speech Dispatcher not working through spd-say") if 'synthesizers' in results: report("Synthesizers that were tested and seem to work: %s" % str(results['synthesizers'])) if 'audio' in results: report("Audio systems that were tested and seem to work: %s" % str(results['audio'])) if 'python_speechd' in results: if(results['python_speechd']): report("Python Speech Dispatcher module is importable") else: report("""Python Speech Dispatcher module not importable. Either not installed or not in path.""") report("End of diagnostics results") def user_configuration_seems_complete(self): """Decide if the user configuration seems reasonably complete""" if not os.path.exists(os.path.join(self.user_conf_dir(), "speechd.conf")): return False if not len(os.listdir(self.user_conf_dir())) > 2: return False if not os.path.exists(os.path.join(self.user_conf_dir(), "modules")): return False if not os.path.exists(os.path.join(self.user_conf_dir(), "clients")): return False return True def debug_and_report(self, type = None): """Start Speech Dispatcher in debugging mode, collect the debugging output and offer to send it to the developers""" report("Starting collecting debugging output, configuration and logfiles") if not type: type = question_with_required_answers(""" Do you want to debug 'system' or 'user' Speech Dispatcher?""", 'user', ['user', 'system']) # Try to kill running Speech Dispatcher reply = question("""It is necessary to kill the currently running Speech Dispatcher processes. Do you want to do it now?""", True) if reply: os.system("killall speech-dispatcher") # Attempt to workaround the psmisc 22.15 bug with 16 char max process names os.system("killall speech-dispatch") else: report(""" You decided not to kill running Speech Dispatcher processes. Please make sure your Speech Dispatcher is not running now.""") reply = question("Is your Speech Dispatcher not running now?", True) if not reply: report("Can't continue, please stop your Speech Dispatcher and try again") time.sleep(2) # All debugging files are written to TMPDIR/speech-dispatcher/ if 'TMPDIR' in os.environ: tmpdir = os.environ['TMPDIR'] else: tmpdir = "/tmp/" debugdir_path = os.path.join(tmpdir, "speechd-debug") date = datetime.date.today() debugarchive_path = os.path.join(tmpdir, "speechd-debug-%d-%d-%d.tar.gz" % (date.day, date.month, date.year)) # Start Speech Dispatcher with debugging enabled if type == 'user': report("Speech Dispatcher will be started now in debugging mode") speechd_started = not os.system("speech-dispatcher -D") configure_directory = test.user_conf_dir() else: report("Warning: You must be root or under sudo to do this.") report(""" Please start your system Speech Dispatcher now with parameter '-D'""") reply = question("Is your Speech Dispatcher running now?", True) if reply: speechd_started = True else: report("Can't continue") configure_directory = test.system_conf_dir() time.sleep(2) if not speechd_started: reply = question("Speech Dispatcher failed to start, continuing anyway") report("Trying to speak some messages") ret = os.system("spd-say \"Speech Dispatcher debugging 1\"") if not ret: os.system("spd-say \"Speech Dispatcher debugging 2\"") os.system("spd-say \"Speech Dispatcher debugging 3\"") else: report("Can't test Speech Dispatcher connection, can't connect") report("Please wait (about 5 seconds)") time.sleep(5) report("Collecting debugging output and your configuration information") os.system("umask 077") os.system("tar -cz %s %s > %s" % (debugdir_path, configure_directory, debugarchive_path)) os.system("killall speech-dispatcher") # Attempt to workaround the psmisc 22.15 bug with 16 char max process names os.system("killall speech-dispatch") os.system("rm -rf %s" % debugdir_path) report(""" Please send %s to speechd@bugs.freebsoft.org with a short description of what you did. We will get in touch with you soon and suggest a solution.""" % debugarchive_path) test = Tests() class Configure: """Setup user configuration and/or set basic options in user/system configuration""" default_output_module = None default_language = None default_audio_method = None def remove_user_configuration(self): """Remove user configuration tree""" shutil.rmtree(test.user_conf_dir()) def options_substitute(self, configfile, options): """Substitute the given options with given values. Arguments: configfile -- the file path of the configuration file as a string options -- a list of tuples (option_name, value)""" # Parse config file in-place and replace the desired options+values for line in fileinput.input(configfile, inplace=True, backup=".bak"): # Check if the current line contains any of the desired options for opt, value in options.items(): if opt in line: # Now count unknown words and try to judge if this is # real configuration or just a comment unknown = 0 for word in line.split(): if word =='#' or word == '\t': continue elif word == opt: # If a foreign word went before our option identifier, # we are not in code but in comments if unknown != 0: unknown = 2 break else: unknown += 1 # Only consider the line as the actual code when the keyword # is followed by exactly one word value. Otherwise consider this # line as plain comment and leave intact if unknown == 1: # Convert value into string representation in spd_val if isinstance(value, bool): if value == True: spd_val = "1" elif value == False: spd_val = "2" elif isinstance(value, int): spd_val = str(value) else: spd_val = str(value) print(opt + " " + spd_val) break else: print(line, end=' ') def create_user_configuration(self): """Create user configuration in the standard location""" # Ask before touching things that we do not have to! if test.user_conf_dir_exists(): if test.user_configuration_seems_complete(): reply = question( "User configuration already exists." "Do you want to rewrite it with a new one?", False) if reply == False: report("Keeping configuration intact and continuing with settings.") return else: self.remove_user_configuration() else: reply = question( "User configuration already exists, but it seems to be incomplete." "Do you want to keep it?", False) if reply == False: self.remove_user_configuration() else: report("Keeping configuration intact and aborting.") return # Copy the original intact configuration files # creating a conf/ subdirectory shutil.copytree(paths.SPD_CONF_ORIG_PATH, test.user_conf_dir()) report("User configuration created in %s" % test.user_conf_dir()) def configure_basic_settings(self, type='user'): """Ask for basic settings and rewrite them in the configuration file""" if type == 'user': report("Configuring user settings for Speech Dispatcher") elif type == 'system': report("Warning: You must be root or under sudo to do this.") report("Configuring system settings for Speech Dispatcher") else: raise ValueError("Invalid configuration type") # Now determine the most important config option self.default_output_module = question_with_suggested_answers( "Default output module", "espeak", ["espeak", "flite", "festival", "cicero", "ibmtts"]) self.default_language = question( "Default language (two-letter iso language code like \"en\" or \"cs\")", "en") self.default_audio_method = question_with_suggested_answers( "Default audio output method", "pulse", ["pulse", "libao", "alsa", "oss", "pulse,alsa"]) self.default_speech_rate = question( "Default speech rate (on the scale of -100..100, 0 is default, 50 is faster, -50 is slower)", "0") self.default_speech_pitch = question( "Default speech pitch (on the scale of -100..100, 0 is default, 50 is higher, -50 is lower)", "0") # Substitute given configuration options if type == 'user': configfile = os.path.join(test.user_conf_dir(), "speechd.conf") elif type == 'system': configfile = os.path.join(test.system_conf_dir(), "speechd.conf") self.options_substitute(configfile, {"DefaultModule": self.default_output_module, "DefaultLanguage": self.default_language, "AudioOutputMethod": self.default_audio_method, "DefaultRate": self.default_speech_rate, "DefaultPitch": self.default_speech_pitch, "DefaultLanguage": self.default_language, }) if type == 'user': self.setup_autostart = question( """Do you want to have Speech Dispatcher automatically started from ~/.config/autostart ? This is usually not necessary, most applications will start Speech Dispatcher automatically.""", False) if self.setup_autostart: os.system("""cp %s ~/.config/autostart/""" % os.path.join(paths.SPD_DESKTOP_CONF_PATH, "speechd.desktop")) report(""" Configuration written to %s Basic configuration now complete. You might still need to fine tune it by manually editing the configuration file above. Especially if you need to use special audio settings, non-standard synthesizer ports etc.""" % configfile) def speechd_start_user(self): """Start Speech Dispatcher in user-mode""" report("Starting Speech Dispatcher in user-mode") err = os.system("speech-dispatcher") if err: report("Can't start Speech Dispatcher. Exited with status %d" % err) reply = question("""Perhaps this is because your Speech Dispatcher is already running. Do you want to kill all running Speech Dispatchers and try again?""", True) if reply: os.system("killall speech-dispatcher") # Attempt to workaround the psmisc 22.15 bug with 16 char max process names os.system("killall speech-dispatch") err = os.system("speech-dispatcher") if err: report("Can't start Speech Dispatcher") return False else: return False return True def speechd_start_system(self): """Start Speech Dispatcher in system-mode""" report("Warning: You must be root or under sudo to do this.") report("Starting Speech Dispatcher in system-mode") reply = question("Is your system using an /etc/init.d/speech-dispatcher script?", True) if reply: report("Stopping Speech Dispatcher in case any is running already") os.system("/etc/init.d/speech-dispatcher stop") report("Starting Speech Dispatcher via /etc/init.d/speech-dispatcher") ret = os.system("/etc/init.d/speech-dispatcher start") if ret: report("Can't start Speech Dispatcher. Exited with status %d" % ret) return False else: report("""Do not know how to start system Speech Dispatcher, you have to start it manually to continue.""") reply = question("Have you started Speech Dispatcher now?", True) if not reply: report("Can't continue") return False return True def complete_config(self): """Create a complete configuration, run diagnosis and if necessary, debugging""" speechd_type = question_with_required_answers( "Do you want to create/setup a 'user' or 'system' configuration", 'user', ['user', 'system']) if speechd_type == 'user': self.create_user_configuration() self.configure_basic_settings(type='user') elif speechd_type == 'system': self.configure_basic_settings(type='system') else: raise ValueError("Invalid configuration type") reply = question("Do you want to start/restart Speech Dispatcher now and run some tests?", True) if not reply: report("Your configuration is now done but not tested") return else: if speechd_type == 'user': started = self.speechd_start_user() elif speechd_type == 'system': started = self.speechd_start_system() if not started: report("Your Speech Dispatcher is not running") result = test.diagnostics(speechd_running = started, audio_output=[self.default_audio_method], output_modules=[self.default_output_module]) test.write_diagnostics_results(result) if not started: reply = question("Do you want to run debugging now and send a request for help to the developers?", False) if reply: test.debug_and_report(type=speechd_type) # Basic objects options = Options() configure = Configure() test = Tests() def main(): report("\nSpeech Dispatcher configuration tool\n") if options.create_user_configuration: # Check for and/or create basic user configuration configure.create_user_configuration() reply = question("Do you want to continue with basic settings?", True) if reply: configure.configure_basic_settings(type='user') elif options.config_basic_settings_user: configure.configure_basic_settings(type='user') elif options.config_basic_settings_system: configure.configure_basic_settings(type='system') elif options.test_festival: test.test_festival() elif options.test_spd_say: test.test_spd_say() elif options.test_espeak: test.test_espeak() elif options.test_alsa: test.audio_try_play(type='alsa') elif options.test_pulse: test.audio_try_play(type='pulse') elif options.diagnostics: ret = test.diagnostics() test.write_diagnostics_results(ret) elif options.debug: test.debug_and_report() else: reply = question("Do you want to setup a completely new configuration?", True) if reply: configure.complete_config() else: reply = question("Do you want to run diagnosis of problems?", True) if reply: ret=test.diagnostics() test.write_diagnostics_results(ret) else: report("""Please run this command again and select what you want to do or read the quick help available through '-h' or '--help'.""") if __name__ == "__main__": sys.exit(main()) speech-dispatcher-0.8/src/api/python/speechd_config/test.wav0000664000175000017500000004200211777240701021222 00000000000000RIFFúCWAVEfmt €>}dataÖC`ÿkGþ†_ÿÞýð'þDFcýE¤ýsÿ¯»üaŒœC‹ º¯úúmñ†ëÓø÷ýÛýd <*ìûa݆ÿ–ü*Ýü®ù< Çï l´‚öñò(ööL÷]þ“þ°ûœø0ýÍ 7äþÈåþ|îqï òœìü¬¥B"²ÎÖ*ýü’ÿ;ÿøöÿ÷6Ì) 'øBíÉçñë:ðØøJ]ÍuºýÑï«ò€ô£êécìpéìì¥F ˆ\)&f„ õ€µ–° w¡ÈÓ LŒ’ öý÷ôòçŒáýá×ç“öuÍ ˆý Éûaì^èÄä÷äqì ñrñÏûíjH®©w´såý„ ÿß÷¯úù®þ ç Ï "Qû‚ëCÜݯâ³í þ ÎS# qûlòÇî'í«ïÀó^õøCš ? zg#JÑ.ü©./+þÕú#ú}õtþ¿ µ Xg¾ùCäœ×_ÙÍàGï˜@N7ÂðÉé!å×åœí>ò«ñHús‰b”!„vÆÛ¢FQÿxrû€úÖ? ‰ŽþdôWãtá/ç©ï!ü¨ ÒdxØ àù;ïÆí‡ìaï‚ô«ó%óÌýÌí‰p"AqE*,ûØÿH؇ÿý³õyüOç íÿdûí®ápâ_ê¢ösØ?lJ¡¶ñ·ííˆë³ïÍó†ïöó(: £ ö!ê±Øý)P~ÿÿùùwù." qêaùÆêcâHâ[ìèøòÑ$zñ ûù‡ïLíöê¢ìÐñnðî4ù¥6‘(uRÅ[ýVþ[$TþýS÷ÑùâþÁËð©þ†õSéã[é²õ1ÿU Èóhõ,ïtì:éí9ò îžðÐý­Ù Z!C#Ž]s KþB½ýòü ø1õËúÛ¾ÿ.þCðeä'âvì"øc`¡æ½ÒLô!ðûê¡è+î|ð îh÷ÜVjô# í4 X÷ÿ Û‡ý°ýà÷þø#DË ÄÐ`ü÷ì¨ãæìñ€ûIÇK úòÕëæˆèDïÏíwð–üŽÅ•T šmüâÿ]TþÉý~ù±ôÛù«âö ¦öé äŽìc÷uUòÛîœø8ñ,é{æ íñƒð?ù­ºÑS"/íÌ ß ÿ@=jý¾ü#ö°õçû«–k{þOï:å_æˆñCúd °R )üNó·ë äÿä\ërëPîù¥þªU·jçAxÿ¦¾ÏobýFø­ûû” } …túní%çîiøÄ… ФO ƒùdòéEã©ç²ëëÈòžü1# š–biÿWüÃYÍñù}ùëþn¯Ì&£Qópè%èÛñðøh› ÒËM [ý‡õªï›ç4ç'íçìžï‚úòÿgà p=6Œÿý_Y§0Aù±û™ßÁ ¶üEîuæ¤ëYôÞû²Œ@æ2ø¡óŠìàåüè&ì8ê—ðÝù¡ý¢ XÀèè ªÂÿt3I»™ûñøDý¼Ã­ R>ö¬éêæ/ïö·. %êþ8øòDê)è™ízí°îaøÞý¼g t5Õ>ÎÿÙþÔýþl÷Eùùþ æHý¸ï]æ°éÏñIù'" ûÚ'où¸ó ì¾å é'íìëzòáû‰þ= GÜÇ+. ÷–Åž¾ÿnü-ù1ý‚\uÐ ½ÄùøìáèÛïeösÿ¨ V¯P/÷yñXéQæoë³ì'î7÷RüÕÿ '†Áá¶ÿú2¡°ýžùDúÿýIóî¬ÿ¯òè ëhòàø®& Ï! ùü“÷ ñêë®ïøî±ó™û®ýñùq(.þóYà»ýú˜ü•¨l "múíç*íŽó%ü, ð’ùeô›ìmé÷íìîáïû÷´üùÿ3ij³ " —€4þùx„úƒúøþ%¤ZV76óýçAéqððöŽ ðƽrü ÷­ðÞéhëbï¹îqó;û?ýw#ë( Ð t°ÿ|aß[SýÊùaüSC ³ úíbçdí³ó'üÝÒ „¨Œùqô×ìËéPîCï'ðøÃüþÿì,1J­á ‡îëc”ú«úÿ#”@2,kóèÏéäðH÷¨ Ðq‰…ü?÷ñbêêëÐï*ïßózûjýšÍ`ÐPš _ÎÿŸ]à[týúüp@ ûºúqíèàíôfüж Ì*•²ù´ô=íOêÐî¸ï’ðbøîü#Ю¿øe® u âêZ¸úÔú(ÿ" &¡óûè]êFñŒ÷¿ß ?‹üe÷SñÛêZìð„ï8ô©ûŠý¤mÑ_æB ,ÏÿŠ3Ò9ký(ú®ülæÒú«í„èHîRô–üЊ p³eÉùßô‹íÄê;ïðãð“øüü#’=™a U—îÊÔBÄúîú<ÿ \ûØ·ókéàê›ñË÷ȸGó”üz÷ŠñGë¿ìoðÞï|ôÆû¡ý 6í„ô Ñÿq·hý?úÄütû¸³…úõíé³îô±ü¾b RGØùõçí5ë¢ïjð4ñ¿ø ý0^ŠÀ/¤, <‘Ó³¾.ÝúûBÿí<ÑšêÿÜóÙégëûñø×‡ú"¦•üŸ÷ÈñÆë:í¨ð(ðÚôèû®ý¯¦œœ æàÿcã«ùbýZúåüÛŒbúAî–é#ïÖôÓü°> Äç êùDõ6î¢ëðÈðñõø$ý;%üCÊCï(޽Ÿèú2ûPÿ̨\âÿôIêÝëMòPøìn·´e¡üÍ÷ ò*ì¯íñ„ð)õ üÂýª1ÿ¾C ¿ÞÿGº•ÏVývúõüwÃs[4ú‰îê‰ïõý¨ c| øþùwõ‘îì_ð#ñòñ#ù0ýDàh»]ó³ ’±v„ôáú•ûõþ r.ÿ`ómë>ìkóø°œÓ w2ßü—ùÍò—í¿øyù´ìîxêî¶µ— sÑ ï `þ¨ºðþýT÷Þø• kÊý!òßxÞæ§ëÁøÒo W ð ôüƒ÷óýÞAß™ãqß’úVoä+5YÓñÞ7þr¥úém 1 6 % Ù]øÞðPñðí‰íNñ#óü±òú§ÿOñMæ)äÛŒå¤ùK€:ó ›³{¤8 ~öÜÞòTãŸÞ†åEóÓç {Æû#äxÛÄÜáÓîÍúJ7 'ò6 "!àôBû¹%üÓŒ¡Ÿ9x³2øðèçÞåVìÊ÷2 ëC¬£ ÜúòîÃáuÛ â²çöD ƒ$ 3lÙ­Võ*ïbôañdírïózÿ¥˜€ 8÷#ã Þ÷ãù™aô!]_ýÆì'ëìéhîù•ôò!õ¡ñø]4’Kª A³ýCö/îççñÂüû"û”ú~ï[ïvúéþV3'! [b =öòèí¶éIðCòLù ñ  ˜ûøûôÑôóZ  ýeùÂðûÊð¨í˜ä8Õ;Ø$èÏõ_ £*š0)'µ þ›ñŒì®ïOö‰ô>ôéúsüL 1$t#æ« "÷ïò‘ïsñÁó¿ö5Ò‘üñ©Þ°Ð¦Ô+åçó½±{X –jÒýŸú‚þŠ÷íîCýÂþ(E#d»T5~  ýÝüîlåèí{ùþy\!ûÙò¥î˜ñGù[¥  ïëóå`éÕæRõ Duß!ú#""'ÍÚ Å£þþUü‹þ™ü üç 9àó³êÇáÙQâcö>¼¶$ón =õïâÀܬÚFÞÊã(è™ô[,>223œ&â!c!å ]¸@û(óöú@†×½ ±û å~ÙÜÛéýP&Ãdò*ó‘â¤áUâVÛ¢å>òKöR Æ´Ýà6ü Œ [Sù6ùFÿ–C ½¾íö¼êÃéqô;I «Ø 9àø4î…íì¨ò¡ÿüú}÷@ûžúvĦ Yç£ü•ýçh]L 0ׯ â ° þ±íÙä¦è=ô5¤Ë êõ(äœÒ$ÓXßläfò™ ˜%?Ó ¥ñ ð;÷Dö›øüúÙö ­1$ß ò\ç{òýA¨Rœþäü÷<í„ê í›äìÞ¢ç ñ¡~}+Þ ÜüÀû¹øOò î|ìÈî^ø/ì döúNâÚ Øïô ¾ýÈó˜æ9â•ëðUôFc÷ ä ¦ê…0M ¾¼:ø€ô2øÐùýaÿ+ø¹ë­äéùøÌ >¢] ¡{ýô¦ï…è€ìýì“é§ò¸ù â%“à}ô!ö4ûý9ÛþQv ó Õ+þ¿êóÛßxèjólÏdS Õ*ù¬ï ð¨í¡îûmÿB 6ãY!z  B #û"ïCíÞ÷zô¢ ø Òÿ¤ëàå“ëþñlû“ Êrùkóûìéµó¿ö”ô&þ"›l> ÒsÕ ½ÿÐøÐHü¼‚…‰ ¸÷Öëôë+õ8B ˜ èk yúòî'êáéâöérë­õ3¥ ‡!Ç–‰ R\üW÷ýv<± I üFéKâCéóÚ †I Aûûò…è«æ‡éÈéÂñ(øÎý;ù%Dÿ¨_æç´úþ»tæÓcÿßï·èîsõñý@ %žRù]õíóìœðîeó¹ùjü tÓB•\BdûSýZä0 ³$·ï¿æJëóóËþn"ü^ø<ò~é"èžíYî¥ôòülðY!B ždÿGè$_Õú†þTƒS × !ñ9èùëÕóÍý¸Øûrû3ö‚íê™íìŠð ù¹ü ±©^b)†Ilÿ˜øÓù‡à`­ …‹ô+êÛìÑóÆü®fÒ~ pû[õéì¢éï"ïkó‰ûWý¡ ÐÜ­zÎqMM?ÐùZùjÿæ;ÙQ>ógèÐëõ‘þÛø¿’ .ü÷àî&ê¿îNîYñ(úŠýH v‰üüãBþrsä‰ü×üÒÄþfC§òXçÂèQð|ú»u D#2ÿ ùñð°ê@î8ïòuúyý&k‚|»Ê'  ‹ùþøê˜ 2÷YéKé®ï øYí 2 Qý'÷ñ¬ì‰ðMñóûú)ý¨eÅô,=V§B²#ý¡úwÿÄÈ’g÷Të€ëó,û¥ L Hüûõ6ï°èí)ïêðûqÿЏCz]¡ Ÿ›Ò‹™Düún¸[ 4T÷Ðè¸çïLøD ô*·÷ÔðÕè"ë²íØîõöXû›AÄ2¼. .<ŠÔýnú¹ÿVN$DÜúíÔêzð‚÷ÞÓ˜ [lùô!í»îãïxïØöRú’Uš’ ˾©{ÿÈúÕþ p½ÉRûŒìCéÁïRø,’ Ø@ñÿuö6ñúéQì…ðñHù1þlSן [m “hÿšüÏ g~ üÍîcêÔï~÷^qDY:Aúõbìúëî•íAõûµ*_ }+ §ƒ÷E.Xý–øýb€õ Ó Éÿ6ñŽëäï˜ö>ò;ï™;ùTô¶ì7íñðð!÷ëûƒþj ¯½O0 ïYà€”þøûJs>þðëJñ„øR‰ 3°íú öÔíÝìðxï…õQü B˜Õ8 „ÿ¥XÎkcü<þò:JFhý¹ï|èÇìÒôKþPŒÒîÂü²÷éîiìÞðÚð›õWü¾þa ÜÕkìÍlœþJù¾ûêÎ9 } .ò‡éHì®ò÷ûÒ dû¦÷ñÖîœò1òôõüUþ hÖ +ªÅCòï&û8ûöÿúoq<’ôCì´ïÓõýå ¡&ú[õî¡ë3ðÈð1ö(þþÿô ùA‹Òû¥£ˆüRûLüqYÞq•~ò5éíëOóÞüDQ g üžö¢îÿé€îïýñ!ú5ýiÃtã¯ØöC¬©_üÃûà‹¬•÷öÄì‚íÊòªù! Ú¡ ÷ýdù-óÍíCð&ðøñØø=û™6¨¨¯GÔüÏëü!û€ 0ˆ½öøë íÝóÛûÍÙ s iû>öŠðòë‰ðAò²ôAü¡ýw›ô  Ý ÿ+LÖŽ2ÿ]ýV¹û/ùœíDí9ó"ú¼N É oÿ«ùóìííïàðüøÞü~s‹†ŸÿÕ‚>¾ûDúŸÿ§H? Ë’û[ï{íò9úM9 o! Ûþªø‹óµí~ðòó`ù_û,éF™›ß Îg5p ü„ø}ým[«‹ú§ï ï‡ôeûÑh ëà âøù§ôäí<ïUñôñzùdýM¹&x %±ÿ0³Žÿÿäûæþ˜6Jú²í%ë5ñ‚øœ• ÆŒjû¼õ îÃï¼òxò.ù¶üAüÔï Q²“T1ýúéþ›ùQZüZïúêQïeö(ÿV„ • çMû;øòðMñô5ó~ø«üaàXï Ø (¶QUÿâù üêàñí‰þ¦ò®îpò°÷fÿ ä 7 XÛø½ôjîÑî¤òôKúªþ ¥‡Ð:Ð èâOc ŽÿzûeþÙt’=üxðòë²ð øz:¦ˆC:úõRîî¯ñIñ©ö]üSÿá †ûtp êR×1³iÔû'ý¿gMK_»õ²ïªñòõ¨üªÃ Š âeýŸúñósñìóó3öìúý­ú…  ïg_(e>üÜýYR£µÿ‚ö±ñ•ôcù‡ÿÝ äÝúšø?ô·ó2÷Í÷ úÀýkþ;H Y f)ÿM¤¦/?ÿžÿ p±žZZùKôØõùìýÏQ „þZûöóAõýõ øvýÿ›T ÂtUþþÿ²rJÿúüšý,­8öë üêö+÷˜úíþÎ[éfßý=ü†ùÛ÷ïùèùYúMüŽüÝ”]sLD b« ÿ üTüæþ\¹œÜHýìú?ûDý$ÛÄYQÿ…ýûÀøôù«ú"üÚþÓÿeµ8Œ3ÿ9¡—ôÿ`þvÿ-÷ÿ!dÿíû6ù?ú1üèþ©”«ß¹þsüxûŸüµüNý™þµþö•hDEÝÿ'ÿ þäþ=ÿ°þ^ÿ"«íBžýÿú›úìû`ýêþÒ\¯ÝmEôþJÿÿmþ;ÿ-"& ±dÖ `p¦¿þJýÁýûþÔÿôb›¿ÿØþ9þþ#ÿDÿÿÿ_þÕýèýaýSþ<åC† 5Ïs’´P*ŠVß<“~ÿUþfý‘ü ý¯þMð’Cÿuý%üýügü˜ÿôý þpÇ–. ÜÃú þ­>ýÐø•úsýîùüÍé &íýý{÷îkíTñÄù Û¬ ­ Ƶ¸e_y èó)ð3ú¹÷ñ©ô•ù%÷œôöCúÏü3ùqøaþþ}û°ý®ÔÇô  –·˜üà F ö÷î/ùù´ìÑå’éËìKïô¥ü?íüDûü ýÀ EÚ¸›âq ú?¡ö”ÃùÈê¼é+ì5ìyð×÷#]ºûXô!óLö ýâüþ[ OÿÌ Âöþó†¦ôhû "¾ï·èhêëøíó{þpõÿñ÷ãþM Y tCMþ„•ßÿÆöz +þÞùºU³ó²åVååéæ#íO÷¸s.ý1ù‰ûŽ&-|ù€ øþSp!  óV’o üO 'úÔâwÞõâçî—õVgþÓ÷WùˆÿˆØÿçŸîü‰„޼õHúe¼ óöùJëà™äêÜñ¯ø×¯ )ïûd÷F÷®ûù.òrù* ïÐïÛnú÷ú 7ùó[øôétêÈêFí¤ò~ú|`ñú¼ôèò¤õ/÷‘óøq ¥ À{âk1ô§0> í5 …jdê.éÌìãíØïžõ3 üõiôöø/õàõ?mÏÒ {"@FùãÿWŒÁ— _L!õøêë—è çôéö\þûõïjï„ñË÷eø‡õÕüÞ 1Mh5 Þ]TŠ Í ‹¬ù]çnærç'çØèlô€üÐñ+ð,ïÑñSô±ñö(ô »Dd&XùV`G˜ ô)2?ïzë»ë^éçöëÖø›ùŸð¶îPï4òÒö5õ*ôoÿdY {2 Þ!>ûÓ: C 1Z ôìtî‡ì²çˆéz÷Fý,ô¡ð6ñó<øùÕ÷íþè”m¦·w$kþ†{ ’õ­Cþ’îÃí‡íÙè¨æ ñéûö¿ï×î‡ðù¶ýÞú)ü aþÈ$!]&ÿ, Š¡ Yw ±,ìÉç|èUç„æÔï2þ-ýèõãóññÿõ#üšûÂú& Ê.$lãø­þÔæX ö‰ë±ê’è–ãµå¥ò÷oñlïðxô©úëüÑü«)Ç ãgfpg0SxkæøLìÆíâïÂíwìÊôÍúô ïîüï[÷îüþµ » yT¡ø Øû¸ >= ñ 2|4ðŠëÐëêNåê×õÂõÏñçñó ùŽ3ÿùRË ÔýH Ã,ú# moWö”JóŠê¦é0ê¥èJëG÷Tû´öôÚð°òwúyþ›üé_ɽý©RUEÑ}fô ¼úï–îXï/í€ë…ô†ûœöCóòòòhøëýþ¢ýi ª¥ øò Ç -i ;Ú•ý Ö ýï¾íãð“ò<ð‡ôIü¦ø—ó6òªñ…öýÿ¬üYúÇ–©ü~"« ÑÁƒÿ>ôÖëÂêÁëÉèdêáôsö*óûó¥ó~öüþÌÅÿÈ: =4á„ t’1'„ °!ø'îxìäî´î÷ìüô/úHöäóPñxðõõµüüéü¹ ›äàYkü hò Ù¸ -ªó@îFîWí¤êgñÇú(úò÷¯õò?ô·ùûÿøs" HÓ;á¥3ã `ÿ1î \önî ðKó`ðaòjû>û‰õ)òðóòžúµÿ&þˆÅÆ8SþåÿªÅ÷7Š þkñ¿íðQîì%õXùéõ£ô”ò1óAú%)ÿ~ý 7Q©u\õ so zŒ/þì (ºòëíOð ñîÿóÌûú¾÷“õMóöªûPý ûçÖä æ M—ÈmÙê Ùoõ%íí>ï^ì:ïù ûüù¿÷6ô^õþù'ýàû>0-˜Ì±]G{¯®_ýG1 ûÆññ²ô²ñSï¯öúIöÕó™ñòiø ÿîÿÔÿÏ B ±Ó½• Óþç%A ·}|óUì4í)î•ëÇñšú¸ù¯ö.óñ4õ›üuÿýùcy ê(\=ÙŠ ǹ ½´öòîfîNð îðzøùÔõ¾ôýòÜô&ûSýºþ3 Mv¤E@[Qr¿K£é Å âûÂñÙïÞñ)ð.îìõ¦û_ù/÷†ôìó÷–úòùÏú¡ üyg mþj°=|ü‰ xõò—ô†õ•ñ{õˆü¨ú"÷Ïôóòöõü[ÿ1ý7S 7} ðTÐÿÜ«Ü ¾R- Å–ö™îšíð…íï·ùþû(ø,öŸóøô7üäÑÿ¨ZÙ婯›3(… æ 7 ò ôý”óôî4ï¶íìôú“÷jö®ôFôöùB8ÿþóïãhß5 ¸T ä ®r¤ ÿQòþíBðñ^ï/õ-ýãúæö ôñ3ôºùbû@úÓH¥ A|û1ò— Èÿÿ Ž÷ ñPò]õÎñ}ñÝøúÜögõ=ôÛö+ýþÿ‹üÿƒ mÚæC‘Ø[»ÿ K } Ýýkóðrñmïœí·õíúø"övóCòôöYþrÿaÿ € i‰F# ¨þBîIÿO öG÷hñbñ ðîóuûûzøÏõ9ôK÷ýüÿˆü‚k Ô!þÔŠúž Uï ugŸ Ãöûï¨ðºòñÔóòûPý6ú÷Cô×õúÂýÈûjþÅ ý›WQ‡ÿ_ ¢ óžÿ² Ñ ˜üüñðïÃò£ñ?ðF÷®ûùröQõ-÷¤û|äÿKþJlýŸ #Ž ùþ Ÿÿôæ õIðãñ(ógðÄóÄùò÷yôLòºñQõ°üáÛþ<€lBL ÷ %Ûõ8 hÛô JùVòŠðMðûì«îË÷íúmùžøQ÷˜÷®úµýïú>üà0 ÄH»Á‰·D I ýÃóÍðÃòûñºðç÷óüRúÚö?óÕò"÷KüíüƒýÇT(•ƒžª'þ°Ýžþ Þ ºÂöåñó°õóÛöLýûj÷tõõ~ø3þ×ÿIü4à ¼ A … Îë¾ € þ ½€ùkòÀñïô§ò‡òú*ûN÷¿õ]ôöþû¹4ÿÏÿ ½/™¹ýyŸ ŠÎW / zü°òÓîèïïî÷õoûAúFúøø,øYûÿêýÓü]¥šÞÿ" ±X ={ êþFÿ[’ ÷®ó}õëõ¾ñ§ô¦ú_ùV÷¸õdôi÷ùû›ý½ý‰lR -P zlàÁ ü ÿfa $ú»ó¯ò[õmô}õ¤ülþüÝù+÷­÷?ûÍý8üðýt +¹Ab|ï? PZ¿äÏþj÷ýôJöºõ?ô¥øqûOø*öxõ§ö*ûá±~ <!ÿ^pݧÿµ} ´9\U {9ú¥öÂöröÏôs÷Óû`üëûhûûü¥ýOý ûþUÑ#±Uý À¦7 Ì€¯ƒ)ü-úÇúnû´ù}ù³üÂýäüóûêúûzü§ý ýÿä/zvx ? ª sýJÿkÌíûô÷Œ÷³ùû¶ú‰ýÀC,þâüîü›ý®ÿñÿÿ?Ê/¹û- *îÿ±:ÕÿGý3¤Bÿïü`ûBúsø€øãúSû@úMú!û‚üz3{ö£Ds;éCm‹¶<oýkúºùæùäùoûœþ1Eÿûý‚ýøüÜüýúüWý„ߟW©"øpÚÆÄ^þþ9þîýšþnþýØüýCý¹ýTþKÿ0}Üþƒýùþ8ÿJÿ¬†«’ÿYV‘ Â@ÿ¾þfþ&ÿ{½ÿ·ÿô2‹ÿ2ÿUþÖýMþ0þÿ„ËŠÈHþýSþ‘þÔý{ÿ–cï°ùÿwÿÿýÑüÏý‚þ%þÇýyýäýeÿž”—pkOÿšþTÀh€²óÿ&ÿ¤ÿ›þ‚ý°üÌü*üÝüÛÿ +›/úÿ—ÿÞþåþòÿÌÿEÿ•‘©ÔÿùJÏ+îäPfþÎý\ýÞû_üŒýþÚþçþªÿXe&MÿÁÿ  ,~âÎÿzÍ:ÿoÿoÿ‰ýzü›üqýÕÿI­ °ÿ’ý’üfýþÒþ*ÿ5ÿvê>µÖeÎwÿC£´ÿÿ§ÄA…‚ÿšþý1û2û[üý²ýŽþÌÿCQý}Ã¥ÿ!9ŤC®&1Ûÿàþ’ýGüôûhý ÿÀÿÿÿ+ÿ'þäý'þ£þ×þÇÿϯÿ$ÿ5cþEKÄû6öGÿðþlþCþ5ÿ»ÿUÿ¹þñþ²ÿõÿ­ÿþåý–þ+ÿÿMÜ2çd%&½ý‡üþZþý+ý€ýàþÁpC[Žÿ·þcÿõÿgôþ6×g‘6ýîýGÿ´ÿÁÿñia—ÿ4þwüüÍû©ûÎü‰ý¢ýïþ<l1ZCÖ@V$”^ÃÇß¡ÿ­þ˜ÿŽÿÎþÂþÊþÙþÿýîüný¿ý]ý“ý.þ‹þçþ*ÿôþ$"Oöpä‘$ËöœpNƒÿxþ6ýrüü_ýÿȼÄÿèþLþ­üÿûþý‰ÿ¶ÿ*‹Ô #{Rþ¹ÿ…dÿ0þVýàý×ÿªíŸfþ«üÓü:þ˜ÿ☶ÿÒÿ«Sªþeþ¯ÿÁÿÿ€ ²,áþ’þûý}ý ýmýiý­ýþÿâÿ†RÒÿ)3Q]Éíæ$2þ)þ¼ÿx¶ÿêþiÿ(ÞþÎýÙþÿ÷þÀÿûÿhgzÿìþóþóÿ"ÿxÿr\ÿÍþæ¨Ë‰ÿUýšüòü:ý÷ü–ýÂþ, =Äð-ÿAþ%ÿ)ýÿA?)y}ÿ‚üÏüÔþÿ©þÿ¨ÿõÿ¶ÿRÿ8ÿäþ‰þ²ý8ý‚þxÿç5Ó—&kñböoàÿ±ÿÿHÿÿz\éÿPýü{ü¶üÅýìþ˜ÿ¼þ2ý7ýwýàýyÿ<+Ü}ïUÜ! eìþÑþ¸þþýHý‰ýÐü7ýþ$ÿ—7K, ÿpÿÐþýþx|pÿÂ5ŽÛCÙê4ÿëþÿÿÕþÃý4þ)ÿ½ÿ÷ÿÔÿØÿûþŽýpüºüVÿSWt-4úþ ÿ`ÿ²ýîüÿ ÿãþÝÿ'›-äÿ{þÿòÿq4&»þ&;Z)ñåÕÝþUÿMÿSþþiýoýýý•ÿ~ÿ ÿ¡þ©þ”ÿîß{ aºyO9dvgÿLþ;ÿ¥Ib›þHýÊûÔú;ü!ýgý‡þÿ?$,ê£ýz…ÿ¡ÿ£‘hÿ”\Ù$Ò‡.þ›üýÒýÃþþþãÿŒ_ÿ­þ þXýíýXþký!ýÙþîŽ ËüÂÚÍgÀþÿ ÿÌþCþkþÄþ–ÿ¸ÿÜþÖþÿÿÿAÿ¨q‡gÿÿ—ÿžÿÿøÿ‡}–w«—x”W\–-­ÿ‡þFý%ýþoþþTþTýÈüýLþ ƪÁO{ØØ|ÿ–þZ‚Fÿ8ÿéäqåP•ÿ­ýü¸ý×þüþÿÎþuÿÉâA½ÿ¡ÿÿ¦ýSýrÿóË5asvP~AÿlýŠýAþžþšÿß´„¢ÿ-ÿðÿJÏÿRþþ*ÿ’y´‚þ«ÿÅÿ–þ9ÿU)Îþeýýùü¸ýÎþOÿÐÿêÿbÿºÿ ¸tg÷à1åáÿGöéÔÿÿPÿ]ÿ®þ¦þUÿ‹ÿUÿÿ‚þŒý÷üRüÓûrüPýpþëÿ9Ž—Q OjÞÅ¡ %ÿýÿµ?ÿÿ˜ÿÌþÿüû7ûý þ?ÿ`5ÿ­ý„ýÔþ“þÎý'ÿd}-išôF™ÄÙ²ÿ¦þAþSþµþÈþfÿÇÿQÿIþý{ý²þ^ÿ.ÿRÿX»ÿ´ÿ‚µ6ÿÛÿÃTÿÿœ"ÿ‚þFþHÿ\ '2xÿÿÿ à%ÿ­þÊÿ¼ÿßÿd~¿Y$ÏÿþáüDþ¾ÿ‰ÿ;ÿ[ÿìÿ„¾ÿEÿyÿ…þâýñýòý¼þ™ÿ¯ÿp:°#åìþkÿýÞqSÿ»ýþüìüürûý,þ ÿýUi#3‚ÿ‚ÿ§Â„ÿßþˆè憴"Ò¢ÿhÉ~ÿÙþœÿYæÿvþûýäý<ý©ý½ýÀý$ÿÀÿ¯ÿ'$=ÉÊ[w13×ÿ’þjÿ¹ãÿKþ9ý|ü¿üþÑÿ$¡¶²¬þZþÑþlþsþÝþáÿìÿsüügÍ® õþ¡ÿSÄÿ ÿŽÿcÿþWþ’þ“ý0üøû)ü@ý(ÿ€Òþ”ÎyÿÝTÔÿÁÿSS¾gÙ.Aÿÿ2ÿWþ&ýýÍýWþ.ÿÉÿ5÷cVþOýsþÓÿÁÿ·ÿÃ87Bÿìÿma'…¢šÿþÿós©ÿ;ÿ0ÿ~ÿ›ÿhÿmÿ˜ÿ¨ÿ ÿ#ÿÜ(†ÿ‘ÿjãÚåQ›ÿZÿÁþˆüü¦ü÷ü!þ±ÿèO“…uÎÿôÿ_y–arûÿ_ë³$ý§ÿ ý;ýDÿûóÊ ÌÿñýÊüaü~ü€üvüºüMý”þÕ¤€­UŒP‚£ömÜè þùüQýŠý,ý‹ý7ÿìÿÿŒþaþmþÿÿüýšþ+üÿÙHè6›q¶Zõz-]ÿ©þ!ÿÿTÿ£þÈý:ý_ý0þæþÄÿ(©Ôÿþ½þÿþÅþ3Åá[ƒ£²pÅþþ4þ¤þ§þ÷þY5ºÿÿÊþ%þVþ‹þÿ~üü¨wèUÿôþÿ8þý,ÿ§}¦9 TuþþÀþXþþ×ýýÒýrÿ=ø tí§ÿòÿàë!Ú|’µÿÿžÿGÿbþýÎýVþ›ý¹ý›ÿ1Úÿ"µÿ®ÿ<"•ÿÿÿRÿœÿ›_¯ÿŠÿej ŸFðšÿ2þ0þtýÖü{ýÜýâý‰þäþÈÿ§$B¨ÿŠ©CãV.¥ÿ_ÿ:ÿ‚ý&ü€ü´ýÊþáÿ½Š¥ÿ~þ2ý„ý“þ ÿvÿ-êr\Rꉚñþ²þôÿµGûÿXÑÿªý$üžüýIý&þˆþFÿìÿÿ<ÿëÿ:ǘs~a€¡Q§r¤wÿ#ÿ±þéýRý²ý¸þÿ÷þ`þ¢ýwþËÿ½ÿ¡ÿñ0ÃÍþ©ÿƒÿKþIÿ-=\:A&¾Ãÿ’ÿþþÈþ9ÿˆÿVÿ»þ˜þþþÂÿ¶Û¥ÿYþfþ¤þ@þþÿ=æY‘lþ.ý;þjþýÙüœý¦þ!xMNƒÿUÿåÿ•äÿ³ÿËéúããÿÈþÉÿ2JÿfÿVä"½þeþþaý¢üøüÐý˜ýýýOÿ–ÿâÿê³€ˆÔÅ‘ûƒa½¥Áíxÿ¢þLÿIÿ·þíþÈÿ1ÿnýTý]ýÇü(ýÏýþ }Ãÿ'ÈÕTž b]²Š]¯]¥%ÿOþýÖüSýkþ4ÿ¤ÿH_qÿdÿyÿþIýIþ%ÿÿþ‚ÿ<˜ûÐþ€PÿÙÿI*ÿ‘ý-ýþ§þiÿ3¬nëþÊý€ýHþà?1ÞKÿ÷ÿˆÈ^ÿ$óÐÿ¼ÿo‹ƒÿÏÿÞÿ¬þlþþ´ý‚ýþþ™þ¼ÿ·ÿ«þ—ÿÉiULŸô@k¦þ{þ‰ÿùÿmÿÔþïÿØþÊþ‰þpþðþIÿµÿpéÿÍÿúXãÿ ÿÇÿÅÿ¹þæþåüƒì™Òãÿ‘ý³ü‘ýŽý¡ýÅþ8ÿôÿå¯y̺6žÿªÿ—2 ÿâYÌë2Ø»ÿ€ý¥ýéþ)ÿ‡þþzÿÿþÿÄÿ$ÿ ÿ–þ?þ£þÿ0ö0ädqÆ*õ@àBóþLÿÓÕÿ7þ°ý+þÎýÖýÿ•ÿJÿ†þ]ýûüRý÷ý\þ'ÿ£ç·*±B¨ö"HÊÇÿÐþðþ†ÿ_ÿiþÄý<ý’üÁü¦ýÌþ[÷ƒÙÿ<™þýÞþXŽÿBÿEˆ<p%œÝ¡ÿ¸þÿþ_ÿÀþˆþÿ8ÿGÿvÿ­ÿ ÿSÿ¯þòýþŽÿ™f£€µ8=ñÿ}þÿýFÿuÿöþOÿ“ÿ¹ÿ—ÿ¦ÿÚWÙ€Àÿ»þëþ<ŠÃçÊ¡ÿmþyÛîûF—e`þÿKÿ=þåýõý¥þèþþØþ]ùÿRÿAÿ²þ¨þ±ÿ4žzœóÅ‚gVåÿÿ©ÿý¨êÿ&ÿ¾þµýæüGý’ý¶ý]þïþêÿÌY2íN~Tÿàÿf$£ÿ¨ÿ ïÇ#'óþ¥ý½ý³þ/ÿŸÿ™Sÿšþ^þþ³þWÿ ÿüþŒÿnü#•€²©zŒÿ}ÿ}ÿ ÿ|þnþÿþÿ|þâþ‘ÿÿ°ÿêÿúÿ`×K‡ÿÞÿ‚ÿàþþÿáX¡ ÅUâÿg ÆÿˆÿÓÿ­ÿ•þ‡þUÿ2ÿÃþ¢þòý;ýÃý½þ'ÿ«ùf(+ÿOÿs€çÿ®ÿ§ŸK^ ÿuþžþÄþÓþŸþ“þIÿ_EþACºÿ;þþ?œÉ¿²2“aœÂÿuþ,þÃþ0ÿàÿêÖMâÿMÿbÿðÿ†œÿPÿ *Øÿ#º¡éÿ ŽÿüÿÐvÈþ—ý˜ý‘ýnýlþÊÿƒÝßHÓ†pU9›¥xѲM´ÿåþÿÏþoþ™þTÿEOÅÿPÿ¯þÔý(ýýQýÐýòþuÿîÿ˜1ÂÒwnÖÚžÿ!ÐWÐÿ…ÿNÿ`þ/ý;ýÒýeþ ÿ«ÿA+J1âþàþåÿ#ÿWþÁÿ29œNM‘Š!v&ÿxþðþÿxÿ*àÿ ÿ<þÒýPþGÿ7N~.‘.ÿbÿ¹Ð%üéÉÿ Væâÿ ÿhþºþýþ)ÿÞÿÜÿÂÿïÿƒ>Eÿ¦ÿ7™ÿ¿ÿÊÿñ®Úþ™ý¦þFÿêþîþ ÿ?0;ìÿ%ÿTþzþ€þËþpÿ†ÿÿÃ"ß"jy$ÿöÿý·æî:ÿ•þiþÂþhþ=þ®þÄþLÿ2nîôR.Á©“ÿ\ÿŒÁúÿF%*wkŸÿšÿÕÿÿMÿÿnþˆþ”þÜþÿxÝñuãË ÎRû¨ÿ3¼ÿôþþãý%þUþuÿÓûòy”ÿ@ÿ0ÿ2ÿ;ÿ½ÿsJÀÿØ©4gvotÿ£ÿNJÿÿ“ÿÑÿ†ÿšÿçþéý¼ý þ‚þZÿ;‘Ä}|DÔ•ÿñÿç?T:0yÿqÿ¼ÿ’ÿ!ÿØþ¨þÛþ+ÿ\ÿÎÿ0=§ÿÿªÿ[úÿÏÿ(‰ùÿ[ÿåÿ +ýnÝÿ;2óÿøÿðÿ ÿ…ÿtÿ‰ÿ™ÿÖÿ6$<‘-Hÿkÿ}€3!ÚkiÌÿ±ÿÿ þ½ýîýPþ¦þ#ÿnvWÙ€!Öÿ*Ca"ÎÂÿ‡¿Ò¸Þýÿ²þƒþˆÿèÿæÿwÿ±þtþ˜þMþúýDþŸþÿ[â§¥f]çÔØõÿ…ÅZš½Ñÿ·þTþ¶þÿ#ÿbÿ·ÿšÿÿ±þ¿þãþqÿêÿ†ÿËÿ‡BÁ!Eñ î@Q£çÿŠÿdÿ«ÿšÿ5ÿÿ¾þ–þÓþGÿíÿ£F²ÿÈÿBÿ­þ$ÿ_ön¹âqãÿ+ÿäþÅþÿ ÿÊþ¿ÿ¾¤t6±ÿÿïþLÿ’ÿŸkðª"RZ|ÿûÿbuÿÊþmÿ?e7^x¢ÿVÿ²ÿqÿÿ©þxþÄþ|ÿþÿª¢óÅÿ|sÞ7ÂI¼þÿÖÿÏÿ}ÿ<ÿÿ:ÿˆÿ|ÿ¾ÿÞÿ¿ÿ²ÿ}ÿ»ÿ3k#:CÓÿÜÿ¨¶ÛÿÿÐÿˆ-¹õÿWÿ4ÿ ÿæþPÿsÿKÿcÿrÿôÿ–º›eL9ìÿØÿi6ß}  ÿéþ¤þ©þ ÿ‡ÿ±ÿ'Š<Úÿ{ÿBÿ^ÿpÿ³ÿâÿ*&‰Ëpï7‹ë‰·ÿpÿâÿòÿ´ÿ¹ÿâÿøÿyÿïþÿ7ÿ1ÿEÿxÿ¾ÿ¼ÿ§ÿÿ‚ÿ+º6;yÆK0¯DPUïÿ·ÿœÿ†ÿ‚ÿxÿ—ÿÿsÿaÿÿìþPÿ×ÿ7N£ýOƒÿìÿ,rÿ<ÿÉÿ2;[ ‰e¨ÿ”ÿžÿÈÿÒÿhÿRÿÿìÿ9a%Ûÿ©ÿXÿ:ÿñÿó ÉòîR~ÿOÿ“ÿDÿæþèþöþpÿôÿ‹Ùoûÿîÿòÿ—Ê=LîµÅÿ«ÿHv àÿf`–ÿAÿ,ÿ3ÿbÿ2ÿ3ÿzÿXÿQÿ²ÿÞÿâÿ!àÿ~Aÿ™ïŒ%¢ý‰íÿ¯ÿ²ÿ€ÿgÿžÿæÿ+íÿ|ÿDÿßþ§þÈþôþTÿéÿ?]Ð%¿'0œ^×ÿ"¤`"¨ÌKÙÿWÿùþîþÿ¤ÿðÿåÿùÿâÿ²ÿÁÿÆÿÿˆÿ×ÿ®ÿmÿºÿ®_ãi'ìÿ9…ÿÿäþ*ÿsÿ‚ÿ÷ÿx.“ÿRÿiÿ¨ÿúÿE‚ÕÊ–ÿòÿw´ÿP¬G%h†9Éÿ•ÿÁÿáÿÂÿ®ÿgÿBÿ;ÿSÿ‹ÿ·ÿ«ÿWÿÿbÅÁO, p›ÿÁÿãÿçÿÇÿÁÿ/ýÿôÿµÿÿ±ÿµÿØÿùÿ !,QVÕÿõÿïÿ¬ÿÀÿ1d[z„Mùÿ ÿ}ÿƒÿ†ÿ›ÿÎÿ÷ÿ27ãÿ»ÿ wV>~ýÿ›ÿÀÿäÿÄÿ±ÿÀÿËÿµÿ”ÿžÿÉÿæÿÛÿÁÿÊÿâÿöÿ4^hšv %‡q)1T7òÿèÿ ¾ÿ†ÿ|ÿ¢ÿÂÿÑÿôÿóÿ¬ÿwÿyÿtÿŒÿ«ÿ½ÿ xV€ûÞf=\b2;!Îÿ³ÿÊÿãÿïÿâÿÍÿŽÿNÿ\ÿ{ÿ¬ÿþÿGg=! ÌÿÿØÿàÿÃÿ t~l¦©IýÿâÿÒÿÓÿÇÿ¾ÿèÿôÿÞÿÖÿÜÿæÿÖÿÃÿÃÿèÿ$÷ÿA|Cüÿ9 ÄÿÉÿÚÿÃÿâÿÔÿØÿßÿÉÿïÿ0/þÿâÿéÿ*ecêÿºÿD-†.ÉÿÎÿÁÿ„ÿvÿ‡ÿ­ÿØÿ×ÿüÿ/âÿÃÿ®ÿ³ÿÚÿòÿûÿ+e]I“Âo íÿÚÿ;æÿÂÿ¶ÿ•ÿ…ÿ’ÿoÿhÿŠÿŸÿïÿYqcha+óÿP3ÍÿãÿDH*fˆ/Ãÿ•ÿ—ÿ­ÿÍÿóÿ+ Ïÿ¥ÿ‡ÿˆÿ¹ÿÔÿÚÿøÿ%5"2—E(z‰*úÿíÿ¸ÿ ÿ ÿ°ÿ´ÿ’ÿŠÿÂÿñÿûÿ9(ôÿéÿñÿÂÿ]3"‹¹lþÿèÿÅÿÆÿÝÿÛÿÒÿâÿôÿçÿÐÿ¨ÿvÿbÿxÿ¤ÿÌÿ|³x_ŽIÑÿÕÿõÿ ?P$þÿ÷ÿÖÿÒÿöÿöÿùÿ÷ÿúÿÿÿúÿùÿÿÿÿÿþÿúÿúÿúÿûÿÿÿûÿüÿÿÿÿÿþÿspeech-dispatcher-0.8/src/api/python/speechd_config/__init__.py0000664000175000017500000000137511777240701021645 00000000000000# Copyright (C) 2008 Brailcom, o.p.s. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA from .config import * speech-dispatcher-0.8/src/api/python/speechd_config/Makefile.am0000664000175000017500000000123511777240701021563 00000000000000## Process this file with automake to produce Makefile.in dist_snddata_DATA = test.wav dist_bin_SCRIPTS = spd-conf speechd_pythondir = $(pyexecdir)/speechd_config speechd_python_PYTHON = __init__.py config.py nodist_speechd_python_PYTHON = paths.py paths_edit = sed \ -e "s:[@]spdconforigdir[@]:$(spdconforigdir):" \ -e "s:[@]spdconfdir[@]:$(spdconfdir):" \ -e "s:[@]snddatadir[@]:$(snddatadir):" \ -e "s:[@]spddesktopconforigdir[@]:$(spddesktopconforigdir):" paths.py: Makefile rm -f $@ srcdir=; \ test -f ./$@.in || srcdir=$(srcdir)/; \ $(paths_edit) $${srcdir}$@.in > $@ paths.py: $(srcdir)/paths.py.in CLEANFILES = paths.py EXTRA_DIST = paths.py.in speech-dispatcher-0.8/src/api/python/speechd_config/Makefile.in0000664000175000017500000004736712113401437021602 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/api/python/speechd_config DIST_COMMON = $(dist_bin_SCRIPTS) $(dist_snddata_DATA) \ $(speechd_python_PYTHON) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(speechd_pythondir)" \ "$(DESTDIR)$(speechd_pythondir)" "$(DESTDIR)$(snddatadir)" SCRIPTS = $(dist_bin_SCRIPTS) AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = am__py_compile = PYTHON=$(PYTHON) $(SHELL) $(py_compile) py_compile = $(top_srcdir)/py-compile DATA = $(dist_snddata_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOTCONF_CFLAGS = @DOTCONF_CFLAGS@ DOTCONF_LIBS = @DOTCONF_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ EXTRA_ESPEAK_LIBS = @EXTRA_ESPEAK_LIBS@ EXTRA_SOCKET_LIBS = @EXTRA_SOCKET_LIBS@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GMODULE_CFLAGS = @GMODULE_CFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTHREAD_CFLAGS = @GTHREAD_CFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBAO_CFLAGS = @LIBAO_CFLAGS@ LIBAO_LIBS = @LIBAO_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_SPD_AGE = @LIB_SPD_AGE@ LIB_SPD_CURRENT = @LIB_SPD_CURRENT@ LIB_SPD_REVISION = @LIB_SPD_REVISION@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NAS_LIBS = @NAS_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ PULSE_CFLAGS = @PULSE_CFLAGS@ PULSE_LIBS = @PULSE_LIBS@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RDYNAMIC = @RDYNAMIC@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SNDFILE_CFLAGS = @SNDFILE_CFLAGS@ SNDFILE_LIBS = @SNDFILE_LIBS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ audio_dlopen_modules = @audio_dlopen_modules@ audiodir = @audiodir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ clientconfdir = @clientconfdir@ clientconforigdir = @clientconforigdir@ datadir = @datadir@ datarootdir = @datarootdir@ default_audio_method = @default_audio_method@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ flite_basic = @flite_basic@ flite_kal = @flite_kal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ ibmtts_include = @ibmtts_include@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ modulebindir = @modulebindir@ moduleconfdir = @moduleconfdir@ moduleconforigdir = @moduleconforigdir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ snddatadir = @snddatadir@ spdconfdir = @spdconfdir@ spdconforigdir = @spdconforigdir@ spddesktopconforigdir = @spddesktopconforigdir@ spdincludedir = @spdincludedir@ spdlibdir = @spdlibdir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ dist_snddata_DATA = test.wav dist_bin_SCRIPTS = spd-conf speechd_pythondir = $(pyexecdir)/speechd_config speechd_python_PYTHON = __init__.py config.py nodist_speechd_python_PYTHON = paths.py paths_edit = sed \ -e "s:[@]spdconforigdir[@]:$(spdconforigdir):" \ -e "s:[@]spdconfdir[@]:$(spdconfdir):" \ -e "s:[@]snddatadir[@]:$(snddatadir):" \ -e "s:[@]spddesktopconforigdir[@]:$(spddesktopconforigdir):" CLEANFILES = paths.py EXTRA_DIST = paths.py.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/api/python/speechd_config/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/api/python/speechd_config/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-dist_binSCRIPTS: $(dist_bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(dist_bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-dist_binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(dist_bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-nodist_speechd_pythonPYTHON: $(nodist_speechd_python_PYTHON) @$(NORMAL_INSTALL) test -z "$(speechd_pythondir)" || $(MKDIR_P) "$(DESTDIR)$(speechd_pythondir)" @list='$(nodist_speechd_python_PYTHON)'; dlist=; list2=; test -n "$(speechd_pythondir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \ if test -f $$b$$p; then \ $(am__strip_dir) \ dlist="$$dlist $$f"; \ list2="$$list2 $$b$$p"; \ else :; fi; \ done; \ for file in $$list2; do echo $$file; done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(speechd_pythondir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(speechd_pythondir)" || exit $$?; \ done || exit $$?; \ if test -n "$$dlist"; then \ $(am__py_compile) --destdir "$(DESTDIR)" \ --basedir "$(speechd_pythondir)" $$dlist; \ else :; fi uninstall-nodist_speechd_pythonPYTHON: @$(NORMAL_UNINSTALL) @list='$(nodist_speechd_python_PYTHON)'; test -n "$(speechd_pythondir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ dir='$(DESTDIR)$(speechd_pythondir)'; \ filesc=`echo "$$files" | sed 's|$$|c|'`; \ fileso=`echo "$$files" | sed 's|$$|o|'`; \ st=0; \ for files in "$$files" "$$filesc" "$$fileso"; do \ $(am__uninstall_files_from_dir) || st=$$?; \ done; \ exit $$st install-speechd_pythonPYTHON: $(speechd_python_PYTHON) @$(NORMAL_INSTALL) test -z "$(speechd_pythondir)" || $(MKDIR_P) "$(DESTDIR)$(speechd_pythondir)" @list='$(speechd_python_PYTHON)'; dlist=; list2=; test -n "$(speechd_pythondir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \ if test -f $$b$$p; then \ $(am__strip_dir) \ dlist="$$dlist $$f"; \ list2="$$list2 $$b$$p"; \ else :; fi; \ done; \ for file in $$list2; do echo $$file; done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(speechd_pythondir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(speechd_pythondir)" || exit $$?; \ done || exit $$?; \ if test -n "$$dlist"; then \ $(am__py_compile) --destdir "$(DESTDIR)" \ --basedir "$(speechd_pythondir)" $$dlist; \ else :; fi uninstall-speechd_pythonPYTHON: @$(NORMAL_UNINSTALL) @list='$(speechd_python_PYTHON)'; test -n "$(speechd_pythondir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ dir='$(DESTDIR)$(speechd_pythondir)'; \ filesc=`echo "$$files" | sed 's|$$|c|'`; \ fileso=`echo "$$files" | sed 's|$$|o|'`; \ st=0; \ for files in "$$files" "$$filesc" "$$fileso"; do \ $(am__uninstall_files_from_dir) || st=$$?; \ done; \ exit $$st install-dist_snddataDATA: $(dist_snddata_DATA) @$(NORMAL_INSTALL) test -z "$(snddatadir)" || $(MKDIR_P) "$(DESTDIR)$(snddatadir)" @list='$(dist_snddata_DATA)'; test -n "$(snddatadir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(snddatadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(snddatadir)" || exit $$?; \ done uninstall-dist_snddataDATA: @$(NORMAL_UNINSTALL) @list='$(dist_snddata_DATA)'; test -n "$(snddatadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(snddatadir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(speechd_pythondir)" "$(DESTDIR)$(speechd_pythondir)" "$(DESTDIR)$(snddatadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_snddataDATA \ install-nodist_speechd_pythonPYTHON \ install-speechd_pythonPYTHON install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-dist_binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_binSCRIPTS uninstall-dist_snddataDATA \ uninstall-nodist_speechd_pythonPYTHON \ uninstall-speechd_pythonPYTHON .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dist_binSCRIPTS \ install-dist_snddataDATA install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man \ install-nodist_speechd_pythonPYTHON install-pdf install-pdf-am \ install-ps install-ps-am install-speechd_pythonPYTHON \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-dist_binSCRIPTS \ uninstall-dist_snddataDATA \ uninstall-nodist_speechd_pythonPYTHON \ uninstall-speechd_pythonPYTHON paths.py: Makefile rm -f $@ srcdir=; \ test -f ./$@.in || srcdir=$(srcdir)/; \ $(paths_edit) $${srcdir}$@.in > $@ paths.py: $(srcdir)/paths.py.in # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: speech-dispatcher-0.8/src/api/python/speechd_config/spd-conf0000664000175000017500000000033711777240701021165 00000000000000#!/usr/bin/env python3 # Helper script to be put in /usr/bin/ or a similar location # calling the appropriate python tool import speechd_config if __name__=='__main__': import sys sys.exit(speechd_config.main()) speech-dispatcher-0.8/src/api/python/Makefile.am0000664000175000017500000000013311777240701016617 00000000000000## Process this file with automake to produce Makefile.in SUBDIRS = speechd speechd_config speech-dispatcher-0.8/src/api/python/Makefile.in0000664000175000017500000004632312113401437016631 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/api/python DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ ChangeLog ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOTCONF_CFLAGS = @DOTCONF_CFLAGS@ DOTCONF_LIBS = @DOTCONF_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ EXTRA_ESPEAK_LIBS = @EXTRA_ESPEAK_LIBS@ EXTRA_SOCKET_LIBS = @EXTRA_SOCKET_LIBS@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GMODULE_CFLAGS = @GMODULE_CFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTHREAD_CFLAGS = @GTHREAD_CFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBAO_CFLAGS = @LIBAO_CFLAGS@ LIBAO_LIBS = @LIBAO_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_SPD_AGE = @LIB_SPD_AGE@ LIB_SPD_CURRENT = @LIB_SPD_CURRENT@ LIB_SPD_REVISION = @LIB_SPD_REVISION@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NAS_LIBS = @NAS_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ PULSE_CFLAGS = @PULSE_CFLAGS@ PULSE_LIBS = @PULSE_LIBS@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RDYNAMIC = @RDYNAMIC@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SNDFILE_CFLAGS = @SNDFILE_CFLAGS@ SNDFILE_LIBS = @SNDFILE_LIBS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ audio_dlopen_modules = @audio_dlopen_modules@ audiodir = @audiodir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ clientconfdir = @clientconfdir@ clientconforigdir = @clientconforigdir@ datadir = @datadir@ datarootdir = @datarootdir@ default_audio_method = @default_audio_method@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ flite_basic = @flite_basic@ flite_kal = @flite_kal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ ibmtts_include = @ibmtts_include@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ modulebindir = @modulebindir@ moduleconfdir = @moduleconfdir@ moduleconforigdir = @moduleconforigdir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ snddatadir = @snddatadir@ spdconfdir = @spdconfdir@ spdconforigdir = @spdconforigdir@ spddesktopconforigdir = @spddesktopconforigdir@ spdincludedir = @spdincludedir@ spdlibdir = @spdlibdir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = speechd speechd_config all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/api/python/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/api/python/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: speech-dispatcher-0.8/src/api/guile/0000775000175000017500000000000011777240701014432 500000000000000speech-dispatcher-0.8/src/api/guile/README0000664000175000017500000000070011777240701015227 00000000000000This is a Guile interface to SSIP. It is in an experimental state now and is expected to be significantly reworked before first official release. To compile it, run `make'. libspeechd and guile libraries and headers files must be installed to get compiled the C part of the interface. If you have any questions, suggestions, etc., feel free to contact us at the mailing list . -- Milan Zamazal speech-dispatcher-0.8/src/api/guile/ChangeLog0000664000175000017500000000043511777240701016126 000000000000002004-06-14 Milan Zamazal * gssip.scm.in (ssip-say-sound): Renamed to ssip-say-icon; C function call fixed. 2004-06-14 Milan Zamazal * gssip.scm.in (ssip-block): New argument priority; missing argument in raw command invocations added. speech-dispatcher-0.8/src/api/guile/gssip.scm.in0000664000175000017500000000517411777240701016617 00000000000000;;; SSIP interface ;; Copyright (C) 2004 Brailcom, o.p.s. ;; Author: Milan Zamazal ;; COPYRIGHT NOTICE ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2 of the License, or ;; (at your option) any later version. ;; This program is distributed in the hope that it will be useful, but ;; WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ;; for more details. ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, write to the Free Software ;; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. (load-extension "%%path%%/gssip" "init_gssip") (define (ssip-open host port user client component) (%ssip-open user client component)) (define (ssip-close connection) (%ssip-close connection)) (define (ssip-say-text connection text priority) (%ssip-say-text connection text priority)) (define (ssip-say-character connection character priority) (%ssip-say-character connection character priority)) (define (ssip-say-key connection key priority) (%ssip-say-key connection key priority)) (define (ssip-say-icon connection sound priority) (%ssip-say-icon connection sound priority)) (define (ssip-stop connection id) (%ssip-stop connection id)) (define (ssip-cancel connection id) (%ssip-cancel connection id)) (define (ssip-pause connection id) (%ssip-pause connection id)) (define (ssip-resume connection id) (%ssip-resume connection id)) (define (ssip-set-language connection language) (%ssip-set-language connection language)) (define (ssip-set-output-module connection output-module) (%ssip-set-output-module connection output-module)) (define (ssip-set-rate connection rate) (%ssip-set-rate connection rate)) (define (ssip-set-pitch connection pitch) (%ssip-set-pitch connection pitch)) (define (ssip-set-volume connection volume) (%ssip-set-volume connection volume)) (define (ssip-set-voice connection voice) (%ssip-set-voice connection voice)) (define (ssip-set-punctuation-mode connection mode) (%ssip-set-punctuation-mode connection mode)) (define (ssip-set-spelling-mode connection mode) (%ssip-set-spelling-mode connection mode)) (define (ssip-block connection priority function) (%ssip-say-text connection "" priority) (%ssip-raw-command connection "BLOCK BEGIN") (catch #t (function) (lambda (key . args))) (%ssip-raw-command connection "BLOCK END")) (provide 'gssip) speech-dispatcher-0.8/src/api/guile/Makefile0000664000175000017500000000333311777240701016014 00000000000000# Makefile for speechd-guile # Copyright (C) 2004 Brailcom, o.p.s. # # Author: Milan Zamazal # # COPYRIGHT NOTICE # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. prefix = /usr/local INSTALL_PATH = $(prefix)/share/guile/site CC = gcc CFLAGS = -g -Wall INSTALL_PROGRAM = install -m 755 INSTALL_DATA = install -m 644 PROGRAM = gssip .PHONY: all install install-strip uninstall clean distclean mostlyclean \ maintainer-clean TAGS info dvi dist check all: $(PROGRAM).so $(PROGRAM).scm $(PROGRAM).so: $(PROGRAM).c $(PROGRAM).x $(PROGRAM).h $(CC) $(CFLAGS) -shared -fPIC -o $@ $(PROGRAM).c -lguile -lspeechd %.x: %.c guile-snarf -o $@ $< %.scm: %.scm.in sed 's/%%path%%/$(subst /,\/,$(INSTALL_PATH))/' $< > $@ install: all mkdir -p $(INSTALL_PATH) $(INSTALL_PROGRAM) $(PROGRAM).so $(INSTALL_PATH) $(INSTALL_DATA) $(PROGRAM).scm $(INSTALL_PATH) install-strip: $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install uninstall: mostlyclean: rm -f *.scm *.so *.x clean: mostlyclean distclean: clean maintainer-clean: distclean TAGS: info: dvi: dist: check: speech-dispatcher-0.8/src/api/guile/gssip.c0000664000175000017500000002346311777240701015653 00000000000000/* SSIP Guile interface */ /* Copyright (C) 2004 Brailcom, o.p.s. Author: Milan Zamazal COPYRIGHT NOTICE This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H #include #endif #define _GNU_SOURCE #include #include #include #include #include "gssip.h" #define ASSIGN_VAR(var, pos, checker, setter) \ SCM_ASSERT (SCM_##checker##P (var), var, SCM_ARG##pos, FUNC_NAME); \ c_##var = SCM_##setter (var) #define ASSIGN_INT(var, pos) ASSIGN_VAR (var, pos, INUM, INUM) #define ASSIGN_STRING(var, pos) ASSIGN_VAR (var, pos, STRING, STRING_CHARS) #define ASSIGN_SYMBOL(var, pos) ASSIGN_VAR (var, pos, SYMBOL, SYMBOL_CHARS) #define ASSIGN_CONNECTION() ASSIGN_INT (connection, 1); #define ASSIGN_PRIORITY() c_priority = assign_priority (priority, FUNC_NAME) #define RETURN_SUCCESS(value) return ((value) ? SCM_BOOL_F : SCM_BOOL_T) static SPDPriority assign_priority(SCM priority, const char *func_name) { char *c_priority; SCM_ASSERT(SCM_SYMBOLP(priority), priority, SCM_ARG3, func_name); c_priority = SCM_SYMBOL_CHARS(priority); { const int invalid_priority = -1000; int int_priority = ((!strcmp(c_priority, "important")) ? SPD_IMPORTANT : (!strcmp(c_priority, "message")) ? SPD_MESSAGE : (!strcmp(c_priority, "text")) ? SPD_TEXT : (!strcmp(c_priority, "notification")) ? SPD_NOTIFICATION : (!strcmp(c_priority, "progress")) ? SPD_PROGRESS : invalid_priority); if (int_priority == invalid_priority) scm_wrong_type_arg(func_name, SCM_ARG3, priority); return int_priority; } } /* SSIP connection opening/closing functions */ SCM_DEFINE(ssip_open, "%ssip-open", 3, 0, 0, (SCM user, SCM client, SCM component), "Open new SSIP connection and return its identifier.") #define FUNC_NAME s_ssip_open { char *c_user, *c_client, *c_component; ASSIGN_STRING(user, 1); ASSIGN_STRING(client, 2); ASSIGN_STRING(component, 3); { int connection = spd_open(c_client, c_component, c_user); return (connection ? SCM_MAKINUM(connection) : SCM_EOL); } } #undef FUNC_NAME SCM_DEFINE(ssip_close, "%ssip-close", 1, 0, 0, (SCM connection), "Close the given SSIP connection.") #define FUNC_NAME s_ssip_close { int c_connection; ASSIGN_CONNECTION(); spd_close(c_connection); return SCM_UNSPECIFIED; } #undef FUNC_NAME /* Speech output functions */ #define SSIP_OUTPUT_DECL(name, sname) \ SCM_DEFINE (ssip_say_##name, "%ssip-say-" sname, 3, 0, 0, \ (SCM connection, SCM text, SCM priority), \ "Say " sname " on CONNECTION with PRIORITY and return whether it succeeded.") #define SSIP_OUTPUT_BODY(spd_func) \ { \ int c_connection; \ char *c_text; \ SPDPriority c_priority; \ ASSIGN_CONNECTION (); \ ASSIGN_STRING (text, 2); \ ASSIGN_PRIORITY (); \ RETURN_SUCCESS (spd_func (c_connection, c_priority, c_text)); \ } #define FUNC_NAME s_ssip_say_text SSIP_OUTPUT_DECL(text, "text") SSIP_OUTPUT_BODY(spd_say) #undef FUNC_NAME #define FUNC_NAME s_ssip_say_character SSIP_OUTPUT_DECL(character, "character") SSIP_OUTPUT_BODY(spd_char) #undef FUNC_NAME #define FUNC_NAME s_ssip_say_key SSIP_OUTPUT_DECL(key, "key") SSIP_OUTPUT_BODY(spd_key) #undef FUNC_NAME #define FUNC_NAME s_ssip_say_icon SSIP_OUTPUT_DECL(icon, "icon") SSIP_OUTPUT_BODY(spd_sound_icon) #undef FUNC_NAME /* Speech output management functions */ #define SSIP_CONTROL_DECL(name, sname) \ SCM_DEFINE (ssip_##name, "%ssip-" sname, 2, 0, 0, \ (SCM connection, SCM id), \ sname "speaking and return whether it succeeded.") #define SSIP_CONTROL_BODY(name) \ { \ int c_connection; \ int result_code; \ ASSIGN_CONNECTION (); \ if (SCM_INUMP (id)) \ result_code = spd_stop_uid (c_connection, SCM_INUM (id)); \ else if (id == SCM_EOL) \ result_code = spd_stop (c_connection); \ else if (SCM_SYMBOLP (id) \ && (! strcmp (SCM_SYMBOL_CHARS (id), "t"))) \ result_code = spd_stop_all (c_connection); \ else \ scm_wrong_type_arg (FUNC_NAME, SCM_ARG2, id); \ RETURN_SUCCESS (result_code); \ } #define FUNC_NAME s_ssip_stop SSIP_CONTROL_DECL(stop, "stop") SSIP_CONTROL_BODY(stop) #undef FUNC_NAME #define FUNC_NAME s_ssip_cancel SSIP_CONTROL_DECL(cancel, "cancel") SSIP_CONTROL_BODY(cancel) #undef FUNC_NAME #define FUNC_NAME s_ssip_pause SSIP_CONTROL_DECL(pause, "pause") SSIP_CONTROL_BODY(pause) #undef FUNC_NAME #define FUNC_NAME s_ssip_resume SSIP_CONTROL_DECL(resume, "resume") SSIP_CONTROL_BODY(resume) #undef FUNC_NAME /* Speech parameters functions */ #define SSIP_SET_DECL(name, sname) \ SCM_DEFINE (ssip_set_##name, "%ssip-set-" sname, 2, 0, 0, \ (SCM connection, SCM value), \ "Set " sname " for CONNECTION.") #define SSIP_PROCESS_SET_ARGS(type, type_f) \ int c_connection; \ type c_value; \ ASSIGN_CONNECTION (); \ ASSIGN_##type_f (value, 2); #define SSIP_SET_STRING_BODY(name) \ { \ SSIP_PROCESS_SET_ARGS (char *, STRING); \ RETURN_SUCCESS (spd_set_##name (c_connection, c_value)); \ } #define SSIP_SET_INT_BODY(name) \ { \ SSIP_PROCESS_SET_ARGS (int, INT); \ SCM_ASSERT ((-100 <= c_value && c_value <= 100), value, SCM_ARG2, \ FUNC_NAME); \ RETURN_SUCCESS (spd_set_##name (c_connection, c_value)); \ } #define FUNC_NAME s_ssip_set_language SSIP_SET_DECL(language, "language") SSIP_SET_STRING_BODY(language) #undef FUNC_NAME #define FUNC_NAME s_ssip_set_output_module SSIP_SET_DECL(output_module, "output-module") SSIP_SET_STRING_BODY(output_module) #undef FUNC_NAME #define FUNC_NAME s_ssip_set_rate SSIP_SET_DECL(rate, "rate") SSIP_SET_INT_BODY(voice_rate) #undef FUNC_NAME #define FUNC_NAME s_ssip_set_pitch SSIP_SET_DECL(pitch, "pitch") SSIP_SET_INT_BODY(voice_pitch) #undef FUNC_NAME #define FUNC_NAME s_ssip_set_volume SSIP_SET_DECL(volume, "volume") SSIP_SET_INT_BODY(volume) #undef FUNC_NAME #define FUNC_NAME s_ssip_set_voice SSIP_SET_DECL(voice, "voice") { SSIP_PROCESS_SET_ARGS(char *, STRING); { char *command; int result_code; if (asprintf(&command, "SET self VOICE %s", c_value) < 0) scm_memory_error(FUNC_NAME); result_code = spd_execute_command(c_connection, command); free(command); RETURN_SUCCESS(result_code); } } #undef FUNC_NAME #define FUNC_NAME s_ssip_set_punctuation_mode SSIP_SET_DECL(punctuation_mode, "punctuation-mode") { SSIP_PROCESS_SET_ARGS(char *, SYMBOL); { SPDPunctuation mode; if (!strcmp(c_value, "none")) mode = SPD_PUNCT_NONE; else if (!strcmp(c_value, "some")) mode = SPD_PUNCT_SOME; else if (!strcmp(c_value, "all")) mode = SPD_PUNCT_ALL; else scm_wrong_type_arg(FUNC_NAME, SCM_ARG2, value); RETURN_SUCCESS(spd_set_punctuation(c_connection, mode)); } } #undef FUNC_NAME #define FUNC_NAME s_ssip_set_spelling_mode SSIP_SET_DECL(spelling_mode, "spelling-mode") { SSIP_PROCESS_SET_ARGS(char *, SYMBOL); { SPDSpelling mode; if (!strcmp(c_value, "on")) mode = SPD_SPELL_ON; else if (!strcmp(c_value, "off")) mode = SPD_SPELL_OFF; else scm_wrong_type_arg(FUNC_NAME, SCM_ARG2, value); RETURN_SUCCESS(spd_set_spelling(c_connection, mode)); } } #undef FUNC_NAME /* Raw SSIP commands */ SCM_DEFINE(ssip_raw_command, "%ssip-raw-command", 2, 0, 0, (SCM connection, SCM command), "Send raw COMMAND to CONNECTION and return whether it succeeded.") #define FUNC_NAME s_ssip_raw_command { int c_connection; char *c_command; ASSIGN_CONNECTION(); ASSIGN_STRING(command, 2); RETURN_SUCCESS(spd_execute_command(c_connection, c_command)); } #undef FUNC_NAME /* Define the Scheme bindings */ void init_gssip() { #include "gssip.x" } speech-dispatcher-0.8/src/api/guile/gssip.h0000664000175000017500000000153711777240701015656 00000000000000/* SSIP Guile support */ /* Copyright (C) 2004 Brailcom, o.p.s. Author: Milan Zamazal COPYRIGHT NOTICE This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef __GSSIP_H #define __GSSIP_H void init_gssip(); #endif speech-dispatcher-0.8/src/api/Makefile.am0000664000175000017500000000020611777240701015277 00000000000000## Process this file with automake to produce Makefile.in SUBDIRS= c if HAVE_PYTHON SUBDIRS += python endif EXTRA_DIST = cl guile speech-dispatcher-0.8/src/api/c/0000775000175000017500000000000012113401632013532 500000000000000speech-dispatcher-0.8/src/api/c/libspeechd.h0000664000175000017500000002044311777240701015745 00000000000000/* * libspeechd.h - Shared library for easy acces to Speech Dispatcher functions (header) * * Copyright (C) 2001, 2002, 2003, 2004 Brailcom, o.p.s. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this package; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * * $Id: libspeechd.h,v 1.29 2008-07-30 09:47:00 hanke Exp $ */ #ifndef _LIBSPEECHD_H #define _LIBSPEECHD_H #include #include #include /* * Since the API includes speechd_types.h directly, we only need this * include if we are not being included by the API. */ #ifndef SPEECHD_TYPES_H #include #endif /* *INDENT-OFF* */ #ifdef __cplusplus extern "C" { #endif /* *INDENT-ON* */ /* Speech Dispatcher's default port for inet communication */ #define SPEECHD_DEFAULT_PORT 6560 /* Arguments for spd_send_data() */ #define SPD_WAIT_REPLY 1 /* Wait for reply */ #define SPD_NO_REPLY 0 /* No reply requested */ /* --------------------- Public data types ------------------------ */ typedef enum { SPD_MODE_SINGLE = 0, SPD_MODE_THREADED = 1 } SPDConnectionMode; typedef enum { SPD_METHOD_UNIX_SOCKET = 0, SPD_METHOD_INET_SOCKET = 1, } SPDConnectionMethod; typedef struct { SPDConnectionMethod method; char *unix_socket_name; char *inet_socket_host; int inet_socket_port; char *dbus_bus; } SPDConnectionAddress; typedef void (*SPDCallback) (size_t msg_id, size_t client_id, SPDNotificationType state); typedef void (*SPDCallbackIM) (size_t msg_id, size_t client_id, SPDNotificationType state, char *index_mark); typedef struct { /* PUBLIC */ SPDCallback callback_begin; SPDCallback callback_end; SPDCallback callback_cancel; SPDCallback callback_pause; SPDCallback callback_resume; SPDCallbackIM callback_im; /* PRIVATE */ int socket; FILE *stream; SPDConnectionMode mode; pthread_mutex_t *ssip_mutex; pthread_t *events_thread; pthread_mutex_t *comm_mutex; pthread_cond_t *cond_reply_ready; pthread_mutex_t *mutex_reply_ready; pthread_cond_t *cond_reply_ack; pthread_mutex_t *mutex_reply_ack; char *reply; } SPDConnection; /* -------------- Public functions --------------------------*/ /* Openning and closing Speech Dispatcher connection */ SPDConnectionAddress *spd_get_default_address(char **error); SPDConnection *spd_open(const char *client_name, const char *connection_name, const char *user_name, SPDConnectionMode mode); SPDConnection *spd_open2(const char *client_name, const char *connection_name, const char *user_name, SPDConnectionMode mode, SPDConnectionAddress * address, int autospawn, char **error_result); void spd_close(SPDConnection * connection); /* Speaking */ int spd_say(SPDConnection * connection, SPDPriority priority, const char *text); int spd_sayf(SPDConnection * connection, SPDPriority priority, const char *format, ...); /* Speech flow */ int spd_stop(SPDConnection * connection); int spd_stop_all(SPDConnection * connection); int spd_stop_uid(SPDConnection * connection, int target_uid); int spd_cancel(SPDConnection * connection); int spd_cancel_all(SPDConnection * connection); int spd_cancel_uid(SPDConnection * connection, int target_uid); int spd_pause(SPDConnection * connection); int spd_pause_all(SPDConnection * connection); int spd_pause_uid(SPDConnection * connection, int target_uid); int spd_resume(SPDConnection * connection); int spd_resume_all(SPDConnection * connection); int spd_resume_uid(SPDConnection * connection, int target_uid); /* Characters and keys */ int spd_key(SPDConnection * connection, SPDPriority priority, const char *key_name); int spd_char(SPDConnection * connection, SPDPriority priority, const char *character); int spd_wchar(SPDConnection * connection, SPDPriority priority, wchar_t wcharacter); /* Sound icons */ int spd_sound_icon(SPDConnection * connection, SPDPriority priority, const char *icon_name); /* Setting parameters */ int spd_set_voice_type(SPDConnection *, SPDVoiceType type); int spd_set_voice_type_all(SPDConnection *, SPDVoiceType type); int spd_set_voice_type_uid(SPDConnection *, SPDVoiceType type, unsigned int uid); int spd_set_synthesis_voice(SPDConnection *, const char *voice_name); int spd_set_synthesis_voice_all(SPDConnection *, const char *voice_name); int spd_set_synthesis_voice_uid(SPDConnection *, const char *voice_name, unsigned int uid); int spd_set_data_mode(SPDConnection * connection, SPDDataMode mode); int spd_set_notification_on(SPDConnection * connection, SPDNotification notification); int spd_set_notification_off(SPDConnection * connection, SPDNotification notification); int spd_set_notification(SPDConnection * connection, SPDNotification notification, const char *state); int spd_set_voice_rate(SPDConnection * connection, signed int rate); int spd_set_voice_rate_all(SPDConnection * connection, signed int rate); int spd_set_voice_rate_uid(SPDConnection * connection, signed int rate, unsigned int uid); int spd_set_voice_pitch(SPDConnection * connection, signed int pitch); int spd_set_voice_pitch_all(SPDConnection * connection, signed int pitch); int spd_set_voice_pitch_uid(SPDConnection * connection, signed int pitch, unsigned int uid); int spd_set_volume(SPDConnection * connection, signed int volume); int spd_set_volume_all(SPDConnection * connection, signed int volume); int spd_set_volume_uid(SPDConnection * connection, signed int volume, unsigned int uid); int spd_set_punctuation(SPDConnection * connection, SPDPunctuation type); int spd_set_punctuation_all(SPDConnection * connection, SPDPunctuation type); int spd_set_punctuation_uid(SPDConnection * connection, SPDPunctuation type, unsigned int uid); int spd_set_capital_letters(SPDConnection * connection, SPDCapitalLetters type); int spd_set_capital_letters_all(SPDConnection * connection, SPDCapitalLetters type); int spd_set_capital_letters_uid(SPDConnection * connection, SPDCapitalLetters type, unsigned int uid); int spd_set_spelling(SPDConnection * connection, SPDSpelling type); int spd_set_spelling_all(SPDConnection * connection, SPDSpelling type); int spd_set_spelling_uid(SPDConnection * connection, SPDSpelling type, unsigned int uid); int spd_set_language(SPDConnection * connection, const char *language); int spd_set_language_all(SPDConnection * connection, const char *language); int spd_set_language_uid(SPDConnection * connection, const char *language, unsigned int uid); int spd_set_output_module(SPDConnection * connection, const char *output_module); int spd_set_output_module_all(SPDConnection * connection, const char *output_module); int spd_set_output_module_uid(SPDConnection * connection, const char *output_module, unsigned int uid); int spd_get_client_list(SPDConnection * connection, char **client_names, int *client_ids, int *active); int spd_get_message_list_fd(SPDConnection * connection, int target, int *msg_ids, char **client_names); char **spd_list_modules(SPDConnection * connection); char **spd_list_voices(SPDConnection * connection); SPDVoice **spd_list_synthesis_voices(SPDConnection * connection); char **spd_execute_command_with_list_reply(SPDConnection * connection, char *command); /* Direct SSIP communication */ int spd_execute_command(SPDConnection * connection, char *command); int spd_execute_command_with_reply(SPDConnection * connection, char *command, char **reply); int spd_execute_command_wo_mutex(SPDConnection * connection, char *command); char *spd_send_data(SPDConnection * connection, const char *message, int wfr); char *spd_send_data_wo_mutex(SPDConnection * connection, const char *message, int wfr); /* *INDENT-OFF* */ #ifdef __cplusplus } #endif /* __cplusplus */ /* *INDENT-ON* */ #endif /* ifndef _LIBSPEECHD_H */ speech-dispatcher-0.8/src/api/c/libspeechd.c0000664000175000017500000013137111777240701015743 00000000000000/* libspeechd.c - Shared library for easy acces to Speech Dispatcher functions * * Copyright (C) 2001, 2002, 2003, 2006, 2007, 2008 Brailcom, o.p.s. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this package; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * * $Id: libspeechd.c,v 1.37 2008-12-23 09:15:32 pdm Exp $ */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* * This is needed because speechd_types.h is in a different location in * the source tree's include directory than it will be when it is * installed on the user's system. */ #include #include "libspeechd.h" /* Comment/uncomment to switch debugging on/off */ // #define LIBSPEECHD_DEBUG 1 #ifdef LIBSPEECHD_DEBUG /* Debugging */ static FILE *spd_debug; #endif /* Unless there is an fatal error, it doesn't print anything */ #define SPD_FATAL(msg) { printf("Fatal error (libspeechd) [%s:%d]:"msg, __FILE__, __LINE__); fflush(stdout); exit(EXIT_FAILURE); } /* -------------- Private functions headers ------------------------*/ #ifdef LIBSPEECHD_DEBUG FILE *spd_debug = NULL; #endif static int spd_set_priority(SPDConnection * connection, SPDPriority priority); static char *escape_dot(const char *text); static int isanum(char *str); static char *get_reply(SPDConnection * connection); static int get_err_code(char *reply); static char *get_param_str(char *reply, int num, int *err); static int get_param_int(char *reply, int num, int *err); static void *xmalloc(size_t bytes); static void xfree(void *ptr); static int ret_ok(char *reply); static void SPD_DBG(char *format, ...); static void *spd_events_handler(void *); pthread_mutex_t spd_logging_mutex; #if !(defined(__GLIBC__) && defined(_GNU_SOURCE)) /* Added by Willie Walker - strndup and getline are gcc-isms */ char *strndup(const char *s, size_t n) { size_t nAvail; char *p; if (!s) return 0; if (strlen(s) > n) nAvail = n + 1; else nAvail = strlen(s) + 1; p = malloc(nAvail); memcpy(p, s, nAvail); p[nAvail - 1] = '\0'; return p; } #define BUFFER_LEN 256 ssize_t getline(char **lineptr, size_t * n, FILE * f) { char ch; size_t m = 0; ssize_t buf_len = 0; char *buf = NULL; char *p = NULL; if (errno != 0) { SPD_DBG("getline: errno came in as %d!!!\n", errno); errno = 0; } while ((ch = getc(f)) != EOF) { if (errno != 0) return -1; if (m++ >= buf_len) { buf_len += BUFFER_LEN; buf = (char *)realloc(buf, buf_len + 1); if (buf == NULL) { SPD_DBG("buf==NULL"); return -1; } p = buf + buf_len - BUFFER_LEN; } *p = ch; p++; if (ch == '\n') break; } if (m == 0) { SPD_DBG("getline: m=%d!", m); return -1; } else { *p = '\0'; *lineptr = buf; *n = m; return m; } } #endif /* !(defined(__GLIBC__) && defined(_GNU_SOURCE)) */ /* --------------------- Public functions ------------------------- */ #define SPD_REPLY_BUF_SIZE 65536 /* Determine address for the unix socket */ static char *_get_default_unix_socket_name(void) { GString *socket_filename; char *h; const char *rundir = g_get_user_runtime_dir(); socket_filename = g_string_new(""); g_string_printf(socket_filename, "%s/speech-dispatcher/speechd.sock", rundir); // Do not regurn glib string, but glibc string... h = strdup(socket_filename->str); g_string_free(socket_filename, 1); return h; } SPDConnectionAddress *spd_get_default_address(char **error) { const gchar *env_address = g_getenv("SPEECHD_ADDRESS"); gchar **pa; /* parsed address */ SPDConnectionAddress *address = malloc(sizeof(SPDConnectionAddress)); if (env_address == NULL) { // Default method = unix sockets address->method = SPD_METHOD_UNIX_SOCKET; address->unix_socket_name = _get_default_unix_socket_name(); } else { pa = g_strsplit(env_address, ":", 0); assert(pa); if (!g_strcmp0(pa[0], "unix_socket") || pa[0] == NULL) { // Unix sockets address->method = SPD_METHOD_UNIX_SOCKET; if (pa[1] == NULL) { address->unix_socket_name = _get_default_unix_socket_name(); } else { address->unix_socket_name = strdup(pa[1]); } } else if (!g_strcmp0(pa[0], "inet_socket")) { // Inet sockets address->method = SPD_METHOD_INET_SOCKET; if (pa[1] == NULL) { address->inet_socket_host = strdup("127.0.0.1"); address->inet_socket_port = 6560; } else { address->inet_socket_host = strdup(pa[1]); if (pa[2] == NULL) { address->inet_socket_port = SPEECHD_DEFAULT_PORT; } else { address->inet_socket_port = atoi(pa[2]); } } } else { // Unknown or unsupported method requested *error = strdup ("Unknown or unsupported communication method"); free(address); address = NULL; } g_strfreev(pa); } return address; } static void _init_debug(void) { #ifdef LIBSPEECHD_DEBUG if (!spd_debug) { spd_debug = fopen("/tmp/libspeechd.log", "w"); if (spd_debug == NULL) SPD_FATAL("COULDN'T ACCES FILE INTENDED FOR DEBUG"); if (pthread_mutex_init(&spd_logging_mutex, NULL)) { fprintf(stderr, "Mutex initialization failed"); fflush(stderr); exit(1); } SPD_DBG("Debugging started"); } #endif /* LIBSPEECHD_DEBUG */ } /* Opens a new Speech Dispatcher connection. * Returns socket file descriptor of the created connection * or -1 if no connection was opened. */ SPDConnection *spd_open(const char *client_name, const char *connection_name, const char *user_name, SPDConnectionMode mode) { char *error; int autospawn = 1; SPDConnection *conn; conn = spd_open2(client_name, connection_name, user_name, mode, NULL, autospawn, &error); if (!conn) { _init_debug(); assert(error); SPD_DBG("Could not connect to Speech Dispatcher: %s", error); xfree(error); } return conn; } #define MAX_IP_SIZE 16+1 /* TODO: This only works in IPV4 */ static char *resolve_host(char *host_name_or_ip, int *is_localhost, gchar ** error) { struct addrinfo *addr_result; int err; char *resolve_buffer = malloc(MAX_IP_SIZE * sizeof(char)); const char *resolved_ip = NULL; char *ip; *error = NULL; struct sockaddr_in *addr_in; if (resolve_buffer == NULL) { *error = g_strdup("Failed to allocate memory."); return NULL; } err = getaddrinfo(host_name_or_ip, 0, NULL, &addr_result); if (err) { *error = g_strdup_printf("Can't resolve address %d due to error %s:", err, gai_strerror(err)); xfree(resolve_buffer); return NULL; } /* Take the first address returned as we are only interested in host ip */ addr_in = (struct sockaddr_in *)addr_result->ai_addr; resolved_ip = inet_ntop(AF_INET, &(addr_in->sin_addr.s_addr), resolve_buffer, MAX_IP_SIZE); if (resolved_ip == NULL) { *error = g_strdup_printf ("Could not convert address, due to the following error: %s", strerror(errno)); freeaddrinfo(addr_result); xfree(resolve_buffer); return NULL; } if (!strncmp(resolved_ip, "127.", 4)) { *is_localhost = 1; /* In case of local addresses, use 127.0.0.1 which is guaranteed to be local and the server listens on it */ xfree(resolve_buffer); ip = strdup("127.0.0.1"); } else { *is_localhost = 0; ip = resolve_buffer; } freeaddrinfo(addr_result); return ip; } static int spawn_server(SPDConnectionAddress * address, int is_localhost, gchar ** spawn_error) { gchar **speechd_cmd = malloc(16 * sizeof(char *)); gchar *stderr_output; gboolean spawn_ok; GError *gerror = NULL; int exit_status; int i; if ((address->method == SPD_METHOD_INET_SOCKET) && (!is_localhost)) { *spawn_error = g_strdup ("Spawn failed, the given network address doesn't seem to be on localhost"); return 1; } speechd_cmd[0] = g_strdup(SPD_SPAWN_CMD); speechd_cmd[1] = g_strdup("--spawn"); speechd_cmd[2] = g_strdup("--communication-method"); if (address->method == SPD_METHOD_INET_SOCKET) { speechd_cmd[3] = g_strdup("inet_socket"); speechd_cmd[4] = g_strdup("--port"); speechd_cmd[5] = g_strdup_printf("%d", address->inet_socket_port); speechd_cmd[6] = NULL; } else if (address->method == SPD_METHOD_UNIX_SOCKET) { speechd_cmd[3] = g_strdup("unix_socket"); speechd_cmd[4] = g_strdup("--socket-path"); speechd_cmd[5] = g_strdup_printf("%s", address->unix_socket_name); speechd_cmd[6] = NULL; } else assert(0); spawn_ok = g_spawn_sync(NULL, (gchar **) speechd_cmd, NULL, G_SPAWN_SEARCH_PATH | G_SPAWN_STDOUT_TO_DEV_NULL, NULL, NULL, NULL, &stderr_output, &exit_status, &gerror); for (i = 0; speechd_cmd[i] != NULL; i++) g_free(speechd_cmd[i]); if (!spawn_ok) { *spawn_error = g_strdup_printf("Autospawn failed. Spawn error %d: %s", gerror->code, gerror->message); return 1; } else { if (exit_status) { *spawn_error = g_strdup_printf ("Autospawn failed. Speech Dispatcher refused to start with error code, " "stating this as a reason: %s", stderr_output); return 1; } else { *spawn_error = NULL; return 0; } } assert(0); } SPDConnection *spd_open2(const char *client_name, const char *connection_name, const char *user_name, SPDConnectionMode mode, SPDConnectionAddress * address, int autospawn, char **error_result) { SPDConnection *connection; char *set_client_name; char *conn_name; char *usr_name; int ret; char tcp_no_delay = 1; /* Autospawn related */ int spawn_err; gchar *spawn_report; char *host_ip; int is_localhost = 1; struct sockaddr_in address_inet; struct sockaddr_un address_unix; struct sockaddr *sock_address; size_t sock_address_len; gchar *resolve_error; _init_debug(); if (client_name == NULL) { *error_result = strdup("ERROR: Client name not specified"); SPD_DBG(*error_result); return NULL; } if (user_name == NULL) { usr_name = strdup((char *)g_get_user_name()); } else usr_name = strdup(user_name); if (connection_name == NULL) conn_name = strdup("main"); else conn_name = strdup(connection_name); if (address == NULL) { char *err = NULL; address = spd_get_default_address(&err); if (!address) { assert(err); *error_result = err; SPD_DBG(*error_result); return NULL; } } /* Connect to server using the selected method */ connection = xmalloc(sizeof(SPDConnection)); if (address->method == SPD_METHOD_INET_SOCKET) { host_ip = resolve_host(address->inet_socket_host, &is_localhost, &resolve_error); if (host_ip == NULL) { *error_result = strdup(resolve_error); g_free(resolve_error); return NULL; } address_inet.sin_addr.s_addr = inet_addr(host_ip); address_inet.sin_port = htons(address->inet_socket_port); address_inet.sin_family = AF_INET; connection->socket = socket(AF_INET, SOCK_STREAM, 0); sock_address = (struct sockaddr *)&address_inet; sock_address_len = sizeof(address_inet); } else if (address->method == SPD_METHOD_UNIX_SOCKET) { /* Create the unix socket */ address_unix.sun_family = AF_UNIX; strncpy(address_unix.sun_path, address->unix_socket_name, sizeof(address_unix.sun_path)); address_unix.sun_path[sizeof(address_unix.sun_path) - 1] = '\0'; connection->socket = socket(AF_UNIX, SOCK_STREAM, 0); sock_address = (struct sockaddr *)&address_unix; sock_address_len = SUN_LEN(&address_unix); } else SPD_FATAL("Unsupported connection method for spd_open2()"); ret = connect(connection->socket, sock_address, sock_address_len); if (ret == -1) { /* Suppose server might not be running, try to autospawn (autostart) it */ if (autospawn) { spawn_err = spawn_server(address, is_localhost, &spawn_report); if (!spawn_err) spawn_report = g_strdup("Server successfully autospawned"); ret = connect(connection->socket, sock_address, sock_address_len); } else { spawn_report = g_strdup("Autospawn disabled"); } if (ret == -1) { if (address->method == SPD_METHOD_INET_SOCKET) *error_result = g_strdup_printf ("Error: Can't connect to %s on port %d using inet sockets: %s. " "Autospawn: %s", address->inet_socket_host, address->inet_socket_port, strerror(errno), spawn_report); else if (address->method == SPD_METHOD_UNIX_SOCKET) *error_result = g_strdup_printf ("Error: Can't connect to unix socket %s: %s. Autospawn: %s", address->unix_socket_name, strerror(errno), spawn_report); else assert(0); SPD_DBG(*error_result); close(connection->socket); return NULL; } } if (address->method == SPD_METHOD_INET_SOCKET) setsockopt(connection->socket, IPPROTO_TCP, TCP_NODELAY, &tcp_no_delay, sizeof(int)); connection->callback_begin = NULL; connection->callback_end = NULL; connection->callback_im = NULL; connection->callback_pause = NULL; connection->callback_resume = NULL; connection->callback_cancel = NULL; connection->mode = mode; /* Create a stream from the socket */ connection->stream = fdopen(connection->socket, "r"); if (!connection->stream) SPD_FATAL("Can't create a stream for socket, fdopen() failed."); /* Switch to line buffering mode */ ret = setvbuf(connection->stream, NULL, _IONBF, SPD_REPLY_BUF_SIZE); if (ret) SPD_FATAL("Can't set buffering, setvbuf failed."); connection->ssip_mutex = xmalloc(sizeof(pthread_mutex_t)); pthread_mutex_init(connection->ssip_mutex, NULL); if (mode == SPD_MODE_THREADED) { SPD_DBG ("Initializing threads, condition variables and mutexes..."); connection->events_thread = xmalloc(sizeof(pthread_t)); connection->cond_reply_ready = xmalloc(sizeof(pthread_cond_t)); connection->mutex_reply_ready = xmalloc(sizeof(pthread_mutex_t)); connection->cond_reply_ack = xmalloc(sizeof(pthread_cond_t)); connection->mutex_reply_ack = xmalloc(sizeof(pthread_mutex_t)); pthread_cond_init(connection->cond_reply_ready, NULL); pthread_mutex_init(connection->mutex_reply_ready, NULL); pthread_cond_init(connection->cond_reply_ack, NULL); pthread_mutex_init(connection->mutex_reply_ack, NULL); ret = pthread_create(connection->events_thread, NULL, spd_events_handler, connection); if (ret != 0) { *error_result = strdup("Thread initialization failed"); SPD_DBG(*error_result); return NULL; } } /* By now, the connection is created and operational */ set_client_name = g_strdup_printf("SET SELF CLIENT_NAME \"%s:%s:%s\"", usr_name, client_name, conn_name); ret = spd_execute_command_wo_mutex(connection, set_client_name); xfree(usr_name); xfree(conn_name); xfree(set_client_name); return connection; } #define RET(r) \ { \ pthread_mutex_unlock(connection->ssip_mutex); \ return r; \ } /* Close a Speech Dispatcher connection */ void spd_close(SPDConnection * connection) { pthread_mutex_lock(connection->ssip_mutex); if (connection->mode == SPD_MODE_THREADED) { pthread_cancel(*connection->events_thread); pthread_mutex_destroy(connection->mutex_reply_ready); pthread_mutex_destroy(connection->mutex_reply_ack); pthread_cond_destroy(connection->cond_reply_ready); pthread_cond_destroy(connection->cond_reply_ack); pthread_join(*connection->events_thread, NULL); connection->mode = SPD_MODE_SINGLE; } /* close the socket */ close(connection->socket); pthread_mutex_unlock(connection->ssip_mutex); pthread_mutex_destroy(connection->ssip_mutex); xfree(connection); } /* Helper functions for spd_say. */ static inline int spd_say_prepare(SPDConnection * connection, SPDPriority priority, const char *text, char **escaped_text) { int ret = 0; SPD_DBG("Text to say is: %s", text); /* Insure that there is no escape sequence in the text */ *escaped_text = escape_dot(text); /* Caller is now responsible for escaped_text. */ if (*escaped_text == NULL) { /* Out of memory. */ SPD_DBG("spd_say could not allocate memory."); ret = -1; } else { /* Set priority */ SPD_DBG("Setting priority"); ret = spd_set_priority(connection, priority); if (!ret) { /* Start the data flow */ SPD_DBG("Sending SPEAK"); ret = spd_execute_command_wo_mutex(connection, "speak"); if (ret) { SPD_DBG("Error: Can't start data flow!"); } } } return ret; } static inline int spd_say_sending(SPDConnection * connection, const char *text) { int msg_id = -1; int err = 0; char *reply = NULL; char *pret = NULL; /* Send data */ SPD_DBG("Sending data"); pret = spd_send_data_wo_mutex(connection, text, SPD_NO_REPLY); if (pret == NULL) { SPD_DBG("Can't send data wo mutex"); } else { /* Terminate data flow */ SPD_DBG("Terminating data flow"); err = spd_execute_command_with_reply(connection, "\r\n.", &reply); if (err) { SPD_DBG("Can't terminate data flow"); } else { msg_id = get_param_int(reply, 1, &err); if (err < 0) { SPD_DBG ("Can't determine SSIP message unique ID parameter."); msg_id = -1; } } } xfree(reply); xfree(pret); return msg_id; } /* Say TEXT with priority PRIORITY. * Returns msg_uid on success, -1 otherwise. */ int spd_say(SPDConnection * connection, SPDPriority priority, const char *text) { char *escaped_text = NULL; int msg_id = -1; int prepare_failed = 0; if (text != NULL) { pthread_mutex_lock(connection->ssip_mutex); prepare_failed = spd_say_prepare(connection, priority, text, &escaped_text); if (!prepare_failed) msg_id = spd_say_sending(connection, escaped_text); xfree(escaped_text); pthread_mutex_unlock(connection->ssip_mutex); } else { SPD_DBG("spd_say called with a NULL argument for "); } SPD_DBG("Returning from spd_say"); return msg_id; } /* The same as spd_say, accepts also formated strings */ int spd_sayf(SPDConnection * connection, SPDPriority priority, const char *format, ...) { static int ret; va_list args; char *buf; if (format == NULL) return -1; /* Print the text to buffer */ va_start(args, format); buf = g_strdup_vprintf(format, args); va_end(args); /* Send the buffer to Speech Dispatcher */ ret = spd_say(connection, priority, buf); xfree(buf); return ret; } int spd_stop(SPDConnection * connection) { return spd_execute_command(connection, "STOP SELF"); } int spd_stop_all(SPDConnection * connection) { return spd_execute_command(connection, "STOP ALL"); } int spd_stop_uid(SPDConnection * connection, int target_uid) { static char command[16]; sprintf(command, "STOP %d", target_uid); return spd_execute_command(connection, command); } int spd_cancel(SPDConnection * connection) { return spd_execute_command(connection, "CANCEL SELF"); } int spd_cancel_all(SPDConnection * connection) { return spd_execute_command(connection, "CANCEL ALL"); } int spd_cancel_uid(SPDConnection * connection, int target_uid) { static char command[16]; sprintf(command, "CANCEL %d", target_uid); return spd_execute_command(connection, command); } int spd_pause(SPDConnection * connection) { return spd_execute_command(connection, "PAUSE SELF"); } int spd_pause_all(SPDConnection * connection) { return spd_execute_command(connection, "PAUSE ALL"); } int spd_pause_uid(SPDConnection * connection, int target_uid) { char command[16]; sprintf(command, "PAUSE %d", target_uid); return spd_execute_command(connection, command); } int spd_resume(SPDConnection * connection) { return spd_execute_command(connection, "RESUME SELF"); } int spd_resume_all(SPDConnection * connection) { return spd_execute_command(connection, "RESUME ALL"); } int spd_resume_uid(SPDConnection * connection, int target_uid) { static char command[16]; sprintf(command, "RESUME %d", target_uid); return spd_execute_command(connection, command); } int spd_key(SPDConnection * connection, SPDPriority priority, const char *key_name) { char *command_key; int ret; if (key_name == NULL) return -1; pthread_mutex_lock(connection->ssip_mutex); ret = spd_set_priority(connection, priority); if (ret) RET(-1); command_key = g_strdup_printf("KEY %s", key_name); ret = spd_execute_command_wo_mutex(connection, command_key); xfree(command_key); if (ret) RET(-1); pthread_mutex_unlock(connection->ssip_mutex); return 0; } int spd_char(SPDConnection * connection, SPDPriority priority, const char *character) { static char command[16]; int ret; if (character == NULL) return -1; if (strlen(character) > 6) return -1; pthread_mutex_lock(connection->ssip_mutex); ret = spd_set_priority(connection, priority); if (ret) RET(-1); sprintf(command, "CHAR %s", character); ret = spd_execute_command_wo_mutex(connection, command); if (ret) RET(-1); pthread_mutex_unlock(connection->ssip_mutex); return 0; } int spd_wchar(SPDConnection * connection, SPDPriority priority, wchar_t wcharacter) { static char command[16]; char character[8]; int ret; pthread_mutex_lock(connection->ssip_mutex); ret = wcrtomb(character, wcharacter, NULL); if (ret <= 0) RET(-1); ret = spd_set_priority(connection, priority); if (ret) RET(-1); assert(character != NULL); sprintf(command, "CHAR %s", character); ret = spd_execute_command_wo_mutex(connection, command); if (ret) RET(-1); pthread_mutex_unlock(connection->ssip_mutex); return 0; } int spd_sound_icon(SPDConnection * connection, SPDPriority priority, const char *icon_name) { char *command; int ret; if (icon_name == NULL) return -1; pthread_mutex_lock(connection->ssip_mutex); ret = spd_set_priority(connection, priority); if (ret) RET(-1); command = g_strdup_printf("SOUND_ICON %s", icon_name); ret = spd_execute_command_wo_mutex(connection, command); xfree(command); if (ret) RET(-1); pthread_mutex_unlock(connection->ssip_mutex); return 0; } int spd_w_set_punctuation(SPDConnection * connection, SPDPunctuation type, const char *who) { char command[32]; int ret; if (type == SPD_PUNCT_ALL) sprintf(command, "SET %s PUNCTUATION all", who); if (type == SPD_PUNCT_NONE) sprintf(command, "SET %s PUNCTUATION none", who); if (type == SPD_PUNCT_SOME) sprintf(command, "SET %s PUNCTUATION some", who); ret = spd_execute_command(connection, command); return ret; } int spd_w_set_capital_letters(SPDConnection * connection, SPDCapitalLetters type, const char *who) { char command[64]; int ret; if (type == SPD_CAP_NONE) sprintf(command, "SET %s CAP_LET_RECOGN none", who); if (type == SPD_CAP_SPELL) sprintf(command, "SET %s CAP_LET_RECOGN spell", who); if (type == SPD_CAP_ICON) sprintf(command, "SET %s CAP_LET_RECOGN icon", who); ret = spd_execute_command(connection, command); return ret; } int spd_w_set_spelling(SPDConnection * connection, SPDSpelling type, const char *who) { char command[32]; int ret; if (type == SPD_SPELL_ON) sprintf(command, "SET %s SPELLING on", who); if (type == SPD_SPELL_OFF) sprintf(command, "SET %s SPELLING off", who); ret = spd_execute_command(connection, command); return ret; } int spd_set_data_mode(SPDConnection * connection, SPDDataMode mode) { char command[32]; int ret; if (mode == SPD_DATA_TEXT) sprintf(command, "SET SELF SSML_MODE off"); if (mode == SPD_DATA_SSML) sprintf(command, "SET SELF SSML_MODE on"); ret = spd_execute_command(connection, command); return ret; } int spd_w_set_voice_type(SPDConnection * connection, SPDVoiceType type, const char *who) { static char command[64]; switch (type) { case SPD_MALE1: sprintf(command, "SET %s VOICE MALE1", who); break; case SPD_MALE2: sprintf(command, "SET %s VOICE MALE2", who); break; case SPD_MALE3: sprintf(command, "SET %s VOICE MALE3", who); break; case SPD_FEMALE1: sprintf(command, "SET %s VOICE FEMALE1", who); break; case SPD_FEMALE2: sprintf(command, "SET %s VOICE FEMALE2", who); break; case SPD_FEMALE3: sprintf(command, "SET %s VOICE FEMALE3", who); break; case SPD_CHILD_MALE: sprintf(command, "SET %s VOICE CHILD_MALE", who); break; case SPD_CHILD_FEMALE: sprintf(command, "SET %s VOICE CHILD_FEMALE", who); break; default: return -1; } return spd_execute_command(connection, command); } #define SPD_SET_COMMAND_INT(param, ssip_name, condition) \ int \ spd_w_set_ ## param (SPDConnection *connection, signed int val, const char* who) \ { \ static char command[64]; \ if ((!condition)) return -1; \ sprintf(command, "SET %s " #ssip_name " %d", who, val); \ return spd_execute_command(connection, command); \ } \ int \ spd_set_ ## param (SPDConnection *connection, signed int val) \ { \ return spd_w_set_ ## param (connection, val, "SELF"); \ } \ int \ spd_set_ ## param ## _all(SPDConnection *connection, signed int val) \ { \ return spd_w_set_ ## param (connection, val, "ALL"); \ } \ int \ spd_set_ ## param ## _uid(SPDConnection *connection, signed int val, unsigned int uid) \ { \ char who[8]; \ sprintf(who, "%d", uid); \ return spd_w_set_ ## param (connection, val, who); \ } #define SPD_SET_COMMAND_STR(param, ssip_name) \ int \ spd_w_set_ ## param (SPDConnection *connection, const char *str, const char* who) \ { \ char *command; \ int ret; \ if (str == NULL) return -1; \ command = g_strdup_printf("SET %s " #param " %s", \ who, str); \ ret = spd_execute_command(connection, command); \ xfree(command); \ return ret; \ } \ int \ spd_set_ ## param (SPDConnection *connection, const char *str) \ { \ return spd_w_set_ ## param (connection, str, "SELF"); \ } \ int \ spd_set_ ## param ## _all(SPDConnection *connection, const char *str) \ { \ return spd_w_set_ ## param (connection, str, "ALL"); \ } \ int \ spd_set_ ## param ## _uid(SPDConnection *connection, const char *str, unsigned int uid) \ { \ char who[8]; \ sprintf(who, "%d", uid); \ return spd_w_set_ ## param (connection, str, who); \ } #define SPD_SET_COMMAND_SPECIAL(param, type) \ int \ spd_set_ ## param (SPDConnection *connection, type val) \ { \ return spd_w_set_ ## param (connection, val, "SELF"); \ } \ int \ spd_set_ ## param ## _all(SPDConnection *connection, type val) \ { \ return spd_w_set_ ## param (connection, val, "ALL"); \ } \ int \ spd_set_ ## param ## _uid(SPDConnection *connection, type val, unsigned int uid) \ { \ char who[8]; \ sprintf(who, "%d", uid); \ return spd_w_set_ ## param (connection, val, who); \ } SPD_SET_COMMAND_INT(voice_rate, RATE, ((val >= -100) && (val <= +100))) SPD_SET_COMMAND_INT(voice_pitch, PITCH, ((val >= -100) && (val <= +100))) SPD_SET_COMMAND_INT(volume, VOLUME, ((val >= -100) && (val <= +100))) SPD_SET_COMMAND_STR(language, LANGUAGE) SPD_SET_COMMAND_STR(output_module, OUTPUT_MODULE) SPD_SET_COMMAND_STR(synthesis_voice, SYNTHESIS_VOICE) SPD_SET_COMMAND_SPECIAL(punctuation, SPDPunctuation) SPD_SET_COMMAND_SPECIAL(capital_letters, SPDCapitalLetters) SPD_SET_COMMAND_SPECIAL(spelling, SPDSpelling) SPD_SET_COMMAND_SPECIAL(voice_type, SPDVoiceType) #undef SPD_SET_COMMAND_INT #undef SPD_SET_COMMAND_STR #undef SPD_SET_COMMAND_SPECIAL int spd_set_notification_on(SPDConnection * connection, SPDNotification notification) { if (connection->mode == SPD_MODE_THREADED) return spd_set_notification(connection, notification, "on"); else return -1; } int spd_set_notification_off(SPDConnection * connection, SPDNotification notification) { if (connection->mode == SPD_MODE_THREADED) return spd_set_notification(connection, notification, "off"); else return -1; } #define NOTIFICATION_SET(val, ssip_val) \ if (notification & val){ \ sprintf(command, "SET SELF NOTIFICATION "ssip_val" %s", state);\ ret = spd_execute_command_wo_mutex(connection, command);\ if (ret < 0) RET(-1);\ } int spd_set_notification(SPDConnection * connection, SPDNotification notification, const char *state) { static char command[64]; int ret; if (connection->mode != SPD_MODE_THREADED) return -1; if (state == NULL) { SPD_DBG("Requested state is NULL"); return -1; } if (strcmp(state, "on") && strcmp(state, "off")) { SPD_DBG("Invalid argument for spd_set_notification: %s", state); return -1; } pthread_mutex_lock(connection->ssip_mutex); NOTIFICATION_SET(SPD_INDEX_MARKS, "index_marks"); NOTIFICATION_SET(SPD_BEGIN, "begin"); NOTIFICATION_SET(SPD_END, "end"); NOTIFICATION_SET(SPD_CANCEL, "cancel"); NOTIFICATION_SET(SPD_PAUSE, "pause"); NOTIFICATION_SET(SPD_RESUME, "resume"); NOTIFICATION_SET(SPD_ALL, "all"); pthread_mutex_unlock(connection->ssip_mutex); return 0; } #undef NOTIFICATION_SET /* spd_list_modules retrieves information about the available output modules. The return value is a null-terminated array of strings containing output module names. */ char **spd_list_modules(SPDConnection * connection) { char **available_modules; available_modules = spd_execute_command_with_list_reply(connection, "LIST OUTPUT_MODULES"); return available_modules; } char **spd_list_voices(SPDConnection * connection) { char **voices; voices = spd_execute_command_with_list_reply(connection, "LIST VOICES"); return voices; } SPDVoice **spd_list_synthesis_voices(SPDConnection * connection) { char **svoices_str; SPDVoice **svoices; int i, num_items; svoices_str = spd_execute_command_with_list_reply(connection, "LIST SYNTHESIS_VOICES"); if (svoices_str == NULL) return NULL; for (i = 0;; i++) if (svoices_str[i] == NULL) break; num_items = i; svoices = (SPDVoice **) malloc((num_items + 1) * sizeof(SPDVoice *)); for (i = 0; i <= num_items; i++) { const char delimiters[] = " "; char *running; if (svoices_str[i] == NULL) break; running = strdup(svoices_str[i]); svoices[i] = (SPDVoice *) malloc(sizeof(SPDVoice)); svoices[i]->name = strsep(&running, delimiters); svoices[i]->language = strsep(&running, delimiters); svoices[i]->variant = strsep(&running, delimiters); assert(svoices[i]->name != NULL); } svoices[num_items] = NULL; return svoices; } char **spd_execute_command_with_list_reply(SPDConnection * connection, char *command) { char *reply = NULL, *line; int err; int max_items = 50; char **result; int i, ret; ret = spd_execute_command_with_reply(connection, command, &reply); if (!ret_ok(reply)) { if (reply != NULL) free(reply); return NULL; } result = malloc((max_items + 1) * sizeof(char *)); for (i = 0;; i++) { line = get_param_str(reply, i + 1, &err); if ((err) || (line == NULL)) break; result[i] = strdup(line); if (i >= max_items - 2) { max_items *= 2; result = realloc(result, max_items * sizeof(char *)); } } result[i] = NULL; free(reply); return result; } //int //spd_get_client_list(SPDConnection *connection, char **client_names, int *client_ids, int* active){ // SPD_DBG("spd_get_client_list: History is not yet implemented."); // return -1; // //} int spd_get_message_list_fd(SPDConnection * connection, int target, int *msg_ids, char **client_names) { SPD_DBG("spd_get_client_list: History is not yet implemented."); return -1; #if 0 sprintf(command, "HISTORY GET MESSAGE_LIST %d 0 20\r\n", target); reply = spd_send_data(fd, command, 1); /* header_ok = parse_response_header(reply); if(header_ok != 1){ free(reply); return -1; }*/ for (count = 0;; count++) { record = (char *)parse_response_data(reply, count + 1); if (record == NULL) break; record_int = get_rec_int(record, 0); msg_ids[count] = record_int; record_str = (char *)get_rec_str(record, 1); assert(record_str != NULL); client_names[count] = record_str; } return count; #endif } int spd_execute_command(SPDConnection * connection, char *command) { char *reply; int ret; pthread_mutex_lock(connection->ssip_mutex); ret = spd_execute_command_with_reply(connection, command, &reply); if (ret) { SPD_DBG("Can't execute command in spd_execute_command"); } xfree(reply); pthread_mutex_unlock(connection->ssip_mutex); return ret; } int spd_execute_command_wo_mutex(SPDConnection * connection, char *command) { char *reply; int ret; SPD_DBG("Executing command wo_mutex"); ret = spd_execute_command_with_reply(connection, command, &reply); if (ret) SPD_DBG ("Can't execute command in spd_execute_command_wo_mutex"); xfree(reply); return ret; } int spd_execute_command_with_reply(SPDConnection * connection, char *command, char **reply) { char *buf; int r; SPD_DBG("Inside execute_command_with_reply"); buf = g_strdup_printf("%s\r\n", command); *reply = spd_send_data_wo_mutex(connection, buf, SPD_WAIT_REPLY); xfree(buf); buf = NULL; if (*reply == NULL) { SPD_DBG ("Can't send data wo mutex in spd_execute_command_with_reply"); return -1; } r = ret_ok(*reply); if (!r) return -1; else return 0; } char *spd_send_data(SPDConnection * connection, const char *message, int wfr) { char *reply; pthread_mutex_lock(connection->ssip_mutex); if (connection->stream == NULL) RET(NULL); reply = spd_send_data_wo_mutex(connection, message, wfr); if (reply == NULL) { SPD_DBG("Can't send data wo mutex in spd_send_data"); RET(NULL); } pthread_mutex_unlock(connection->ssip_mutex); return reply; } char *spd_send_data_wo_mutex(SPDConnection * connection, const char *message, int wfr) { char *reply; int bytes; SPD_DBG("Inside spd_send_data_wo_mutex"); if (connection->stream == NULL) return NULL; if (connection->mode == SPD_MODE_THREADED) { /* Make sure we don't get the cond_reply_ready signal before we are in cond_wait() */ pthread_mutex_lock(connection->mutex_reply_ready); } /* write message to the socket */ SPD_DBG("Writing to socket"); if (!write(connection->socket, message, strlen(message))) { SPD_DBG("Can't write to socket: %s", strerror(errno)); pthread_mutex_unlock(connection->mutex_reply_ready); return NULL; } SPD_DBG("Written to socket"); SPD_DBG(">> : |%s|", message); /* read reply to the buffer */ if (wfr) { if (connection->mode == SPD_MODE_THREADED) { /* Wait until the reply is ready */ SPD_DBG ("Waiting for cond_reply_ready in spd_send_data_wo_mutex"); pthread_cond_wait(connection->cond_reply_ready, connection->mutex_reply_ready); SPD_DBG("Condition for cond_reply_ready satisfied"); pthread_mutex_unlock(connection->mutex_reply_ready); SPD_DBG ("Reading the reply in spd_send_data_wo_mutex threaded mode"); /* Read the reply */ if (connection->reply != NULL) { reply = strdup(connection->reply); } else { SPD_DBG ("Error: Can't read reply, broken socket in spd_send_data."); return NULL; } xfree(connection->reply); bytes = strlen(reply); if (bytes == 0) { SPD_DBG("Error: Empty reply, broken socket."); return NULL; } /* Signal the reply has been read */ pthread_mutex_lock(connection->mutex_reply_ack); pthread_cond_signal(connection->cond_reply_ack); pthread_mutex_unlock(connection->mutex_reply_ack); } else { reply = get_reply(connection); } if (reply != NULL) SPD_DBG("<< : |%s|\n", reply); } else { if (connection->mode == SPD_MODE_THREADED) pthread_mutex_unlock(connection->mutex_reply_ready); SPD_DBG("<< : no reply expected"); return strdup("NO REPLY"); } if (reply == NULL) SPD_DBG ("Reply from get_reply is NULL in spd_send_data_wo_mutex"); SPD_DBG("Returning from spd_send_data_wo_mutex"); return reply; } /* --------------------- Internal functions ------------------------- */ static int spd_set_priority(SPDConnection * connection, SPDPriority priority) { static char p_name[16]; static char command[64]; switch (priority) { case SPD_IMPORTANT: strcpy(p_name, "IMPORTANT"); break; case SPD_MESSAGE: strcpy(p_name, "MESSAGE"); break; case SPD_TEXT: strcpy(p_name, "TEXT"); break; case SPD_NOTIFICATION: strcpy(p_name, "NOTIFICATION"); break; case SPD_PROGRESS: strcpy(p_name, "PROGRESS"); break; default: SPD_DBG("Error: Can't set priority! Incorrect value."); return -1; } sprintf(command, "SET SELF PRIORITY %s", p_name); return spd_execute_command_wo_mutex(connection, command); } static char *get_reply(SPDConnection * connection) { GString *str; char *line = NULL; size_t N = 0; int bytes; char *reply; gboolean errors = FALSE; str = g_string_new(""); /* Wait for activity on the socket, when there is some, read all the message line by line */ do { bytes = getline(&line, &N, connection->stream); if (bytes == -1) { SPD_DBG ("Error: Can't read reply, broken socket in get_reply!"); if (connection->stream != NULL) fclose(connection->stream); connection->stream = NULL; errors = TRUE; } else { g_string_append(str, line); } /* terminate if we reached the last line (without '-' after numcode) */ } while (!errors && !((strlen(line) < 4) || (line[3] == ' '))); xfree(line); /* getline allocates with malloc. */ if (errors) { /* Free the GString and its character data, and return NULL. */ g_string_free(str, TRUE); reply = NULL; } else { /* The resulting message received from the socket is stored in reply */ reply = str->str; /* Free the GString, but not its character data. */ g_string_free(str, FALSE); } return reply; } static void *spd_events_handler(void *conn) { char *reply; int reply_code; SPDConnection *connection = conn; while (1) { /* Read the reply/event (block if none is available) */ SPD_DBG("Getting reply in spd_events_handler"); reply = get_reply(connection); if (reply == NULL) { SPD_DBG("ERROR: BROKEN SOCKET"); reply_code = -1; } else { SPD_DBG("<< : |%s|\n", reply); reply_code = get_err_code(reply); } if ((reply_code >= 700) && (reply_code < 800)) { int msg_id; int client_id; int err; SPD_DBG("Callback detected: %s", reply); /* This is an index mark */ /* Extract message id */ msg_id = get_param_int(reply, 1, &err); if (err < 0) { SPD_DBG ("Bad reply from Speech Dispatcher: %s (code %d)", reply, err); break; } client_id = get_param_int(reply, 2, &err); if (err < 0) { SPD_DBG ("Bad reply from Speech Dispatcher: %s (code %d)", reply, err); break; } /* Decide if we want to call a callback */ if ((reply_code == 701) && (connection->callback_begin)) connection->callback_begin(msg_id, client_id, SPD_EVENT_BEGIN); if ((reply_code == 702) && (connection->callback_end)) connection->callback_end(msg_id, client_id, SPD_EVENT_END); if ((reply_code == 703) && (connection->callback_cancel)) connection->callback_cancel(msg_id, client_id, SPD_EVENT_CANCEL); if ((reply_code == 704) && (connection->callback_pause)) connection->callback_pause(msg_id, client_id, SPD_EVENT_PAUSE); if ((reply_code == 705) && (connection->callback_resume)) connection->callback_resume(msg_id, client_id, SPD_EVENT_RESUME); if ((reply_code == 700) && (connection->callback_im)) { char *im; int err; im = get_param_str(reply, 3, &err); if ((err < 0) || (im == NULL)) { SPD_DBG ("Broken reply from Speech Dispatcher: %s", reply); break; } /* Call the callback */ connection->callback_im(msg_id, client_id, SPD_EVENT_INDEX_MARK, im); xfree(im); } } else { /* This is a protocol reply */ pthread_mutex_lock(connection->mutex_reply_ready); /* Prepare the reply to the reply buffer in connection */ if (reply != NULL) { connection->reply = strdup(reply); } else { SPD_DBG("Connection reply is NULL"); connection->reply = NULL; break; } /* Signal the reply is available on the condition variable */ /* this order is correct and necessary */ pthread_cond_signal(connection->cond_reply_ready); pthread_mutex_lock(connection->mutex_reply_ack); pthread_mutex_unlock(connection->mutex_reply_ready); /* Wait until it has bean read */ pthread_cond_wait(connection->cond_reply_ack, connection->mutex_reply_ack); pthread_mutex_unlock(connection->mutex_reply_ack); xfree(reply); /* Continue */ } } /* In case of broken socket, we must still signal reply ready */ if (connection->reply == NULL) { SPD_DBG("Signalling reply ready after communication failure"); pthread_mutex_unlock(connection->mutex_reply_ready); pthread_mutex_unlock(connection->mutex_reply_ack); if (connection->stream != NULL) fclose(connection->stream); connection->stream = NULL; pthread_cond_signal(connection->cond_reply_ready); pthread_exit(0); } return 0; /* to please gcc */ } static int ret_ok(char *reply) { int err; if (reply == NULL) return -1; err = get_err_code(reply); if ((err >= 100) && (err < 300)) return 1; if (err >= 300) return 0; SPD_FATAL("Internal error during communication."); } static char *get_param_str(char *reply, int num, int *err) { int i; char *tptr; char *pos; char *pos_begin; char *pos_end; char *rep; assert(err != NULL); if (num < 1) { *err = -1; return NULL; } pos = reply; for (i = 0; i <= num - 2; i++) { pos = strstr(pos, "\r\n"); if (pos == NULL) { *err = -2; return NULL; } pos += 2; } if (strlen(pos) < 4) return NULL; *err = strtol(pos, &tptr, 10); if (*err >= 300 && *err <= 399) return NULL; if ((*tptr != '-') || (tptr != pos + 3)) { *err = -3; return NULL; } pos_begin = pos + 4; pos_end = strstr(pos_begin, "\r\n"); if (pos_end == NULL) { *err = -4; return NULL; } rep = (char *)strndup(pos_begin, pos_end - pos_begin); *err = 0; return rep; } static int get_param_int(char *reply, int num, int *err) { char *rep_str; char *tptr; int ret; rep_str = get_param_str(reply, num, err); if (rep_str == NULL) { /* err is already set to the error return code, just return */ return 0; } ret = strtol(rep_str, &tptr, 10); if (*tptr != '\0') { /* this is not a number */ *err = -3; return 0; } xfree(rep_str); return ret; } static int get_err_code(char *reply) { char err_code[4]; int err; if (reply == NULL) return -1; SPD_DBG("spd_send_data: reply: %s\n", reply); err_code[0] = reply[0]; err_code[1] = reply[1]; err_code[2] = reply[2]; err_code[3] = '\0'; SPD_DBG("ret_ok: err_code: |%s|\n", err_code); if (isanum(err_code)) { err = atoi(err_code); } else { SPD_DBG("ret_ok: not a number\n"); return -1; } return err; } /* isanum() tests if the given string is a number, * returns 1 if yes, 0 otherwise. */ static int isanum(char *str) { int i; if (str == NULL) return 0; for (i = 0; i <= strlen(str) - 1; i++) { if (!isdigit(str[i])) return 0; } return 1; } static void *xmalloc(size_t bytes) { void *mem; mem = malloc(bytes); if (mem == NULL) { SPD_FATAL("Not enough memmory!"); exit(1); } return mem; } static void xfree(void *ptr) { if (ptr != NULL) free(ptr); } /* * escape_dot: Replace . with .. at the start of lines. * @text: text to escape * @Returns: An allocated string, containing the escaped text. */ static char *escape_dot(const char *text) { size_t orig_len = 0; const char *orig_end; char *result = NULL; char *result_ptr; static const char *ESCAPED_DOTLINE = "\r\n.."; static const size_t ESCAPED_DOTLINELEN = 4; static const size_t DOTLINELEN = 3; if (text == NULL) return NULL; orig_len = strlen(text); orig_end = text + orig_len; result = malloc((orig_len * 2 + 1) * sizeof(char)); if (result == NULL) return NULL; result_ptr = result; /* We're over-allocating. Even if we replaced every character * in text with "..", the length of the escaped string can be no more * than orig_len * 2. We could tighten that upper bound with * a little more work. */ if ((orig_len >= 1) && (text[0] == '.')) { *(result_ptr++) = '.'; *(result_ptr++) = '.'; text += 1; } while (text < orig_end) { if ((text[0] == '\r') && (text[1] == '\n') && (text[2] == '.')) { memcpy(result_ptr, ESCAPED_DOTLINE, ESCAPED_DOTLINELEN); result_ptr += ESCAPED_DOTLINELEN; text += DOTLINELEN; } else { *(result_ptr++) = *(text++); } } *result_ptr = '\0'; return result; } #ifdef LIBSPEECHD_DEBUG static void SPD_DBG(char *format, ...) { va_list args; pthread_mutex_lock(&spd_logging_mutex); va_start(args, format); vfprintf(spd_debug, format, args); va_end(args); fprintf(spd_debug, "\n"); fflush(spd_debug); pthread_mutex_unlock(&spd_logging_mutex); } #else /* LIBSPEECHD_DEBUG */ static void SPD_DBG(char *format, ...) { } #endif /* LIBSPEECHD_DEBUG */ speech-dispatcher-0.8/src/api/c/Makefile.am0000664000175000017500000000075011777240701015525 00000000000000## Process this file with automake to produce Makefile.in spdinclude_HEADERS = libspeechd.h inc_local = -I$(top_srcdir)/include/ lib_LTLIBRARIES = libspeechd.la libspeechd_la_SOURCES = libspeechd.c libspeechd_la_CFLAGS = $(ERROR_CFLAGS) libspeechd_la_CPPFLAGS = $(inc_local) -D_GNU_SOURCE $(GLIB_CFLAGS) -DSPD_SPAWN_CMD=\""$(prefix)/bin/speech-dispatcher"\" libspeechd_la_LDFLAGS = -version-info $(LIB_SPD_CURRENT):$(LIB_SPD_REVISION):$(LIB_SPD_AGE) libspeechd_la_LIBADD = $(GLIB_LIBS) speech-dispatcher-0.8/src/api/c/Makefile.in0000664000175000017500000005417512113401437015536 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/api/c DIST_COMMON = $(spdinclude_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(spdincludedir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = libspeechd_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_libspeechd_la_OBJECTS = libspeechd_la-libspeechd.lo libspeechd_la_OBJECTS = $(am_libspeechd_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent libspeechd_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libspeechd_la_CFLAGS) \ $(CFLAGS) $(libspeechd_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(libspeechd_la_SOURCES) DIST_SOURCES = $(libspeechd_la_SOURCES) HEADERS = $(spdinclude_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOTCONF_CFLAGS = @DOTCONF_CFLAGS@ DOTCONF_LIBS = @DOTCONF_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ EXTRA_ESPEAK_LIBS = @EXTRA_ESPEAK_LIBS@ EXTRA_SOCKET_LIBS = @EXTRA_SOCKET_LIBS@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GMODULE_CFLAGS = @GMODULE_CFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTHREAD_CFLAGS = @GTHREAD_CFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBAO_CFLAGS = @LIBAO_CFLAGS@ LIBAO_LIBS = @LIBAO_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_SPD_AGE = @LIB_SPD_AGE@ LIB_SPD_CURRENT = @LIB_SPD_CURRENT@ LIB_SPD_REVISION = @LIB_SPD_REVISION@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NAS_LIBS = @NAS_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ PULSE_CFLAGS = @PULSE_CFLAGS@ PULSE_LIBS = @PULSE_LIBS@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RDYNAMIC = @RDYNAMIC@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SNDFILE_CFLAGS = @SNDFILE_CFLAGS@ SNDFILE_LIBS = @SNDFILE_LIBS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ audio_dlopen_modules = @audio_dlopen_modules@ audiodir = @audiodir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ clientconfdir = @clientconfdir@ clientconforigdir = @clientconforigdir@ datadir = @datadir@ datarootdir = @datarootdir@ default_audio_method = @default_audio_method@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ flite_basic = @flite_basic@ flite_kal = @flite_kal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ ibmtts_include = @ibmtts_include@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ modulebindir = @modulebindir@ moduleconfdir = @moduleconfdir@ moduleconforigdir = @moduleconforigdir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ snddatadir = @snddatadir@ spdconfdir = @spdconfdir@ spdconforigdir = @spdconforigdir@ spddesktopconforigdir = @spddesktopconforigdir@ spdincludedir = @spdincludedir@ spdlibdir = @spdlibdir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ spdinclude_HEADERS = libspeechd.h inc_local = -I$(top_srcdir)/include/ lib_LTLIBRARIES = libspeechd.la libspeechd_la_SOURCES = libspeechd.c libspeechd_la_CFLAGS = $(ERROR_CFLAGS) libspeechd_la_CPPFLAGS = $(inc_local) -D_GNU_SOURCE $(GLIB_CFLAGS) -DSPD_SPAWN_CMD=\""$(prefix)/bin/speech-dispatcher"\" libspeechd_la_LDFLAGS = -version-info $(LIB_SPD_CURRENT):$(LIB_SPD_REVISION):$(LIB_SPD_AGE) libspeechd_la_LIBADD = $(GLIB_LIBS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/api/c/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/api/c/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libspeechd.la: $(libspeechd_la_OBJECTS) $(libspeechd_la_DEPENDENCIES) $(EXTRA_libspeechd_la_DEPENDENCIES) $(AM_V_CCLD)$(libspeechd_la_LINK) -rpath $(libdir) $(libspeechd_la_OBJECTS) $(libspeechd_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libspeechd_la-libspeechd.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< libspeechd_la-libspeechd.lo: libspeechd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libspeechd_la_CPPFLAGS) $(CPPFLAGS) $(libspeechd_la_CFLAGS) $(CFLAGS) -MT libspeechd_la-libspeechd.lo -MD -MP -MF $(DEPDIR)/libspeechd_la-libspeechd.Tpo -c -o libspeechd_la-libspeechd.lo `test -f 'libspeechd.c' || echo '$(srcdir)/'`libspeechd.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libspeechd_la-libspeechd.Tpo $(DEPDIR)/libspeechd_la-libspeechd.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libspeechd.c' object='libspeechd_la-libspeechd.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libspeechd_la_CPPFLAGS) $(CPPFLAGS) $(libspeechd_la_CFLAGS) $(CFLAGS) -c -o libspeechd_la-libspeechd.lo `test -f 'libspeechd.c' || echo '$(srcdir)/'`libspeechd.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-spdincludeHEADERS: $(spdinclude_HEADERS) @$(NORMAL_INSTALL) test -z "$(spdincludedir)" || $(MKDIR_P) "$(DESTDIR)$(spdincludedir)" @list='$(spdinclude_HEADERS)'; test -n "$(spdincludedir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(spdincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(spdincludedir)" || exit $$?; \ done uninstall-spdincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(spdinclude_HEADERS)'; test -n "$(spdincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(spdincludedir)'; $(am__uninstall_files_from_dir) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(spdincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-spdincludeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES uninstall-spdincludeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-libLTLIBRARIES install-man install-pdf install-pdf-am \ install-ps install-ps-am install-spdincludeHEADERS \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-libLTLIBRARIES uninstall-spdincludeHEADERS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: speech-dispatcher-0.8/src/api/Makefile.in0000664000175000017500000004634112113401437015310 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @HAVE_PYTHON_TRUE@am__append_1 = python subdir = src/api DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = c python DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOTCONF_CFLAGS = @DOTCONF_CFLAGS@ DOTCONF_LIBS = @DOTCONF_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ EXTRA_ESPEAK_LIBS = @EXTRA_ESPEAK_LIBS@ EXTRA_SOCKET_LIBS = @EXTRA_SOCKET_LIBS@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GMODULE_CFLAGS = @GMODULE_CFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTHREAD_CFLAGS = @GTHREAD_CFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBAO_CFLAGS = @LIBAO_CFLAGS@ LIBAO_LIBS = @LIBAO_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_SPD_AGE = @LIB_SPD_AGE@ LIB_SPD_CURRENT = @LIB_SPD_CURRENT@ LIB_SPD_REVISION = @LIB_SPD_REVISION@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NAS_LIBS = @NAS_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ PULSE_CFLAGS = @PULSE_CFLAGS@ PULSE_LIBS = @PULSE_LIBS@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RDYNAMIC = @RDYNAMIC@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SNDFILE_CFLAGS = @SNDFILE_CFLAGS@ SNDFILE_LIBS = @SNDFILE_LIBS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ audio_dlopen_modules = @audio_dlopen_modules@ audiodir = @audiodir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ clientconfdir = @clientconfdir@ clientconforigdir = @clientconforigdir@ datadir = @datadir@ datarootdir = @datarootdir@ default_audio_method = @default_audio_method@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ flite_basic = @flite_basic@ flite_kal = @flite_kal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ ibmtts_include = @ibmtts_include@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ modulebindir = @modulebindir@ moduleconfdir = @moduleconfdir@ moduleconforigdir = @moduleconforigdir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ snddatadir = @snddatadir@ spdconfdir = @spdconfdir@ spdconforigdir = @spdconforigdir@ spddesktopconforigdir = @spddesktopconforigdir@ spdincludedir = @spdincludedir@ spdlibdir = @spdlibdir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = c $(am__append_1) EXTRA_DIST = cl guile all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/api/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/api/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: speech-dispatcher-0.8/src/clients/0000775000175000017500000000000012113401632014200 500000000000000speech-dispatcher-0.8/src/clients/say/0000775000175000017500000000000012113401632014774 500000000000000speech-dispatcher-0.8/src/clients/say/options.h0000664000175000017500000000430711777240701016601 00000000000000/* * options.h - Defines possible command line options * * Copyright (C) 2003 Brailcom, o.p.s. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this package; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * * $Id: options.h,v 1.10 2006-07-11 16:12:27 hanke Exp $ */ #include #include "speechd_types.h" signed int rate; signed int pitch; signed int volume; int list_output_modules; char *output_module; char *sound_icon; char *language; char *voice_type; char *punctuation_mode; char *priority; int pipe_mode; SPDDataMode ssml_mode; int spelling; int wait_till_end; int stop_previous; int cancel_previous; int list_synthesis_voices; char *synthesis_voice; char *application_name; char *connection_name; static struct option long_options[] = { {"rate", 1, 0, 'r'}, {"pitch", 1, 0, 'p'}, {"volume", 1, 0, 'i'}, {"output-module", 1, 0, 'o'}, {"list-output-modules", no_argument, 0, 'O'}, {"sound-icon", required_argument, 0, 'I'}, {"language", 1, 0, 'l'}, {"voice-type", 1, 0, 't'}, {"list-synthesis-voices", no_argument, 0, 'L'}, {"synthesis-voice", required_argument, 0, 'y'}, {"punctuation-mode", 1, 0, 'm'}, {"spelling", 0, 0, 's'}, {"ssml", 0, 0, 'x'}, {"pipe-mode", 0, 0, 'e'}, {"priority", 1, 0, 'P'}, {"application-name", 1, 0, 'N'}, {"connection-name", 1, 0, 'n'}, {"wait", 0, 0, 'w'}, {"stop", 1, 0, 'S'}, {"cancel", no_argument, 0, 'C'}, {"version", 0, 0, 'v'}, {"help", 0, 0, 'h'}, {0, 0, 0, 0} }; static char *short_options = "r:p:i:l:o:OI:t:Ly:m:sxeP:N:n:wSCvh"; int options_parse(int argc, char *argv[]); void options_print_version(); void options_print_help(char *argv[]); speech-dispatcher-0.8/src/clients/say/options.c0000664000175000017500000001536111777763747016622 00000000000000 /* * options.c - Parse and process possible command line options * * Copyright (C) 2003 Brailcom, o.p.s. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this package; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * * $Id: options.c,v 1.9 2006-07-11 16:12:26 hanke Exp $ */ /* NOTE: Be careful not to include options.h, we would get repetitive initializations warnings */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "options.h" #include void options_print_help(char *argv[]) { assert(argv); assert(argv[0]); printf(_("Usage: %s [options] \"some text\"\n"), argv[0]); printf(_("%s -- a simple client for speech synthesis %s\n\n"), "Speech Dispatcher Say", "(GNU GPL)"); printf("-r, --rate\t\t\t"); printf(_("Set the rate of the speech\n")); printf("\t\t\t\t"); printf(_("(between %+d and %+d, default: %d)\n"), -100, 100, 0); printf("-p, --pitch\t\t\t"); printf(_("Set the pitch of the speech\n")); printf("\t\t\t\t"); printf(_("(between %+d and %+d, default: %d)\n"), -100, 100, 0); printf("-i, --volume\t\t\t"); printf(_("Set the volume (intensity) of the speech\n")); printf("\t\t\t\t"); printf(_("(between %+d and %+d, default: %d)\n"), -100, 100, 0); printf("-o, --output-module\t\t"); printf(_("Set the output module\n")); printf("-O, --list-output-modules\t"); printf(_("Get the list of output modules\n")); printf("-I, --sound-icon\t\t"); printf(_("Play the sound icon\n")); printf("-l, --language\t\t\t"); printf(_("Set the language (ISO code)\n")); printf("-t, --voice-type\t\t"); printf(_("Set the prefered voice type\n")); printf("\t\t\t\t(male1, male2, male3, female1, female2\n" "\t\t\t\tfemale3, child_male, child_female)\n"); printf("-L, --list-synthesis-voices\t"); printf(_("Get the list of synthesis voices\n")); printf("-y, --synthesis-voice\t\t"); printf(_("Set the synthesis voice\n")); printf("-m, --punctuation-mode\t\t"); printf(_("Set the punctuation mode %s\n"), "(none, some, all)"); printf("-s, --spelling\t\t\t"); printf(_("Spell the message\n")); printf("-x, --ssml\t\t\t"); printf(_("Set SSML mode on (default: off)\n")); printf("\n"); printf("-e, --pipe-mode\t\t\t"); printf(_("Pipe from stdin to stdout plus Speech Dispatcher\n")); printf("-P, --priority\t\t\t"); printf(_("Set priority of the message ")); printf("(important, message,\n" "\t\t\t\ttext, notification, progress;"); printf(_("default: %s)\n"), "text"); printf("-N, --application-name\t\t"); printf(_("Set the application name used to establish\n" "%sthe connection to specified string value\n"), "\t\t\t\t"); printf("\t\t\t\t"); printf(_("(default: %s)\n"), "spd-say"); printf("-n, --connection-name\t\t"); printf(_("Set the connection name used to establish\n" "%sthe connection to specified string value\n"), "\t\t\t\t"); printf("\t\t\t\t"); printf(_("(default: %s)\n"), "main"); printf("\n"); printf("-w, --wait\t\t\t"); printf(_("Wait till the message is spoken or discarded\n")); printf("-S, --stop\t\t\t"); printf(_("Stop speaking the message being spoken\n")); printf("-C, --cancel\t\t\t"); printf(_("Cancel all messages\n")); printf("\n"); printf("-v, --version\t\t\t"); printf(_("Print version and copyright info\n")); printf("-h, --help\t\t\t"); printf(_("Print this info\n")); printf("\n"); printf(_("Copyright (C) %d-%d Brailcom, o.p.s.\n" "This is free software; you can redistribute it and/or modify it\n" "under the terms of the GNU General Public License as published by\n" "the Free Software Foundation; either version 2, or (at your option)\n" "any later version. Please see COPYING for more details.\n\n" "Please report bugs to %s\n\n"), 2002, 2012, PACKAGE_BUGREPORT); } void options_print_version() { printf("spd-say: " VERSION "\n"); printf(_("Copyright (C) %d-%d Brailcom, o.p.s.\n" "%s comes with ABSOLUTELY NO WARRANTY.\n" "You may redistribute copies of this program\n" "under the terms of the GNU General Public License.\n" "For more information about these matters, see the file named COPYING.\n"), 2002, 2012, "spd-say"); } #define OPT_SET_INT(param) \ val = strtol(optarg, &tail_ptr, 10); \ if(tail_ptr != optarg){ \ param = val; \ }else{ \ printf(_("Syntax error or bad parameter!\n")); \ options_print_help(argv); \ exit(1); \ } #define OPT_SET_STR(param) \ if(optarg != NULL){ \ param = (char*) strdup(optarg); \ }else{ \ printf(_("Missing argument!\n")); \ options_print_help(argv); \ exit(1); \ } int options_parse(int argc, char *argv[]) { char *tail_ptr; int c_opt; int option_index; int val; assert(argc > 0); assert(argv); while (1) { option_index = 0; c_opt = getopt_long(argc, argv, short_options, long_options, &option_index); if (c_opt == -1) break; switch (c_opt) { case 'r': OPT_SET_INT(rate); break; case 'p': OPT_SET_INT(pitch); break; case 'i': OPT_SET_INT(volume); break; case 'l': OPT_SET_STR(language); break; case 'o': OPT_SET_STR(output_module); break; case 'O': list_output_modules = 1; break; case 'I': OPT_SET_STR(sound_icon); break; case 't': OPT_SET_STR(voice_type); break; case 'L': list_synthesis_voices = 1; break; case 'y': OPT_SET_STR(synthesis_voice); break; case 'm': OPT_SET_STR(punctuation_mode); break; case 's': spelling = 1; break; case 'e': pipe_mode = 1; break; case 'P': OPT_SET_STR(priority); break; case 'x': ssml_mode = SPD_DATA_SSML; break; case 'N': OPT_SET_STR(application_name); break; case 'n': OPT_SET_STR(connection_name); break; case 'w': wait_till_end = 1; break; case 'S': stop_previous = 1; break; case 'C': cancel_previous = 1; break; case 'v': options_print_version(argv); exit(0); break; case 'h': options_print_help(argv); exit(0); break; default: printf(_("Unrecognized option\n")); options_print_help(argv); exit(1); } } return 0; } #undef SPD_OPTION_SET_INT speech-dispatcher-0.8/src/clients/say/say.c0000664000175000017500000002006711777240701015676 00000000000000 /* * say.c - Super-simple Speech Dispatcher client * * Copyright (C) 2001, 2002, 2003, 2007 Brailcom, o.p.s. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this package; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * * $Id: say.c,v 1.16 2007-05-03 09:43:12 hanke Exp $ */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include /* * Since this client is built as part of the Speech Dispatcher source * tree, we must include speechd_types.h directly. * Clients built outside the speech dispatcher source tree should not do * this. */ #include #include #include "options.h" #include #define MAX_LINELEN 16384 sem_t semaphore; /* Callback for Speech Dispatcher notifications */ void end_of_speech(size_t msg_id, size_t client_id, SPDNotificationType type) { sem_post(&semaphore); } int main(int argc, char **argv) { SPDConnection *conn; SPDPriority spd_priority; int err; char *error; int msg_arg_required = 0; int ret; int option_ret; char *line; /* initialize i18n support */ i18n_init(); rate = -101; pitch = -101; volume = -101; language = NULL; voice_type = NULL; punctuation_mode = NULL; spelling = -2; ssml_mode = SPD_DATA_TEXT; wait_till_end = 0; stop_previous = 0; cancel_previous = 0; list_synthesis_voices = 0; list_output_modules = 0; synthesis_voice = NULL; pipe_mode = 0; priority = NULL; application_name = NULL; connection_name = NULL; option_ret = options_parse(argc, argv); /* Check if the text to say or options are specified in the argument */ msg_arg_required = (pipe_mode != 1) && (stop_previous != 1) && (cancel_previous != 1) && (list_synthesis_voices != 1) && (list_output_modules != 1) && (sound_icon == NULL); if ((optind >= argc) && msg_arg_required) { options_print_help(argv); return 1; } /* Open a connection to Speech Dispatcher */ conn = spd_open2(application_name ? application_name : "spd-say", connection_name ? connection_name : "main", NULL, SPD_MODE_THREADED, NULL, 1, &error); if (conn == NULL) { fprintf(stderr, "Failed to connect to Speech Dispatcher:\n%s\n", error); exit(1); } if (stop_previous) spd_stop_all(conn); if (cancel_previous) spd_cancel_all(conn); /* Set the desired parameters */ if (language != NULL) if (spd_set_language(conn, language)) printf("Invalid language!\n"); if (output_module != NULL) if (spd_set_output_module(conn, output_module)) printf("Invalid output module!\n"); if (list_output_modules) { char **list; int i; list = spd_list_modules(conn); if (list != NULL) { printf("OUTPUT MODULES\n"); for (i = 0; list[i]; i++) { printf("%s\n", list[i]); } } else { printf("Output modules not found.\n"); } } if (voice_type != NULL) { if (!strcmp(voice_type, "male1")) { if (spd_set_voice_type(conn, SPD_MALE1)) printf("Can't set this voice!\n"); } else if (!strcmp(voice_type, "male2")) { if (spd_set_voice_type(conn, SPD_MALE2)) printf("Can't set this voice!\n"); } else if (!strcmp(voice_type, "male3")) { if (spd_set_voice_type(conn, SPD_MALE3)) printf("Can't set this voice!\n"); } else if (!strcmp(voice_type, "female1")) { if (spd_set_voice_type(conn, SPD_FEMALE1)) printf("Can't set this voice!\n"); } else if (!strcmp(voice_type, "female2")) { if (spd_set_voice_type(conn, SPD_FEMALE2)) printf("Can't set this voice!\n"); } else if (!strcmp(voice_type, "female3")) { if (spd_set_voice_type(conn, SPD_FEMALE3)) printf("Can't set this voice!\n"); } else if (!strcmp(voice_type, "child_male")) { if (spd_set_voice_type(conn, SPD_CHILD_MALE)) printf("Can't set this voice!\n"); } else if (!strcmp(voice_type, "child_female")) { if (spd_set_voice_type(conn, SPD_CHILD_FEMALE)) printf("Can't set this voice!\n"); } else { printf("Invalid voice\n"); } } if (list_synthesis_voices) { SPDVoice **list; int i; list = spd_list_synthesis_voices(conn); if (list != NULL) { printf("%25s%25s%25s\n", "NAME", "LANGUAGE", "VARIANT"); for (i = 0; list[i]; i++) { printf("%25s%25s%25s\n", list[i]->name, list[i]->language, list[i]->variant); } } else { printf("Failed to get voice list.\n"); } } if (synthesis_voice != NULL) if (spd_set_synthesis_voice(conn, synthesis_voice)) printf("Failed to set synthesis voice!\n"); if (ssml_mode == SPD_DATA_SSML) if (spd_set_data_mode(conn, ssml_mode)) printf("Failed to set SSML mode.\n"); if (rate != -101) if (spd_set_voice_rate(conn, rate)) printf("Invalid rate!\n"); if (pitch != -101) if (spd_set_voice_pitch(conn, pitch)) printf("Invalid pitch!\n"); if (volume != -101) if (spd_set_volume(conn, volume)) printf("Invalid volume!\n"); if (spelling == 1) if (spd_set_spelling(conn, SPD_SPELL_ON)) printf("Can't set spelling to on!\n"); if (punctuation_mode != NULL) { if (!strcmp(punctuation_mode, "none")) { if (spd_set_punctuation(conn, SPD_PUNCT_NONE)) printf("Can't set this punctuation mode!\n"); } else if (!strcmp(punctuation_mode, "some")) { if (spd_set_punctuation(conn, SPD_PUNCT_SOME)) printf("Can't set this punctuation mode!\n"); } else if (!strcmp(punctuation_mode, "all")) { if (spd_set_punctuation(conn, SPD_PUNCT_ALL)) printf("Can't set this punctuation mode!\n"); } else { printf("Invalid punctuation mode.\n"); } } /* Set default priority... */ if (1 == pipe_mode) spd_priority = SPD_MESSAGE; else spd_priority = SPD_TEXT; /* ...and look if it wasn't overriden */ if (priority != NULL) { if (!strcmp(priority, "important")) spd_priority = SPD_IMPORTANT; else if (!strcmp(priority, "message")) spd_priority = SPD_MESSAGE; else if (!strcmp(priority, "text")) spd_priority = SPD_TEXT; else if (!strcmp(priority, "notification")) spd_priority = SPD_NOTIFICATION; else if (!strcmp(priority, "progress")) spd_priority = SPD_PROGRESS; else { printf("Invalid priority.\n"); } } if (sound_icon != NULL) if (spd_sound_icon(conn, spd_priority, sound_icon)) printf("Invalid sound_icon!\n"); if (wait_till_end) { ret = sem_init(&semaphore, 0, 0); if (ret < 0) { fprintf(stderr, "Can't initialize semaphore: %s", strerror(errno)); return 0; } /* Notify when the message is canceled or the speech terminates */ conn->callback_end = end_of_speech; conn->callback_cancel = end_of_speech; spd_set_notification_on(conn, SPD_END); spd_set_notification_on(conn, SPD_CANCEL); } /* In pipe mode, read from stdin, write to stdout, and also to Speech Dispatcher. */ if (pipe_mode == 1) { line = (char *)malloc(MAX_LINELEN); while (NULL != fgets(line, MAX_LINELEN, stdin)) { fputs(line, stdout); if (0 == strncmp(line, "!-!", 3)) { /* Remove EOL */ line[strlen(line) - 1] = 0; spd_execute_command(conn, line + 3); } else { spd_say(conn, spd_priority, line); if (wait_till_end) sem_wait(&semaphore); } } free(line); } else { /* Say the message with priority "text" */ /* Or do nothing in case of -C or -S with no message. */ if (optind < argc) { err = spd_sayf(conn, spd_priority, (char *)argv[optind]); if (err == -1) { fprintf(stderr, "Speech Dispatcher failed to say message"); exit(1); } /* Wait till the callback is called */ if (wait_till_end) sem_wait(&semaphore); } } /* Close the connection */ spd_close(conn); return 0; } speech-dispatcher-0.8/src/clients/say/Makefile.am0000664000175000017500000000056211777240701016770 00000000000000## Process this file with automake to produce Makefile.in inc_local = -I$(top_srcdir)/include -I$(top_srcdir)/src/api/c c_api = $(top_builddir)/src/api/c bin_PROGRAMS = spd-say spd_say_CPPFLAGS = $(inc_local) $(GLIB_CFLAGS) spd_say_SOURCES = say.c options.c options.h spd_say_LDADD = $(c_api)/libspeechd.la $(EXTRA_SOCKET_LIBS) $(top_builddir)/src/common/libcommon.la speech-dispatcher-0.8/src/clients/say/Makefile.in0000664000175000017500000005512012113401437016767 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = spd-say$(EXEEXT) subdir = src/clients/say DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_spd_say_OBJECTS = spd_say-say.$(OBJEXT) spd_say-options.$(OBJEXT) spd_say_OBJECTS = $(am_spd_say_OBJECTS) am__DEPENDENCIES_1 = spd_say_DEPENDENCIES = $(c_api)/libspeechd.la $(am__DEPENDENCIES_1) \ $(top_builddir)/src/common/libcommon.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(spd_say_SOURCES) DIST_SOURCES = $(spd_say_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOTCONF_CFLAGS = @DOTCONF_CFLAGS@ DOTCONF_LIBS = @DOTCONF_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ EXTRA_ESPEAK_LIBS = @EXTRA_ESPEAK_LIBS@ EXTRA_SOCKET_LIBS = @EXTRA_SOCKET_LIBS@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GMODULE_CFLAGS = @GMODULE_CFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTHREAD_CFLAGS = @GTHREAD_CFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBAO_CFLAGS = @LIBAO_CFLAGS@ LIBAO_LIBS = @LIBAO_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_SPD_AGE = @LIB_SPD_AGE@ LIB_SPD_CURRENT = @LIB_SPD_CURRENT@ LIB_SPD_REVISION = @LIB_SPD_REVISION@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NAS_LIBS = @NAS_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ PULSE_CFLAGS = @PULSE_CFLAGS@ PULSE_LIBS = @PULSE_LIBS@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RDYNAMIC = @RDYNAMIC@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SNDFILE_CFLAGS = @SNDFILE_CFLAGS@ SNDFILE_LIBS = @SNDFILE_LIBS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ audio_dlopen_modules = @audio_dlopen_modules@ audiodir = @audiodir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ clientconfdir = @clientconfdir@ clientconforigdir = @clientconforigdir@ datadir = @datadir@ datarootdir = @datarootdir@ default_audio_method = @default_audio_method@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ flite_basic = @flite_basic@ flite_kal = @flite_kal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ ibmtts_include = @ibmtts_include@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ modulebindir = @modulebindir@ moduleconfdir = @moduleconfdir@ moduleconforigdir = @moduleconforigdir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ snddatadir = @snddatadir@ spdconfdir = @spdconfdir@ spdconforigdir = @spdconforigdir@ spddesktopconforigdir = @spddesktopconforigdir@ spdincludedir = @spdincludedir@ spdlibdir = @spdlibdir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ inc_local = -I$(top_srcdir)/include -I$(top_srcdir)/src/api/c c_api = $(top_builddir)/src/api/c spd_say_CPPFLAGS = $(inc_local) $(GLIB_CFLAGS) spd_say_SOURCES = say.c options.c options.h spd_say_LDADD = $(c_api)/libspeechd.la $(EXTRA_SOCKET_LIBS) $(top_builddir)/src/common/libcommon.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/clients/say/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/clients/say/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list spd-say$(EXEEXT): $(spd_say_OBJECTS) $(spd_say_DEPENDENCIES) $(EXTRA_spd_say_DEPENDENCIES) @rm -f spd-say$(EXEEXT) $(AM_V_CCLD)$(LINK) $(spd_say_OBJECTS) $(spd_say_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spd_say-options.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spd_say-say.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< spd_say-say.o: say.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(spd_say_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT spd_say-say.o -MD -MP -MF $(DEPDIR)/spd_say-say.Tpo -c -o spd_say-say.o `test -f 'say.c' || echo '$(srcdir)/'`say.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/spd_say-say.Tpo $(DEPDIR)/spd_say-say.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='say.c' object='spd_say-say.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(spd_say_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o spd_say-say.o `test -f 'say.c' || echo '$(srcdir)/'`say.c spd_say-say.obj: say.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(spd_say_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT spd_say-say.obj -MD -MP -MF $(DEPDIR)/spd_say-say.Tpo -c -o spd_say-say.obj `if test -f 'say.c'; then $(CYGPATH_W) 'say.c'; else $(CYGPATH_W) '$(srcdir)/say.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/spd_say-say.Tpo $(DEPDIR)/spd_say-say.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='say.c' object='spd_say-say.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(spd_say_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o spd_say-say.obj `if test -f 'say.c'; then $(CYGPATH_W) 'say.c'; else $(CYGPATH_W) '$(srcdir)/say.c'; fi` spd_say-options.o: options.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(spd_say_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT spd_say-options.o -MD -MP -MF $(DEPDIR)/spd_say-options.Tpo -c -o spd_say-options.o `test -f 'options.c' || echo '$(srcdir)/'`options.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/spd_say-options.Tpo $(DEPDIR)/spd_say-options.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='options.c' object='spd_say-options.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(spd_say_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o spd_say-options.o `test -f 'options.c' || echo '$(srcdir)/'`options.c spd_say-options.obj: options.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(spd_say_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT spd_say-options.obj -MD -MP -MF $(DEPDIR)/spd_say-options.Tpo -c -o spd_say-options.obj `if test -f 'options.c'; then $(CYGPATH_W) 'options.c'; else $(CYGPATH_W) '$(srcdir)/options.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/spd_say-options.Tpo $(DEPDIR)/spd_say-options.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='options.c' object='spd_say-options.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(spd_say_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o spd_say-options.obj `if test -f 'options.c'; then $(CYGPATH_W) 'options.c'; else $(CYGPATH_W) '$(srcdir)/options.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-binPROGRAMS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: speech-dispatcher-0.8/src/clients/spdsend/0000775000175000017500000000000012113401632015640 500000000000000speech-dispatcher-0.8/src/clients/spdsend/common.c0000664000175000017500000000364511777240701017241 00000000000000/* common.c -- Common parts of the client and the server Author: Milan Zamazal */ /* Copyright (C) 2004 Brailcom, o.p.s. COPYRIGHT NOTICE This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "spdsend.h" const long CONNECTION_ID_MIN = 1; const long CONNECTION_ID_MAX = 1000; const int EXIT_OK = 0; const int EXIT_ERROR = 1; extern Success write_data(Stream s, const void *buffer, size_t size) { int written; for (; size > 0; size -= written, buffer += written) { written = write(s, buffer, size); if (written < 0) return ERROR; } return OK; } extern int read_data(Stream s, void *buffer, size_t max_size) { size_t nread = 0, n; while (nread < max_size) { n = read(s, buffer, max_size); if (n < 0) return NONE; if (n == 0) break; nread += n; buffer += n; max_size -= n; } return nread; } extern Success forward_data(Stream from, Stream to, bool closep) { const size_t buffer_size = 4096; char buffer[buffer_size]; ssize_t n; while ((n = read(from, buffer, buffer_size)) > 0) { if (write_data(to, buffer, n) == ERROR) return ERROR; } if (closep) shutdown(to, SHUT_WR); return (n == NONE ? ERROR : OK); } speech-dispatcher-0.8/src/clients/spdsend/README0000664000175000017500000000151511777240701016457 00000000000000This is a simple command line client to Speech Dispatcher. It may be useful in programs, which don't want to use direct socket communication with Speech Dispatcher for some reason. To compile the program, just run `make'. To install it, run `make install'. The following operations are supported: $ spdsend --open HOST PORT Open new connection to Speech Dispatcher running at HOST:PORT and print the connection identifier on the standard output. $ spdsend --close CONNECTION Close the given Speech Dispatcher CONNECTION. $ spdsend --send CONNECTION Read an SSIP command from standard input, forward it to Speech Dispatcher CONNECTION and print the answer on the standard output. You can send your bug reports, patches, suggestions, etc. to the mailing list speechd@lists.freebsoft.org. -- Milan Zamazal speech-dispatcher-0.8/src/clients/spdsend/ChangeLog0000664000175000017500000000041011777240701017342 000000000000002008-02-01 Hynek Hanke * server.c (serve): Correct type for client_address_len. 2006-07-25 root * README: speechd 2004-09-08 Milan Zamazal * server.c (do_send_data): Close the connection on error. speech-dispatcher-0.8/src/clients/spdsend/spdsend.h0000664000175000017500000000345611777240701017416 00000000000000/* Declarations for spdsend Author: Milan Zamazal */ /* Copyright (C) 2004 Brailcom, o.p.s. COPYRIGHT NOTICE This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef __SPDSEND_H #define __SPDSEND_H #define _GNU_SOURCE #include /* Configuration */ #ifndef LISTEN_QUEUE_LENGTH #define LISTEN_QUEUE_LENGTH 100 #endif /* Types */ typedef enum { FALSE, TRUE } bool; typedef int Stream; typedef int Connection_Id; typedef enum { OK, ERROR } Success; #define NONE -1 /* common.c */ extern Success write_data(Stream s, const void *buffer, size_t size); extern int read_data(Stream s, void *buffer, size_t max_size); extern Success forward_data(Stream from, Stream to, bool closep); typedef enum { A_OPEN, A_CLOSE, A_DATA } Action; typedef enum { OK_CODE, ER_CODE } Result; extern const long CONNECTION_ID_MIN; extern const long CONNECTION_ID_MAX; extern const int EXIT_OK; extern const int EXIT_ERROR; /* server.c */ extern Stream open_server(); /* client.c */ extern Success open_connection(Stream server, const char *host, int port); extern Success close_connection(Stream server, Connection_Id id); extern Success send_command(Stream server, Connection_Id id); #endif speech-dispatcher-0.8/src/clients/spdsend/server.c0000664000175000017500000002231311777240701017250 00000000000000/* server.c -- Server part of spdsend Author: Milan Zamazal */ /* Copyright (C) 2004 Brailcom, o.p.s. COPYRIGHT NOTICE This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H #include #endif #include "spdsend.h" #ifndef USE_THREADS #define USE_THREADS 1 #endif #include #include #include #include #if USE_THREADS #include #endif #include #include #include #include #include #include #include #include #include #if !(defined(__GLIBC__) && defined(_GNU_SOURCE)) /* Added by Willie Walker - TEMP_FAILURE_RETRY, strndup, and getline * are gcc-isms */ ssize_t getline(char **lineptr, size_t * n, FILE * f); #endif /* Utilities */ static void system_error(const char *message) { perror(message); exit(1); } /* Connection management */ Stream *connections; #if USE_THREADS pthread_mutex_t connections_mutex = PTHREAD_MUTEX_INITIALIZER; #endif static Stream get_connection(Connection_Id id) { return connections[id]; } static void set_connection(Connection_Id id, Stream s) { #if USE_THREADS pthread_mutex_lock(&connections_mutex); #endif connections[id] = s; #if USE_THREADS pthread_mutex_unlock(&connections_mutex); #endif } static Connection_Id new_connection(Stream s) { #if USE_THREADS pthread_mutex_lock(&connections_mutex); #endif int id; for (id = CONNECTION_ID_MIN; id < CONNECTION_ID_MAX && connections[id] != NONE; id++) ; if (id >= CONNECTION_ID_MAX) return NONE; connections[id] = s; #if USE_THREADS pthread_mutex_unlock(&connections_mutex); #endif return id; } static Connection_Id do_open_connection(const char *host, int port) { int sock = socket(AF_INET, SOCK_STREAM, 0); { struct sockaddr_in name; name.sin_family = AF_INET; name.sin_port = htons(port); { struct hostent *hostinfo; hostinfo = gethostbyname(host); if (hostinfo == NULL) return NONE; name.sin_addr = *(struct in_addr *)hostinfo->h_addr; } if (connect(sock, (struct sockaddr *)&name, sizeof(name)) < 0) return NONE; { int arg = 1; setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, &arg, sizeof(int)); } } { Connection_Id id = new_connection(sock); if (id == NONE) close(sock); return id; } } static Success do_close_connection(Connection_Id id) { Stream c = get_connection(id); if (c == NONE) return ERROR; close(c); set_connection(id, NONE); return OK; } static Success do_send_data(Connection_Id id, Stream from, Stream to, Success(*forwarder) (Stream, Stream, bool)) { int sock = get_connection(id); if (sock == NONE) return ERROR; if (from == NONE) from = sock; else if (to == NONE) to = sock; { Success result = ((*forwarder) (from, to, FALSE)); if (result != OK) do_close_connection(id); return result; } } /* Processing requests */ /* Protocol: Client request: First comes the action code, of the type Action. If Action is A_OPEN, the following data follows: int port, int strlen(hostname), hostname Else: Connection_Id Then, if Action is A_DATA, the SSIP lines follow. Server answer: The result code, of the type Result. If Result is OK, Connection_Id follows. Additionally, if Action is A_DATA, SSIP reply follows. */ static Success report(Stream s, Result code) { return write_data(s, &code, sizeof(Result)); } static Success report_ok(Stream s, Connection_Id id) { if (report(s, OK_CODE) == OK && write_data(s, &id, sizeof(Connection_Id)) == OK) return OK; else return ERROR; } static Success report_error(Stream s) { return report(s, ER_CODE); } static Connection_Id read_id(Stream s) { Connection_Id id; if (read_data(s, &id, sizeof(Connection_Id)) == ERROR) return NONE; return id; } static Success forward_ssip_answer(Stream from, Stream to, bool _closep) { int result = OK; FILE *f = fdopen(from, "r"); size_t line_size = 256; char *line = malloc(line_size); if (line == NULL) system_error("memory allocation"); while (1) { int n = getline(&line, &line_size, f); if (n < 0 || write_data(to, line, n) == ERROR) { result = ERROR; break; } if (n > 3 && line[3] == ' ') break; } free(line); return result; } static void process_open(Stream s) { Connection_Id id; int port; int hostlen; if (read_data(s, &port, sizeof(int)) != sizeof(int)) { report_error(s); return; } if (read_data(s, &hostlen, sizeof(int)) != sizeof(int)) { report_error(s); return; } { char *host = malloc(hostlen + 1); if (host == NULL) system_error("memory allocation"); if (read_data(s, host, hostlen) != hostlen) { free(host); report_error(s); return; } host[hostlen] = '\0'; id = do_open_connection(host, port); free(host); } if (id == NONE) report_error(s); else report_ok(s, id); } static void process_close(Stream s) { Connection_Id id = read_id(s); if (id != NONE && do_close_connection(id) == OK) report_ok(s, id); else report_error(s); } static void process_data(Stream s) { Connection_Id id = read_id(s); if (id != NONE) report_ok(s, id); else report_error(s); if (do_send_data(id, s, NONE, forward_data) == OK) do_send_data(id, NONE, s, forward_ssip_answer); } static void process_request(Stream s) { Action action; if (read_data(s, &action, sizeof(Action)) == NONE) return; if (action == A_OPEN) process_open(s); else if (action == A_CLOSE) process_close(s); else if (action == A_DATA) process_data(s); else report_error(s); close(s); } #if USE_THREADS static void *process_request_thread(void *s) { Stream s_deref = *((Stream *) s); free(s); pthread_detach(pthread_self()); process_request(s_deref); return NULL; } #endif /* Starting the server */ static const char *login_name() { return getpwuid(getuid())->pw_name; } static const char *server_socket_name() { char *name; if (asprintf(&name, "/tmp/spdsend-server.%s", login_name()) < 0) system_error("memory allocation"); return name; } static void serve() { struct sockaddr_un name; int sock; size_t size; const char *filename = server_socket_name(); sock = socket(PF_LOCAL, SOCK_STREAM, 0); if (sock < 0) system_error("socket creation"); name.sun_family = AF_LOCAL; strncpy(name.sun_path, filename, sizeof(name.sun_path)); name.sun_path[sizeof(name.sun_path) - 1] = '\0'; size = (offsetof(struct sockaddr_un, sun_path) + strlen(name.sun_path) + 1); if (bind(sock, (struct sockaddr *)&name, size) < 0) system_error("bind"); if (listen(sock, LISTEN_QUEUE_LENGTH) < 0) system_error("listen"); while (1) { struct sockaddr_un client_address; socklen_t client_address_len = sizeof(client_address); Stream *s = malloc(sizeof(Stream)); if (s == NULL) system_error("memory allocation"); *s = accept(sock, (struct sockaddr *)&client_address, &client_address_len); if (*s < 0) break; { #if USE_THREADS pthread_t tid; #endif #if USE_THREADS pthread_create(&tid, NULL, &process_request_thread, s); #else process_request(*s); #endif } } } static void daemonize() { int ret = 0; if (fork() != 0) exit(0); setsid(); signal(SIGHUP, SIG_IGN); if (fork() != 0) exit(0); if ((ret = chdir("/")) != 0) fputs("server.c:daemonize: could not chdir", stderr); exit(1); umask(0); { int i; for (i = 0; i < 4; i++) close(i); } } static void init_connections() { connections = malloc(CONNECTION_ID_MAX * sizeof(Connection_Id)); if (connections == NULL) system_error("memory allocation"); { int i; for (i = CONNECTION_ID_MIN; i < CONNECTION_ID_MAX; i++) connections[i] = NONE; } #if USE_THREADS pthread_mutex_init(&connections_mutex, NULL); #endif } static void start_server() { const char *socket_name = server_socket_name(); unlink(socket_name); { int pid = fork(); if (pid == -1) system_error("fork"); if (pid == 0) { daemonize(); init_connections(); serve(); unlink(socket_name); exit(0); } else sleep(1); } } static int connect_server() { struct sockaddr_un name; int sock = socket(AF_LOCAL, SOCK_STREAM, 0); int name_size; name.sun_family = AF_LOCAL; strncpy(name.sun_path, server_socket_name(), sizeof(name.sun_path)); name.sun_path[sizeof(name.sun_path) - 1] = '\0'; name_size = (offsetof(struct sockaddr_un, sun_path) + strlen(name.sun_path) + 1); if (connect(sock, (struct sockaddr *)&name, name_size) < 0) return NONE; else return sock; } /* External functions */ Stream open_server() { Stream s; s = connect_server(); if (s == NONE) { start_server(); s = connect_server(); } if (s == NONE) return NONE; return s; } speech-dispatcher-0.8/src/clients/spdsend/spdsend.c0000664000175000017500000000663111777240701017407 00000000000000/* spdsend.c -- Send SSIP commands to Speech Dispatcher Author: Milan Zamazal */ /* Copyright (C) 2004 Brailcom, o.p.s. COPYRIGHT NOTICE This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "spdsend.h" const char *const SPDSEND_VERSION = "0.0.0"; #if !(defined(__GLIBC__) && defined(_GNU_SOURCE)) /* Added by Willie Walker - getline is a gcc-ism */ #define BUFFER_LEN 256 ssize_t getline(char **lineptr, size_t * n, FILE * f) { char ch; size_t m = 0; ssize_t buf_len = 0; char *buf = NULL; char *p = NULL; if (errno != 0) { errno = 0; } while ((ch = getc(f)) != EOF) { if (errno != 0) return -1; if (m++ >= buf_len) { buf_len += BUFFER_LEN; buf = (char *)realloc(buf, buf_len + 1); if (buf == NULL) { return -1; } p = buf + buf_len - BUFFER_LEN; } *p = ch; p++; if (ch == '\n') break; } if (m == 0) { return -1; } else { *p = '\0'; *lineptr = buf; *n = m; return m; } } #endif /* !(defined(__GLIBC__) && defined(_GNU_SOURCE)) */ static void usage(const char *const message) { if (message != NULL) fprintf(stderr, "spdsend: %s\n", message); fprintf(stderr, "usage: spdsend { --open SERVER PORT | --close ID | --send ID }\n"); exit(EXIT_ERROR); } static long string_to_number(const char *string, long low_limit, long high_limit) { char *tailptr; errno = 0; long int number = strtol(string, &tailptr, 0); if (errno || *tailptr || number < low_limit || number > high_limit) usage("Invalid parameter"); return number; } int main(int argc, char **argv) { if (argc < 2) usage("Invalid number of arguments"); { const char *const action = argv[1]; Success(*function) (Stream, Connection_Id); Connection_Id conn_id; char *host; int port; if (!strcmp(action, "--version")) { printf("spdsend %s\n", SPDSEND_VERSION); exit(EXIT_OK); } const int action_is_open = strcmp(action, "--open") == 0; if (action_is_open) { if (argc != 4) usage("Invalid number of arguments"); host = argv[2]; port = string_to_number(argv[3], 0, 65535); } else { if (argc != 3) usage("Invalid number of arguments"); conn_id = string_to_number(argv[2], CONNECTION_ID_MIN, CONNECTION_ID_MAX); if (!strcmp(action, "--close")) function = close_connection; else if (!strcmp(action, "--send")) function = send_command; else usage("Invalid option"); } { Stream server = open_server(); if (server == NONE) return EXIT_ERROR; { int result = (action_is_open ? open_connection(server, host, port) : function(server, conn_id)); return (result == OK ? EXIT_OK : EXIT_ERROR); } } } } speech-dispatcher-0.8/src/clients/spdsend/Makefile.am0000664000175000017500000000027211777240701017632 00000000000000## Process this file with automake to produce Makefile.in bin_PROGRAMS = spdsend spdsend_SOURCES = spdsend.h spdsend.c server.c client.c common.c spdsend_LDADD = $(EXTRA_SOCKET_LIBS) speech-dispatcher-0.8/src/clients/spdsend/Makefile.in0000664000175000017500000004625512113401437017644 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = spdsend$(EXEEXT) subdir = src/clients/spdsend DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ ChangeLog ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_spdsend_OBJECTS = spdsend.$(OBJEXT) server.$(OBJEXT) \ client.$(OBJEXT) common.$(OBJEXT) spdsend_OBJECTS = $(am_spdsend_OBJECTS) am__DEPENDENCIES_1 = spdsend_DEPENDENCIES = $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(spdsend_SOURCES) DIST_SOURCES = $(spdsend_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOTCONF_CFLAGS = @DOTCONF_CFLAGS@ DOTCONF_LIBS = @DOTCONF_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ EXTRA_ESPEAK_LIBS = @EXTRA_ESPEAK_LIBS@ EXTRA_SOCKET_LIBS = @EXTRA_SOCKET_LIBS@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GMODULE_CFLAGS = @GMODULE_CFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTHREAD_CFLAGS = @GTHREAD_CFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBAO_CFLAGS = @LIBAO_CFLAGS@ LIBAO_LIBS = @LIBAO_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_SPD_AGE = @LIB_SPD_AGE@ LIB_SPD_CURRENT = @LIB_SPD_CURRENT@ LIB_SPD_REVISION = @LIB_SPD_REVISION@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NAS_LIBS = @NAS_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ PULSE_CFLAGS = @PULSE_CFLAGS@ PULSE_LIBS = @PULSE_LIBS@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RDYNAMIC = @RDYNAMIC@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SNDFILE_CFLAGS = @SNDFILE_CFLAGS@ SNDFILE_LIBS = @SNDFILE_LIBS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ audio_dlopen_modules = @audio_dlopen_modules@ audiodir = @audiodir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ clientconfdir = @clientconfdir@ clientconforigdir = @clientconforigdir@ datadir = @datadir@ datarootdir = @datarootdir@ default_audio_method = @default_audio_method@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ flite_basic = @flite_basic@ flite_kal = @flite_kal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ ibmtts_include = @ibmtts_include@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ modulebindir = @modulebindir@ moduleconfdir = @moduleconfdir@ moduleconforigdir = @moduleconforigdir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ snddatadir = @snddatadir@ spdconfdir = @spdconfdir@ spdconforigdir = @spdconforigdir@ spddesktopconforigdir = @spddesktopconforigdir@ spdincludedir = @spdincludedir@ spdlibdir = @spdlibdir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ spdsend_SOURCES = spdsend.h spdsend.c server.c client.c common.c spdsend_LDADD = $(EXTRA_SOCKET_LIBS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/clients/spdsend/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/clients/spdsend/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list spdsend$(EXEEXT): $(spdsend_OBJECTS) $(spdsend_DEPENDENCIES) $(EXTRA_spdsend_DEPENDENCIES) @rm -f spdsend$(EXEEXT) $(AM_V_CCLD)$(LINK) $(spdsend_OBJECTS) $(spdsend_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/client.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/server.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spdsend.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-binPROGRAMS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: speech-dispatcher-0.8/src/clients/spdsend/client.c0000664000175000017500000000505711777240701017226 00000000000000/* client.c -- Client part of spdsend Author: Milan Zamazal */ /* Copyright (C) 2004 Brailcom, o.p.s. COPYRIGHT NOTICE This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifdef HAVE_CONFIG_H #include #endif #include "spdsend.h" #include #include #include static Success send_header(Stream s, Action action, Connection_Id id) { if (write_data(s, &action, sizeof(Action)) == OK && write_data(s, &id, sizeof(Connection_Id)) == OK) return OK; else return ERROR; } #define SEND_HEADER(action) \ if (send_header (s, action, id) == ERROR) \ return ERROR static Success send_open_header(Stream s, const char *host, int port) { int hostlen = strlen(host); Action action = A_OPEN; if (write_data(s, &action, sizeof(Action)) == OK && write_data(s, &port, sizeof(int)) == OK && write_data(s, &hostlen, sizeof(int)) == OK && write_data(s, host, hostlen) == OK) return OK; else return ERROR; } static Connection_Id read_reply(Stream s) { Result result; Connection_Id id; if (read_data(s, &result, sizeof(Result)) != sizeof(Result)) return NONE; if (result != OK_CODE) return NONE; if (read_data(s, &id, sizeof(Connection_Id)) != sizeof(Connection_Id)) return NONE; return id; } /* External functions */ extern Success open_connection(Stream s, const char *host, int port) { if (send_open_header(s, host, port) == ERROR) return ERROR; { Connection_Id id = read_reply(s); if (id == NONE) return ERROR; printf("%d\n", id); } return OK; } extern Success close_connection(Stream s, Connection_Id id) { SEND_HEADER(A_CLOSE); return (read_reply(s) == OK ? OK : ERROR); } extern Success send_command(Stream s, Connection_Id id) { SEND_HEADER(A_DATA); if (read_reply(s) == NONE) return ERROR; if (forward_data(0, s, TRUE) == OK && forward_data(s, 1, FALSE) == OK) return OK; else return ERROR; } speech-dispatcher-0.8/src/clients/Makefile.am0000664000175000017500000000012211777240701016164 00000000000000## Process this file with automake to produce Makefile.in SUBDIRS= say spdsend speech-dispatcher-0.8/src/clients/Makefile.in0000664000175000017500000004625312113401437016202 00000000000000# Makefile.in generated by automake 1.11.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/clients DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOTCONF_CFLAGS = @DOTCONF_CFLAGS@ DOTCONF_LIBS = @DOTCONF_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ EXTRA_ESPEAK_LIBS = @EXTRA_ESPEAK_LIBS@ EXTRA_SOCKET_LIBS = @EXTRA_SOCKET_LIBS@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GMODULE_CFLAGS = @GMODULE_CFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTHREAD_CFLAGS = @GTHREAD_CFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBAO_CFLAGS = @LIBAO_CFLAGS@ LIBAO_LIBS = @LIBAO_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_SPD_AGE = @LIB_SPD_AGE@ LIB_SPD_CURRENT = @LIB_SPD_CURRENT@ LIB_SPD_REVISION = @LIB_SPD_REVISION@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ MSGMERGE = @MSGMERGE@ NAS_LIBS = @NAS_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ PULSE_CFLAGS = @PULSE_CFLAGS@ PULSE_LIBS = @PULSE_LIBS@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ RDYNAMIC = @RDYNAMIC@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SNDFILE_CFLAGS = @SNDFILE_CFLAGS@ SNDFILE_LIBS = @SNDFILE_LIBS@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ audio_dlopen_modules = @audio_dlopen_modules@ audiodir = @audiodir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ clientconfdir = @clientconfdir@ clientconforigdir = @clientconforigdir@ datadir = @datadir@ datarootdir = @datarootdir@ default_audio_method = @default_audio_method@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ flite_basic = @flite_basic@ flite_kal = @flite_kal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ ibmtts_include = @ibmtts_include@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ modulebindir = @modulebindir@ moduleconfdir = @moduleconfdir@ moduleconforigdir = @moduleconforigdir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ snddatadir = @snddatadir@ spdconfdir = @spdconfdir@ spdconforigdir = @spdconforigdir@ spddesktopconforigdir = @spddesktopconforigdir@ spdincludedir = @spdincludedir@ spdlibdir = @spdlibdir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = say spdsend all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/clients/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/clients/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: speech-dispatcher-0.8/src/audio/0000775000175000017500000000000012113401631013637 500000000000000speech-dispatcher-0.8/src/audio/libao.c0000664000175000017500000001276411777240701015041 00000000000000/* * libao.c -- The libao backend for the spd_audio library. * * Author: Marco Skambraks * Date: 2009-12-15 * * This is free software; you can redistribute it and/or modify it under the * terms of the GNU Leser General Public License as published by the Free * Software Foundation; either version 2.1, or (at your option) any later * version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this package; see the file COPYING. If not, write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #define SPD_AUDIO_PLUGIN_ENTRY spd_libao_LTX_spd_audio_plugin_get #include /* send a packet of XXX bytes to the sound device */ #define AO_SEND_BYTES 256 /* Put a message into the logfile (stderr) */ #define MSG(level, arg...) \ if(level <= libao_log_level){ \ time_t t; \ struct timeval tv; \ char *tstr; \ t = time(NULL); \ tstr = g_strdup(ctime(&t)); \ tstr[strlen(tstr)-1] = 0; \ gettimeofday(&tv,NULL); \ fprintf(stderr," %s [%d]",tstr, (int) tv.tv_usec); \ fprintf(stderr," libao:: "); \ fprintf(stderr,arg); \ fprintf(stderr,"\n"); \ fflush(stderr); \ g_free(tstr); \ } #define ERR(arg...) \ { \ time_t t; \ struct timeval tv; \ char *tstr; \ t = time(NULL); \ tstr = g_strdup(ctime(&t)); \ tstr[strlen(tstr)-1] = 0; \ gettimeofday(&tv,NULL); \ fprintf(stderr," %s [%d]",tstr, (int) tv.tv_usec); \ fprintf(stderr," libao ERROR: "); \ fprintf(stderr,arg); \ fprintf(stderr,"\n"); \ fflush(stderr); \ g_free(tstr); \ } /* AO_FORMAT_INITIALIZER is an ao_sample_format structure with zero values in all of its fields. We can guarantee that the fields of a stack-allocated ao_sample_format are zeroed by assigning AO_FORMAT_INITIALIZER to it. This is the most portable way to initialize a stack-allocated struct to zero. */ static ao_sample_format AO_FORMAT_INITIALIZER; static ao_sample_format current_ao_parameters; static volatile int ao_stop_playback = 0; static int default_driver; static int libao_log_level; ao_device *device = NULL; static inline void libao_open_handle(int rate, int channels, int bits) { ao_sample_format format = AO_FORMAT_INITIALIZER; format.channels = channels; format.rate = rate; format.bits = bits; format.byte_format = AO_FMT_NATIVE; device = ao_open_live(default_driver, &format, NULL); if (device != NULL) current_ao_parameters = format; } static inline void libao_close_handle(void) { if (device != NULL) { ao_close(device); device = NULL; } } static AudioID *libao_open(void **pars) { AudioID *id; id = (AudioID *) g_malloc(sizeof(AudioID)); ao_initialize(); default_driver = ao_default_driver_id(); return id; } static int libao_play(AudioID * id, AudioTrack track) { int bytes_per_sample; int num_bytes; int outcnt = 0; signed short *output_samples; int i; if (id == NULL) return -1; if (track.samples == NULL || track.num_samples <= 0) return 0; /* Choose the correct format */ if (track.bits == 16) bytes_per_sample = 2; else if (track.bits == 8) bytes_per_sample = 1; else { ERR("Audio: Unrecognized sound data format.\n"); return -10; } MSG(3, "Starting playback"); output_samples = track.samples; num_bytes = track.num_samples * bytes_per_sample; if ((device == NULL) || (track.num_channels != current_ao_parameters.channels) || (track.sample_rate != current_ao_parameters.rate) || (track.bits != current_ao_parameters.bits)) { libao_close_handle(); libao_open_handle(track.sample_rate, track.num_channels, track.bits); } if (device == NULL) { ERR("error opening libao dev"); return -2; } MSG(3, "bytes to play: %d, (%f secs)", num_bytes, (((float)(num_bytes) / 2) / (float)track.sample_rate)); ao_stop_playback = 0; outcnt = 0; i = 0; while ((outcnt < num_bytes) && !ao_stop_playback) { if ((num_bytes - outcnt) > AO_SEND_BYTES) i = AO_SEND_BYTES; else i = (num_bytes - outcnt); if (!ao_play(device, (char *)output_samples + outcnt, i)) { libao_close_handle(); ERR("Audio: ao_play() - closing device - re-open it in next run\n"); return -1; } outcnt += i; } return 0; } /* stop the libao_play() loop */ static int libao_stop(AudioID * id) { ao_stop_playback = 1; return 0; } static int libao_close(AudioID * id) { libao_close_handle(); ao_shutdown(); g_free(id); id = NULL; return 0; } static int libao_set_volume(AudioID * id, int volume) { return 0; } static void libao_set_loglevel(int level) { if (level) { libao_log_level = level; } } static char const *libao_get_playcmd(void) { return NULL; } /* Provide the libao backend. */ static spd_audio_plugin_t libao_functions = { "libao", libao_open, libao_play, libao_stop, libao_close, libao_set_volume, libao_set_loglevel, libao_get_playcmd }; spd_audio_plugin_t *libao_plugin_get(void) { return &libao_functions; } spd_audio_plugin_t *SPD_AUDIO_PLUGIN_ENTRY(void) __attribute__ ((weak, alias("libao_plugin_get"))); #undef MSG #undef ERR speech-dispatcher-0.8/src/audio/pulse.c0000664000175000017500000002024511777240701015074 00000000000000 /* * pulse.c -- The simple pulseaudio backend for the spd_audio library. * * Based on libao.c from Marco Skambraks * Date: 2009-12-15 * * Copied from Luke Yelavich's libao.c driver, and merged with code from * Marco's ao_pulse.c driver, by Bill Cox, Dec 21, 2009. * * Minor changes be Rui Batista to configure settings through speech-dispatcher configuration files * Date: Dec 22, 2009 * * This is free software; you can redistribute it and/or modify it under the * terms of the GNU Leser General Public License as published by the Free * Software Foundation; either version 2.1, or (at your option) any later * version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this package; see the file COPYING. If not, write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #define SPD_AUDIO_PLUGIN_ENTRY spd_pulse_LTX_spd_audio_plugin_get #include /* Switch this on to debug, see output log location in MSG() */ //#define DEBUG_PULSE typedef struct { AudioID id; pa_simple *pa_simple; char *pa_server; int pa_min_audio_length; volatile int pa_stop_playback; int pa_current_rate; // Sample rate for currently PA connection int pa_current_bps; // Bits per sample rate for currently PA connection int pa_current_channels; // Number of channels for currently PA connection } spd_pulse_id_t; /* send a packet of XXX bytes to the sound device */ #define PULSE_SEND_BYTES 256 /* This is the smallest audio sound we are expected to play immediately without buffering. */ /* Changed to define on config file. Default is the same. */ #define DEFAULT_PA_MIN_AUDIO_LENgTH 100 static int pulse_log_level; static char const *pulse_play_cmd = "paplay"; /* Write to /tmp/speech-dispatcher-pulse.log */ #ifdef DEBUG_PULSE static FILE *pulseDebugFile = NULL; static void MSG(char *message, ...) { va_list ap; if (pulseDebugFile == NULL) { pulseDebugFile = fopen("/tmp/speech-dispatcher-pulse.log", "w"); } va_start(ap, message); vfprintf(pulseDebugFile, message, ap); va_end(ap); fflush(pulseDebugFile); } #else static void MSG(char *message, ...) { } #endif static int _pulse_open(spd_pulse_id_t * id, int sample_rate, int num_channels, int bytes_per_sample) { pa_buffer_attr buffAttr; pa_sample_spec ss; int error; ss.rate = sample_rate; ss.channels = num_channels; if (bytes_per_sample == 2) { switch (id->id.format) { case SPD_AUDIO_LE: ss.format = PA_SAMPLE_S16LE; break; case SPD_AUDIO_BE: ss.format = PA_SAMPLE_S16BE; break; } } else { ss.format = PA_SAMPLE_U8; } /* Set prebuf to one sample so that keys are spoken as soon as typed rather than delayed until the next key pressed */ buffAttr.maxlength = (uint32_t) - 1; //buffAttr.tlength = (uint32_t)-1; - this is the default, which causes key echo to not work properly. buffAttr.tlength = id->pa_min_audio_length; buffAttr.prebuf = (uint32_t) - 1; buffAttr.minreq = (uint32_t) - 1; buffAttr.fragsize = (uint32_t) - 1; /* Open new connection */ if (! (id->pa_simple = pa_simple_new(id->pa_server, "speech-dispatcher", PA_STREAM_PLAYBACK, NULL, "playback", &ss, NULL, &buffAttr, &error))) { fprintf(stderr, __FILE__ ": pa_simple_new() failed: %s\n", pa_strerror(error)); return 1; } return 0; } /* Close the connection to the server. Does not free the AudioID struct. */ /* Usable in pulse_play, which closes connections on failure or */ /* changes in audio parameters. */ static void pulse_connection_close(spd_pulse_id_t * pulse_id) { if (pulse_id->pa_simple != NULL) { pa_simple_free(pulse_id->pa_simple); pulse_id->pa_simple = NULL; } } static AudioID *pulse_open(void **pars) { spd_pulse_id_t *pulse_id; int ret; pulse_id = (spd_pulse_id_t *) g_malloc(sizeof(spd_pulse_id_t)); /* Select an Endianness for the initial connection. */ #if defined(BYTE_ORDER) && (BYTE_ORDER == BIG_ENDIAN) pulse_id->id.format = SPD_AUDIO_BE; #else pulse_id->id.format = SPD_AUDIO_LE; #endif pulse_id->pa_simple = NULL; pulse_id->pa_server = (char *)pars[3]; pulse_id->pa_min_audio_length = DEFAULT_PA_MIN_AUDIO_LENgTH; pulse_id->pa_current_rate = -1; pulse_id->pa_current_bps = -1; pulse_id->pa_current_channels = -1; if (!strcmp(pulse_id->pa_server, "default")) { pulse_id->pa_server = NULL; } if (pars[4] != NULL && atoi(pars[4]) != 0) pulse_id->pa_min_audio_length = atoi(pars[4]); pulse_id->pa_stop_playback = 0; ret = _pulse_open(pulse_id, 44100, 1, 2); if (ret) { g_free(pulse_id); pulse_id = NULL; } return (AudioID *) pulse_id; } static int pulse_play(AudioID * id, AudioTrack track) { int bytes_per_sample; int num_bytes; int outcnt = 0; signed short *output_samples; int i; int error; spd_pulse_id_t *pulse_id = (spd_pulse_id_t *) id; if (id == NULL) { return -1; } if (track.samples == NULL || track.num_samples <= 0) { return 0; } MSG("Starting playback\n"); /* Choose the correct format */ if (track.bits == 16) { bytes_per_sample = 2; } else if (track.bits == 8) { bytes_per_sample = 1; } else { MSG("ERROR: Unsupported sound data format, track.bits = %d\n", track.bits); return -1; } output_samples = track.samples; num_bytes = track.num_samples * bytes_per_sample; /* Check if the current connection has suitable parameters for this track */ if (pulse_id->pa_current_rate != track.sample_rate || pulse_id->pa_current_bps != track.bits || pulse_id->pa_current_channels != track.num_channels) { MSG("Reopenning connection due to change in track parameters sample_rate:%d bps:%d channels:%d\n", track.sample_rate, track.bits, track.num_channels); /* Close old connection if any */ pulse_connection_close(pulse_id); /* Open a new connection */ _pulse_open(pulse_id, track.sample_rate, track.num_channels, bytes_per_sample); /* Keep track of current connection parameters */ pulse_id->pa_current_rate = track.sample_rate; pulse_id->pa_current_bps = track.bits; pulse_id->pa_current_channels = track.num_channels; } MSG("bytes to play: %d, (%f secs)\n", num_bytes, (((float)(num_bytes) / 2) / (float)track.sample_rate)); pulse_id->pa_stop_playback = 0; outcnt = 0; i = 0; while ((outcnt < num_bytes) && !pulse_id->pa_stop_playback) { if ((num_bytes - outcnt) > PULSE_SEND_BYTES) { i = PULSE_SEND_BYTES; } else { i = (num_bytes - outcnt); } if (pa_simple_write (pulse_id->pa_simple, ((char *)output_samples) + outcnt, i, &error) < 0) { pa_simple_drain(pulse_id->pa_simple, NULL); pulse_connection_close(pulse_id); MSG("ERROR: Audio: pulse_play(): %s - closing device - re-open it in next run\n", pa_strerror(error)); break; } else { MSG("Pulse: wrote %u bytes\n", i); } outcnt += i; } return 0; } /* stop the pulse_play() loop */ static int pulse_stop(AudioID * id) { spd_pulse_id_t *pulse_id = (spd_pulse_id_t *) id; pulse_id->pa_stop_playback = 1; return 0; } static int pulse_close(AudioID * id) { spd_pulse_id_t *pulse_id = (spd_pulse_id_t *) id; pulse_connection_close(pulse_id); g_free(pulse_id); id = NULL; return 0; } static int pulse_set_volume(AudioID * id, int volume) { return 0; } static void pulse_set_loglevel(int level) { if (level) { pulse_log_level = level; } } static char const *pulse_get_playcmd(void) { return pulse_play_cmd; } /* Provide the pulse backend. */ static spd_audio_plugin_t pulse_functions = { "pulse", pulse_open, pulse_play, pulse_stop, pulse_close, pulse_set_volume, pulse_set_loglevel, pulse_get_playcmd }; spd_audio_plugin_t *pulse_plugin_get(void) { return &pulse_functions; } spd_audio_plugin_t *SPD_AUDIO_PLUGIN_ENTRY(void) __attribute__ ((weak, alias("pulse_plugin_get"))); speech-dispatcher-0.8/src/audio/nas.c0000664000175000017500000001431511777240701014526 00000000000000/* * nas.c -- The Network Audio System backend for the spd_audio library. * * Copyright (C) 2004,2006 Brailcom, o.p.s. * * This is free software; you can redistribute it and/or modify it under the * terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 2.1, or (at your option) any later * version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this package; see the file COPYING. If not, write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. * * $Id: nas.c,v 1.8 2006-07-11 16:12:26 hanke Exp $ */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include