\section{KSpeech Class Reference}
\label{classKSpeech}\index{KSpeech@{KSpeech}}
kspeech - the {\bf KDE} Text-to-Speech API.  


{\tt \#include $<$kspeech.h$>$}

Inheritance diagram for KSpeech:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=55pt]{classKSpeech__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KSpeech:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=55pt]{classKSpeech__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{CompactItemize}
\item 
enum {\bf kttsd\-Job\-State} \{ \par
{\bf js\-Queued} =  0, 
{\bf js\-Speakable} =  1, 
{\bf js\-Speaking} =  2, 
{\bf js\-Paused} =  3, 
\par
{\bf js\-Finished} =  4
 \}
\item 
enum {\bf kttsd\-Markup\-Type} \{ {\bf mt\-Plain} =  0, 
{\bf mt\-Jsml} =  1, 
{\bf mt\-Ssml} =  2, 
{\bf mt\-Sable} =  3
 \}
\end{CompactItemize}
\subsection*{DCOP Member Functions}
\begin{Indent}{\bf DCOP Methods}\par
\begin{CompactItemize}
\item 
virtual bool {\bf supports\-Markup} (const {\bf QString} \&talker, uint markup\-Type=0) const =0
\item 
virtual bool {\bf supports\-Markers} (const {\bf QString} \&talker) const =0
\item 
virtual ASYNC {\bf say\-Screen\-Reader\-Output} (const {\bf QString} \&msg, const {\bf QString} \&talker)=0
\item 
virtual ASYNC {\bf say\-Warning} (const {\bf QString} \&warning, const {\bf QString} \&talker)=0
\item 
virtual ASYNC {\bf say\-Message} (const {\bf QString} \&message, const {\bf QString} \&talker)=0
\item 
virtual ASYNC {\bf set\-Sentence\-Delimiter} (const {\bf QString} \&delimiter)=0
\item 
virtual uint {\bf set\-Text} (const {\bf QString} \&text, const {\bf QString} \&talker)=0
\item 
virtual int {\bf append\-Text} (const {\bf QString} \&text, uint job\-Num=0)=0
\item 
virtual uint {\bf set\-File} (const {\bf QString} \&filename, const {\bf QString} \&talker, const {\bf QString} \&encoding)=0
\item 
virtual int {\bf get\-Text\-Count} (uint job\-Num=0)=0
\item 
virtual uint {\bf get\-Current\-Text\-Job} ()=0
\item 
virtual uint {\bf get\-Text\-Job\-Count} ()=0
\item 
virtual {\bf QString} {\bf get\-Text\-Job\-Numbers} ()=0
\item 
virtual int {\bf get\-Text\-Job\-State} (uint job\-Num=0)=0
\item 
virtual {\bf QByte\-Array} {\bf get\-Text\-Job\-Info} (uint job\-Num=0)=0
\item 
virtual {\bf QString} {\bf talker\-Code\-To\-Talker\-Id} (const {\bf QString} \&talker\-Code)=0
\item 
virtual {\bf QString} {\bf get\-Text\-Job\-Sentence} (uint job\-Num=0, uint seq=0)=0
\item 
virtual bool {\bf is\-Speaking\-Text} () const =0
\item 
virtual ASYNC {\bf remove\-Text} (uint job\-Num=0)=0
\item 
virtual ASYNC {\bf start\-Text} (uint job\-Num=0)=0
\item 
virtual ASYNC {\bf stop\-Text} (uint job\-Num=0)=0
\item 
virtual ASYNC {\bf pause\-Text} (uint job\-Num=0)=0
\item 
virtual ASYNC {\bf resume\-Text} (uint job\-Num=0)=0
\item 
virtual {\bf QString\-List} {\bf get\-Talkers} ()=0
\item 
virtual ASYNC {\bf change\-Text\-Talker} (const {\bf QString} \&talker, uint job\-Num=0)=0
\item 
virtual {\bf QString} {\bf user\-Default\-Talker} ()=0
\item 
virtual ASYNC {\bf move\-Text\-Later} (uint job\-Num=0)=0
\item 
virtual int {\bf jump\-To\-Text\-Part} (int part\-Num, uint job\-Num=0)=0
\item 
virtual uint {\bf move\-Rel\-Text\-Sentence} (int n, uint job\-Num=0)=0
\item 
virtual ASYNC {\bf speak\-Clipboard} ()=0
\item 
virtual void {\bf show\-Dialog} ()=0
\item 
virtual void {\bf kttsd\-Exit} ()=0
\item 
virtual void {\bf reinit} ()=0
\end{CompactItemize}
\end{Indent}
\begin{Indent}{\bf DCOP Signals}\par
\begin{CompactItemize}
\item 
void {\bf kttsd\-Started} ()
\item 
void {\bf kttsd\-Exiting} ()
\item 
void {\bf marker\-Seen} (const {\bf QCString} \&app\-Id, const {\bf QString} \&marker\-Name)
\item 
void {\bf sentence\-Started} (const {\bf QCString} \&app\-Id, uint job\-Num, uint seq)
\item 
void {\bf sentence\-Finished} (const {\bf QCString} \&app\-Id, uint job\-Num, uint seq)
\item 
void {\bf text\-Set} (const {\bf QCString} \&app\-Id, uint job\-Num)
\item 
void {\bf text\-Appended} (const {\bf QCString} \&app\-Id, uint job\-Num, int part\-Num)
\item 
void {\bf text\-Started} (const {\bf QCString} \&app\-Id, uint job\-Num)
\item 
void {\bf text\-Finished} (const {\bf QCString} \&app\-Id, uint job\-Num)
\item 
void {\bf text\-Stopped} (const {\bf QCString} \&app\-Id, uint job\-Num)
\item 
void {\bf text\-Paused} (const {\bf QCString} \&app\-Id, uint job\-Num)
\item 
void {\bf text\-Resumed} (const {\bf QCString} \&app\-Id, uint job\-Num)
\item 
void {\bf text\-Removed} (const {\bf QCString} \&app\-Id, uint job\-Num)
\end{CompactItemize}
\end{Indent}
\subsection*{Public Attributes}
\begin{CompactItemize}
\item 
k\_\-dcop\_\-signals {\bf \_\-\_\-pad0\_\-\_\-}: void ignore\-This()\label{classKSpeech_o0}

\end{CompactItemize}


\subsection{Detailed Description}
kspeech - the {\bf KDE} Text-to-Speech API. 

\begin{Desc}
\item[Version:]1.0 Draft 9\end{Desc}
\begin{Desc}
\item[Since:]{\bf KDE} 3.4\end{Desc}
This class defines the DCOP interface for applications desiring to speak text. Applications may speak text by sending DCOP messages to application \char`\"{}kttsd\char`\"{} object \char`\"{}KSpeech\char`\"{}.

KTTSD -- the {\bf KDE} Text-to-Speech Deamon -- is the program that supplies the services in the {\bf KDE} Text-to-Speech API.

\begin{Desc}
\item[Warning:]The KSpeech interface is still being developed and is likely to change in the future.\end{Desc}
\subsection{Features}\label{classKSpeech_Features}
\begin{itemize}
\item Priority system for Screen Readers, warnings and messages, while still playing regular texts.\item Long text is parsed into sentences. User may backup by sentence or part, replay, pause, and stop playing.\item Handles multiple speaking applications. Text messages are treated like print jobs. Jobs may be created, started, stopped, paused, resumed, and deleted.\item Speak contents of clipboard.\item Speak {\bf KDE} notifications.\item Plugin-based text job filtering permits substitution for misspoken words, abbreviations, etc., transformation of XML or XHTML to SSML, and automatic choice of appropriate synthesis engine.\end{itemize}
\subsection{Requirements}\label{classKSpeech_Requirements}
You may build any {\bf KDE} application to use KSpeech, since the interface is in kdelibs, but the kdeaccessibility package must be installed for KTTS to function.

You will need a speech synthesis engine, such as Festival. See the KTTS Handbook for the latest information on installing and configuring speech engines and voices with KTTS.\subsection{Design Goals}\label{classKSpeech_goals}
The {\bf KDE} Text-to-Speech API is designed with the following goals:

\begin{itemize}
\item Support the features enumerated above.\item Plugin-based architecture for support of a wide variety of speech synthesis engines and drivers.\item Permit generation of speech from the command line (or via shell scripts) using the {\bf KDE} DCOP utilities.\item Provide a lightweight and easily usable interface for applications to generate speech output.\item Applications need not be concerned about contention over the speech device.\item Provide limited support for speech markup languages, such as Sable, Java Speech Markup Language (JSML), and Speech Markup Meta-language (SMML).\item Provide limited support for embedded speech markers.\item Asynchronous to prevent system blocking.\item Plugin-based audio architecture. Currently supports a\-Rts but will support additional audio engines in the future, such as gstreamer.\item Compatible with original KTTSD API as developed by Jos\~{A}169 Pablo Ezequiel \char`\"{}Pupeno\char`\"{} Fern\~{A}!`ndez (avoid breaking existing applications).\end{itemize}


Architecturally, applications interface with KTTSD, which performs queueing, speech job managment, plugin management and sentence parsing. KTTSD interfaces with a KTTSD speech plugin(s), which then interfaces with the speech engine(s) or driver(s).



\footnotesize\begin{verbatim}
         application
              ^
              |  via DCOP (the KDE Text-to-Speech API)
              v
            kttsd
              ^
              |  KTTSD plugin API
              v
         kttsd plugin
              ^
              |
              v
        speech engine
   \end{verbatim}
\normalsize


The KTTSD Plugin API is documented in Plugin\-Conf in the kdeaccessibility module.

There is a separate GUI application, called kttsmgr, for providing KTTSD configuration and job management.

kttsd maintains 4 types of speech output:\begin{itemize}
\item Screen Reader Output\item Warnings\item Messages\item Text Jobs\end{itemize}


Method {\bf say\-Screen\-Reader\-Output}{\rm (p.\,\pageref{classKSpeech_z1_2})} speaks Screen Reader output. It pre-empts any other speech in progress, including other Screen Reader outputs, i.e., it is not a queue. This method is reserved for use by Screen Readers.

Methods {\bf say\-Warning}{\rm (p.\,\pageref{classKSpeech_z1_3})} and {\bf say\-Message}{\rm (p.\,\pageref{classKSpeech_z1_4})} place messages into the Warnings and Messages queues respectively. Warnings take priority over messages, which take priority over text jobs. Warnings and messages are spoken when the currently-speaking sentence of a text job is finished.

{\bf set\-Text}{\rm (p.\,\pageref{classKSpeech_z1_6})} places text into the text job queue. {\bf start\-Text}{\rm (p.\,\pageref{classKSpeech_z1_19})} begins speaking jobs. When one job finishes, the next job begins. Method {\bf append\-Text}{\rm (p.\,\pageref{classKSpeech_z1_7})} adds additional parts to a text job. Within a text job, the application (and user via the kttsmgr GUI), may back up or advance by sentence or part, or rewind to the beginning. See {\bf jump\-To\-Text\-Part}{\rm (p.\,\pageref{classKSpeech_z1_27})} and {\bf move\-Rel\-Text\-Sentence}{\rm (p.\,\pageref{classKSpeech_z1_28})}. Text jobs may be paused, stopped, and resumed or deleted from the queue. See {\bf pause\-Text}{\rm (p.\,\pageref{classKSpeech_z1_21})}, {\bf stop\-Text}{\rm (p.\,\pageref{classKSpeech_z1_20})}, {\bf resume\-Text}{\rm (p.\,\pageref{classKSpeech_z1_22})}, and {\bf remove\-Text}{\rm (p.\,\pageref{classKSpeech_z1_18})}.\subsection{DCOP Command-line Interface}\label{classKSpeech_cmdline}
To create a text job to be spoken



\footnotesize\begin{verbatim}
     dcop kttsd KSpeech setText <text> <talker>
   \end{verbatim}
\normalsize


where $<$text$>$ is the text to be spoken, and $<$talker$>$ is usually a language code such as \char`\"{}en\char`\"{}, \char`\"{}cy\char`\"{}, etc.

Example.



\footnotesize\begin{verbatim}
     dcop kttsd KSpeech setText "This is a test." "en"
   \end{verbatim}
\normalsize


To start speaking the text.



\footnotesize\begin{verbatim}
     dcop kttsd KSpeech startText 0
   \end{verbatim}
\normalsize


To stop speaking and rewind to the beginning of the text.



\footnotesize\begin{verbatim}
     dcop kttsd KSpeech stopText 0
   \end{verbatim}
\normalsize


Depending upon the speech plugin used, speaking may not immediately stop.

To stop and remove a text job.



\footnotesize\begin{verbatim}
     dcop kttsd KSpeech removeText 0
   \end{verbatim}
\normalsize


Note: For more information about talker codes, see {\bf Talkers, Talker Codes, and Plugins}{\rm (p.\,\pageref{classKSpeech_talkers})} below.\subsection{Calling KTTSD from a Program}\label{classKSpeech_programming}
There are two methods of making DCOP calls from your application to KTTSD.

\begin{itemize}
\item Manually code them using dcop\-Client object. See kdebase/konqueror/kttsplugin/khtmlkttsd.cpp for an example. This method is recommended if you want to make a few simple calls to KTTSD.\item Use kspeech\_\-stub as described below. This method generates the marshalling code for you and is recommended for a more complex speech-enabled applications. kcmkttsmgr in the kdeaccessibility module is an example that uses this method.\end{itemize}


To make DCOP calls from your program using kspeech\_\-stub, follow these steps:

1. Include kspeech\_\-stub.h in your code. Derive an object from the KSpeech\_\-stub interface. For example, suppose you are developing a KPart and want to call KTTSD. Your class declaration might look like this:



\footnotesize\begin{verbatim}
     #include <kspeech_stub.h>
     class MyPart: public KParts::ReadOnlyPart, public KSpeech_stub {
   \end{verbatim}
\normalsize


2. In your class constructor, initialize {\bf DCOPStub}, giving it the sender \char`\"{}kttsd\char`\"{}, object \char`\"{}KSpeech\char`\"{}.



\footnotesize\begin{verbatim}
     MyPart::MyPart(QWidget *parent, const char *name) :
        KParts::ReadOnlyPart(parent, name),
        DCOPStub("kttsd", "KSpeech") {
   \end{verbatim}
\normalsize


3. See if KTTSD is running, and if not, start it.



\footnotesize\begin{verbatim}
     DCOPClient *client = dcopClient();
     client->attach();
     if (!client->isApplicationRegistered("kttsd")) {
         QString error;
         if (KApplication::startServiceByDesktopName("kttsd", QStringList(), &error))
             cout << "Starting KTTSD failed with message " << error << endl;
     }
   \end{verbatim}
\normalsize


4. Make calls to KTTSD in your code.



\footnotesize\begin{verbatim}
     uint jobNum = setText("Hello World", "en");
     startText(jobNum);
   \end{verbatim}
\normalsize


4. Add kspeech\_\-DIR and kspeech.stub to your Makefile.am. Example:



\footnotesize\begin{verbatim}
     kspeech_DIR = $(kde_includes)
     libmypart_la_SOURCES = kspeech.stub
   \end{verbatim}
\normalsize
\subsection{Signals Emitted by KTTSD}\label{classKSpeech_signals}
KTTSD emits a number of DCOP signals, which provide information about sentences spoken, text jobs started, stopped, paused, resumed, finished, or deleted and markers seen. In general, these signals are broadcast to any application that connects to them. Applications should check the app\-Id argument to determine whether the signal belongs to them or not.

To receive KTTSD DCOP signals, follow these steps:

1. Include {\bf kspeechsink.h}{\rm (p.\,\pageref{kspeechsink_8h})} in your code. Derive an object from the {\bf KSpeech\-Sink}{\rm (p.\,\pageref{classKSpeechSink})} interface and declare a method for each signal you'd like to receive. For example, if you were coding a KPart and wanted to receive the KTTSD signal sentence\-Started:



\footnotesize\begin{verbatim}
     #include <kspeechsink.h>
     class MyPart:
         public KParts::ReadOnlyPart,
         virtual public KSpeechSink
     {
         protected:
            ASYNC sentenceStarted(const QCString& appId, const uint jobNum, const uint seq);
   \end{verbatim}
\normalsize


You can combine sending and receiving in one object.



\footnotesize\begin{verbatim}
     #include <kspeechsink.h>
     class MyPart: 
         public KParts::ReadOnlyPart,
         public KSpeech_stub,
         virtual public KSpeechSink
     {
         protected:
            ASYNC sentenceStarted(const QCString& appId, const uint jobNum, const uint seq);
   \end{verbatim}
\normalsize


See below for the signals you can declare.

2. In your class constructor, initialize {\bf DCOPObject} with the name of your DCOP receiving object.



\footnotesize\begin{verbatim}
     MyPart::MyPart(QWidget *parent, const char *name) :
         KParts::ReadOnlyPart(parent, name),
         DCOPObject("mypart_kspeechsink") {
   \end{verbatim}
\normalsize


Use any name you like.

3. Where appropriate (usually in your constructor), make sure your {\bf DCOPClient} is registered and connect the KTTSD DCOP signals to your declared receiving methods.



\footnotesize\begin{verbatim}
     // Register DCOP client.
     DCOPClient *client = kapp->dcopClient();
     if (!client->isRegistered())
     {
         client->attach();
         client->registerAs(kapp->name());    
     }
     // Connect KTTSD DCOP signals to our slots.
     connectDCOPSignal("kttsd", "KSpeech",
         "sentenceStarted(QCString,uint,uint)",
         "sentenceStarted(QCString,uint,uint)",
         false);
   \end{verbatim}
\normalsize


Notice that the argument signatures differ slightly from the actual declarations. For example



\footnotesize\begin{verbatim}
     ASYNC sentenceStarted(const QCString& appId, const uint jobNum, const uint seq);
   \end{verbatim}
\normalsize


becomes



\footnotesize\begin{verbatim}
       "sentenceStarted(QCString,uint,uint)",
   \end{verbatim}
\normalsize


in the connect\-DCOPSignal call.

4. Write the definition for the received signal. Be sure to check whether the signal is intended for your application.



\footnotesize\begin{verbatim}
     ASYNC MyPart::sentenceStarted(const QCString& appId, const uint jobNum, const uint seq)
     {
         // Check appId to determine if this is our signal.
         if (appId != dcopClient()->appId()) return;
         // Do something here.
     }
   \end{verbatim}
\normalsize


5. Add kspeechsink\_\-DIR and kspeechsink.skel to your Makefile.am. Example for an app both sending and receiving.



\footnotesize\begin{verbatim}
     kspeech_DIR = $(kde_includes)
     kspeechsink_DIR = $(kde_includes)
     libmypart_la_SOURCES = kspeech.stub kspeechsink.skel
   \end{verbatim}
\normalsize
\subsection{Talkers, Talker Codes, and Plugins}\label{classKSpeech_talkers}
Many of the methods permit you to specify a desired \char`\"{}talker\char`\"{}. This may be a simple language code, such as \char`\"{}en\char`\"{} for English, \char`\"{}es\char`\"{} for Spanish, etc. Code as NULL to use the default configured talker.

Within KTTSMGR, the user has the ability to configure more than one talker for each language, with different voices, genders, volumes, and talking speeds.

Talker codes serve two functions:\begin{itemize}
\item They identify configured plugins, and\item They provide a way for applications to specify the desired speaking attributes that influence the choice of plugin to speak text.\end{itemize}


A Talker Code consists of a series of XML tags and attributes. An example of a full Talker Code with all attributes specified is

$<$voice lang=\char`\"{}en\char`\"{} name=\char`\"{}kal\char`\"{} gender=\char`\"{}male\char`\"{}/$>$ $<$prosody volume=\char`\"{}soft\char`\"{} rate=\char`\"{}fast\char`\"{}/$>$ $<$kttsd synthesizer=\char`\"{}Festival\char`\"{} /$>$

(The {\em voice\/} and {\em prosody\/} tags are adapted from the W3C Speech Synthesis Markup Language (SSML) and Java Speech Markup Language (JSML). The {\em kttsd\/} tag is an extension to the SMML and JSML languages to support named synthesizers and text encodings.) KTTS doesn't really care about the {\em voice\/}, {\em prosody\/}, and {\em kttsd\/} tags. In fact, they may be omitted and just the attributes specified. The example above then becomes

lang=\char`\"{}en\char`\"{} name=\char`\"{}kal\char`\"{} gender=\char`\"{}male\char`\"{} volume=\char`\"{}soft\char`\"{} rate=\char`\"{}fast\char`\"{} synthesizer=\char`\"{}Festival\char`\"{}

The attributes may be specified in any order.

For clarity, the rest of the discussion will omit the {\em voice\/}, {\em prosody\/}, and {\em kttsd\/} tags.

The attributes that make up a talker code are:

\begin{itemize}
\item {\em lang\/}. Language code and optional country code. Examples: en, es, en\_\-US, en\_\-GB. Codes are case in-sensitive and hyphen (-) or underscore (\_\-) may be used to separate the country code from the language code.\item {\em synthesizer\/}. The name of the synthesizer (plugin) used to produce the speech.\item {\em gender\/}. May be either \char`\"{}male\char`\"{}, \char`\"{}female\char`\"{}, or \char`\"{}neutral\char`\"{}.\item {\em name\/}. The name of the voice code. The choice of voice codes is synthesizer-specific.\item {\em volume\/}. May be \char`\"{}loud\char`\"{}, \char`\"{}medium\char`\"{}, or \char`\"{}quiet\char`\"{}. A synonym for \char`\"{}quiet\char`\"{} is \char`\"{}soft\char`\"{}.\item {\em rate\/}. May be \char`\"{}fast\char`\"{}, \char`\"{}medium\char`\"{}, or \char`\"{}slow\char`\"{}.\end{itemize}


Each plugin, once it has been configured by a user in kttsmgr, returns a fully-specified talker code to identify itself. If the plugin supports it, the user may configure another instance of the plugin with a different set of attributes. This is the difference between a \char`\"{}plugin\char`\"{} and a \char`\"{}talker\char`\"{}. A talker is a configured instance of a plugin. Each plugin (if it supports it) may be configured as multiple talkers.

When the user configures KTTSD, she configures one or more talkers and then places them in preferred order, top to bottom in kttsmgr. In effect, she specifies her preferences for each of the talkers.

When applications specify a talker code, they need not (and typically do not) give a full specification. An example of a talker code with only some of the attributes specified might be

lang=\char`\"{}en\char`\"{} gender=\char`\"{}female\char`\"{}

If the talker code is not in XML attribute format, it assumed to be a {\em lang\/} attribute. So the talker code

en

is interpreted as

lang=\char`\"{}en\char`\"{}

When a program requests a talker code in calls to {\bf set\-Text}{\rm (p.\,\pageref{classKSpeech_z1_6})}, {\bf append\-Text}{\rm (p.\,\pageref{classKSpeech_z1_7})}, {\bf say\-Message}{\rm (p.\,\pageref{classKSpeech_z1_4})}, {\bf say\-Warning}{\rm (p.\,\pageref{classKSpeech_z1_3})}, and {\bf say\-Screen\-Reader\-Output}{\rm (p.\,\pageref{classKSpeech_z1_2})}, KTTSD tries to match the requested talker code to the closest matching configured talker.

The {\em lang\/} attribute has highest priority (attempting to speak English with a Spanish synthesizer would likely be unintelligible). So the language attribute is said to have \char`\"{}priority\char`\"{}. If an application does not specify a language attribute, a default one will be assumed. The rest of the attributes are said to be \char`\"{}preferred\char`\"{}. If KTTSD cannot find a talker with the exact preferred attributes requested, the closest matching talker will likely still be understandable.

An application may specify that one or more of the attributes it gives in a talker code have priority by preceeding each priority attribute with an asterisk. For example, the following talker code

lang=\char`\"{}en\char`\"{} gender=\char`\"{}$\ast$female\char`\"{} volume=\char`\"{}soft\char`\"{}

means that the application wants to use a talker that supports American English language and Female gender. If there is more than one such talker, one that supports Soft volume would be preferred. Notice that a talker configured as English, Male, and Soft volume would not be picked as long as an English Female talker is available.

The algorithm used by KTTSD to find a matching talker is as follows:

\begin{itemize}
\item If language code is not specified by the application, assume default configured by user. The primary language code automatically has priority.\item (Note: This is not yet implemented.) If there are no talkers configured in the language, KTTSD will attempt to automatically configure one (see automatic configuraton discussion below)\item The talker that matches on the most priority attributes wins.\item If a tie, the one that matches on the most preferred attributes wins.\item If there is still a tie, the one nearest the top of the kttsmgr display (first configured) will be chosen.\end{itemize}


Language codes actually consist of two parts, a language code and an optional country code. For example, en\_\-GB is English (United Kingdom). The language code is treated as a priority attribute, but the country code (if specified) is treated as preferred. So for example, if an application requests the following talker code

lang=\char`\"{}en\_\-GB\char`\"{} gender=\char`\"{}male\char`\"{} volume=\char`\"{}medium\char`\"{}

then a talker configured as lang=\char`\"{}en\char`\"{} gender=\char`\"{}male\char`\"{} volume=\char`\"{}medium\char`\"{} would be picked over one configured as lang=\char`\"{}en\_\-GB\char`\"{} gender=\char`\"{}female\char`\"{} volume=\char`\"{}soft\char`\"{}, since the former matches on two preferred attributes and the latter only on the preferred attribute GB. An application can override this and make the country code priority with an asterisk. For example,

lang=\char`\"{}$\ast$en\_\-GB\char`\"{} gender=\char`\"{}male\char`\"{} volume=\char`\"{}medium\char`\"{}

To specify that American English is priority, put an asterisk in front of en\_\-US, like this.

lang=\char`\"{}$\ast$en\_\-US\char`\"{} gender=\char`\"{}male\char`\"{} volume=\char`\"{}medium\char`\"{}

Here the application is indicating that a talker that speaks American English has priorty over one that speaks a different form of English.

(Note: Not yet implemented). If a language code is specified, and no plugin is currently configured with a matching language code, KTTSD will attempt to automatically load and configure a plugin to support the requested language. If there is no such plugin, or there is a plugin but it cannot automatically configure itself, KTTSD will pick one of the configured plugins using the algorithm given above.

Notice that KTTSD will always pick a talker, even if it is a terrible match. (The principle is that something heard is better than nothing at all. If it sounds terrible, user will change his configuration.) If an attribute is absolutely mandatory -- in other words the application must speak with the attribute or not at all -- the application can determine if there are any talkers configured with the attribute by calling {\bf get\-Talkers}{\rm (p.\,\pageref{classKSpeech_z1_23})}, and if there are none, display an error message to the user.

Applications can implement their own talker-matching algorithm by calling {\bf get\-Talkers}{\rm (p.\,\pageref{classKSpeech_z1_23})}, then finding the desired talker from the returned list. When the full talker code is passed in, KKTSD will find an exact match and use the specified talker.

If an application requires a configuration that user has not created, it should display a message to user instructing them to run kttsmgr and configure the desired talker. (This must be done interactively because plugins often need user assistance locating voice files, etc.)

The above scheme is designed to balance the needs of applications against user preferences. Applications are given the control they {\em might\/} need, without unnecessarily burdening the application author. If you are an application author, the above discussion might seem overly complicated. It isn't really all that complicated. Here are rules of thumb:

\begin{itemize}
\item It is legitimate to give a NULL (0) talker code, in which case, the user's default talker will be used.\item If you know the language code, give that in the talker code, otherwise leave it out.\item If there is an attribute your application {\em requires\/} for proper functioning, specify that with an asterisk in front of it. For example, your app might speak in two different voices, Male and Female. (Since your app requires both genders, call {\bf get\-Talkers}{\rm (p.\,\pageref{classKSpeech_z1_23})} to determine if both genders are available, and if not, advise user to configure them. Better yet, give the user a choice of available distinquishing attributes (loud/soft, fast/slow, etc.)\item If there are other attributes you would prefer, specify those without an asterisk, but leave them out if it doesn't really make any difference to proper functioning of your application. Let the user decide them when they configure KTTS.\end{itemize}


One final note about talkers. KTTSD does talker matching for each sentence spoken, just before the sentence is sent to a plugin for synthesis. Therefore, the user can change the effective talker in mid processing of a text job by changing his preferences, or even deleting or adding new talkers to the configuration.\subsection{Speech Markup}\label{classKSpeech_markup}
Note: Speech Markup is not yet fully implemented in KTTSD.

Each of the five methods for queueing text to be spoken -- {\bf say\-Screen\-Reader\-Output}{\rm (p.\,\pageref{classKSpeech_z1_2})}, {\bf set\-Text}{\rm (p.\,\pageref{classKSpeech_z1_6})}, {\bf append\-Text}{\rm (p.\,\pageref{classKSpeech_z1_7})}, {\bf say\-Message}{\rm (p.\,\pageref{classKSpeech_z1_4})}, and {\bf say\-Warning}{\rm (p.\,\pageref{classKSpeech_z1_3})} -- may contain speech markup, provided that the plugin the user has configured supports that markup. The markup languages and plugins currently supported are:

\begin{itemize}
\item Speech Synthesis Markup language (SSML): Festival and Hadifix.\end{itemize}


This may change in the future as synthesizers improve.

Before including markup in the text sent to kttsd, the application should query whether the currently-configured plugin supports the markup language by calling {\bf supports\-Markup}{\rm (p.\,\pageref{classKSpeech_z1_0})}.

It it does not support the markup, it will be stripped out of the text.\subsection{Support for Markers}\label{classKSpeech_markers}
Note: Markers are not yet implemented in KTTSD.

When using a speech markup language, such as Sable, JSML, or SSML, the application may embed named markers into the text. If the user's chosen speech plugin supports markers, KTTSD will emit DCOP signal {\bf marker\-Seen}{\rm (p.\,\pageref{classKSpeech_z3_2})} when the speech engine encounters the marker. Depending upon the speech engine and plugin, this may occur either when the speech engine encounters the marker during synthesis from text to speech, or when the speech is actually spoken on the audio device. The calling application can call the {\bf supports\-Markers}{\rm (p.\,\pageref{classKSpeech_z1_1})} method to determine if the currently configured plugin supports markers or not.\subsection{Sentence Parsing}\label{classKSpeech_sentenceparsing}
Not all speech engines provide robust capabilities for stopping synthesis that is in progress. To compensate for this, KTTSD parses text jobs given to it by the {\bf set\-Text}{\rm (p.\,\pageref{classKSpeech_z1_6})} and {\bf append\-Text}{\rm (p.\,\pageref{classKSpeech_z1_7})} methods into sentences and sends the sentences to the speech plugin one at a time. In this way, should the user wish to stop the speech output, they can do so, and the worst that will happen is that the last sentence will be completed. This is called Sentence Boundary Detection (SBD).

Sentence Boundary Detection also permits the user to rewind by sentences.

The default sentence delimiter used for plain text is as follows:

\begin{itemize}
\item A period (.), question mark (?), exclamation mark (!), colon (:), or semi-colon (;) followed by whitespace (including newline), or\item Two newlines in a row separated by optional whitespace, or\item The end of the text.\end{itemize}


When given text containing speech markup, KTTSD automatically determines the markup type and parses based on the sentence semantics of the markup language.

An application may change the sentence delimiter by calling {\bf set\-Sentence\-Delimiter}{\rm (p.\,\pageref{classKSpeech_z1_5})} prior to calling {\bf set\-Text}{\rm (p.\,\pageref{classKSpeech_z1_6})}. Changing the delimiter does not affect other applications.

Text given to KTTSD via the {\bf say\-Warning}{\rm (p.\,\pageref{classKSpeech_z1_3})}, {\bf say\-Message}{\rm (p.\,\pageref{classKSpeech_z1_4})}, and {\bf say\-Screen\-Reader\-Output}{\rm (p.\,\pageref{classKSpeech_z1_2})} methods is {\em not\/} parsed into sentences. For this reason, applications should {\em not\/} send long messages with these methods.\subsection{Authors}\label{classKSpeech_authors}
\begin{Desc}
\item[Author:]Jos\~{A}169 Pablo Ezequiel \char`\"{}Pupeno\char`\"{} Fern\~{A}!`ndez $<${\tt pupeno@kde.org}$>$ 

Gary Cramblitt $<${\tt garycramblitt@comcast.net}$>$ 

Olaf Schmidt $<${\tt ojschmidt@kde.org}$>$ 

Gunnar Schmi Dt $<${\tt gunnar@schmi-dt.de}$>$ \end{Desc}




Definition at line 600 of file kspeech.h.

\subsection{Member Enumeration Documentation}
\index{KSpeech@{KSpeech}!kttsdJobState@{kttsdJobState}}
\index{kttsdJobState@{kttsdJobState}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum {\bf KSpeech::kttsd\-Job\-State}}\label{classKSpeech_w9}


Job states returned by method {\bf get\-Text\-Job\-State}{\rm (p.\,\pageref{classKSpeech_z1_13})}. 

\begin{Desc}
\item[Enumeration values: ]\par
\begin{description}
\index{jsQueued@{jsQueued}!KSpeech@{KSpeech}}\index{KSpeech@{KSpeech}!jsQueued@{jsQueued}}\item[{\em 
js\-Queued\label{classKSpeech_w9w0}
}]Job has been queued but is not yet speakable. \index{jsSpeakable@{jsSpeakable}!KSpeech@{KSpeech}}\index{KSpeech@{KSpeech}!jsSpeakable@{jsSpeakable}}\item[{\em 
js\-Speakable\label{classKSpeech_w9w1}
}]Job is speakable, but is not speaking. \index{jsSpeaking@{jsSpeaking}!KSpeech@{KSpeech}}\index{KSpeech@{KSpeech}!jsSpeaking@{jsSpeaking}}\item[{\em 
js\-Speaking\label{classKSpeech_w9w2}
}]Job is currently speaking. \index{jsPaused@{jsPaused}!KSpeech@{KSpeech}}\index{KSpeech@{KSpeech}!jsPaused@{jsPaused}}\item[{\em 
js\-Paused\label{classKSpeech_w9w3}
}]Job has been paused. \index{jsFinished@{jsFinished}!KSpeech@{KSpeech}}\index{KSpeech@{KSpeech}!jsFinished@{jsFinished}}\item[{\em 
js\-Finished\label{classKSpeech_w9w4}
}]Job is finished and is deleteable. \end{description}
\end{Desc}



Definition at line 608 of file kspeech.h.\index{KSpeech@{KSpeech}!kttsdMarkupType@{kttsdMarkupType}}
\index{kttsdMarkupType@{kttsdMarkupType}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum {\bf KSpeech::kttsd\-Markup\-Type}}\label{classKSpeech_w10}


Speech markup language types. 

\begin{Desc}
\item[Enumeration values: ]\par
\begin{description}
\index{mtPlain@{mtPlain}!KSpeech@{KSpeech}}\index{KSpeech@{KSpeech}!mtPlain@{mtPlain}}\item[{\em 
mt\-Plain\label{classKSpeech_w10w5}
}]Plain text. \index{mtJsml@{mtJsml}!KSpeech@{KSpeech}}\index{KSpeech@{KSpeech}!mtJsml@{mtJsml}}\item[{\em 
mt\-Jsml\label{classKSpeech_w10w6}
}]Java Speech Markup Language. \index{mtSsml@{mtSsml}!KSpeech@{KSpeech}}\index{KSpeech@{KSpeech}!mtSsml@{mtSsml}}\item[{\em 
mt\-Ssml\label{classKSpeech_w10w7}
}]Speech Synthesis Markup Language \index{mtSable@{mtSable}!KSpeech@{KSpeech}}\index{KSpeech@{KSpeech}!mtSable@{mtSable}}\item[{\em 
mt\-Sable\label{classKSpeech_w10w8}
}]Sable 2.0. \end{description}
\end{Desc}



Definition at line 621 of file kspeech.h.

\subsection{Member Function Documentation}
\index{KSpeech@{KSpeech}!supportsMarkup@{supportsMarkup}}
\index{supportsMarkup@{supportsMarkup}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual bool KSpeech::supports\-Markup (const {\bf QString} \& {\em talker}, uint {\em markup\-Type} = {\tt 0}) const\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKSpeech_z1_0}


Determine whether the currently-configured speech plugin supports a speech markup language. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em talker}]Code for the talker to do the speaking. Example \char`\"{}en\char`\"{}. If NULL, defaults to the user's default talker. \item[{\em markup\-Type}]The kttsd code for the desired speech markup language. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]True if the plugin currently configured for the indicated talker supports the indicated speech markup language. \end{Desc}
\begin{Desc}
\item[See also:]{\bf kttsd\-Markup\-Type}{\rm (p.\,\pageref{classKSpeech_w10})} \end{Desc}
\index{KSpeech@{KSpeech}!supportsMarkers@{supportsMarkers}}
\index{supportsMarkers@{supportsMarkers}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual bool KSpeech::supports\-Markers (const {\bf QString} \& {\em talker}) const\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKSpeech_z1_1}


Determine whether the currently-configured speech plugin supports markers in speech markup. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em talker}]Code for the talker to do the speaking. Example \char`\"{}en\char`\"{}. If NULL, defaults to the user's default talker. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]True if the plugin currently configured for the indicated talker supports markers. \end{Desc}
\index{KSpeech@{KSpeech}!sayScreenReaderOutput@{sayScreenReaderOutput}}
\index{sayScreenReaderOutput@{sayScreenReaderOutput}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual ASYNC KSpeech::say\-Screen\-Reader\-Output (const {\bf QString} \& {\em msg}, const {\bf QString} \& {\em talker})\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKSpeech_z1_2}


Say a message as soon as possible, interrupting any other speech in progress. 

IMPORTANT: This method is reserved for use by Screen Readers and should not be used by any other applications. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em msg}]The message to be spoken. \item[{\em talker}]Code for the talker to do the speaking. Example \char`\"{}en\char`\"{}. If NULL, defaults to the user's default talker. If no plugin has been configured for the specified Talker code, defaults to the closest matching talker.\end{description}
\end{Desc}
If an existing Screen Reader output is in progress, it is stopped and discarded and replaced with this new message. \index{KSpeech@{KSpeech}!sayWarning@{sayWarning}}
\index{sayWarning@{sayWarning}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual ASYNC KSpeech::say\-Warning (const {\bf QString} \& {\em warning}, const {\bf QString} \& {\em talker})\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKSpeech_z1_3}


Say a warning. 

The warning will be spoken when the current sentence stops speaking and takes precedence over Messages and regular text. Warnings should only be used for high-priority messages requiring immediate user attention, such as \char`\"{}WARNING. CPU is overheating.\char`\"{} \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em warning}]The warning to be spoken. \item[{\em talker}]Code for the talker to do the speaking. Example \char`\"{}en\char`\"{}. If NULL, defaults to the user's default talker. If no plugin has been configured for the specified Talker code, defaults to the closest matching talker. \end{description}
\end{Desc}
\index{KSpeech@{KSpeech}!sayMessage@{sayMessage}}
\index{sayMessage@{sayMessage}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual ASYNC KSpeech::say\-Message (const {\bf QString} \& {\em message}, const {\bf QString} \& {\em talker})\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKSpeech_z1_4}


Say a message. 

The message will be spoken when the current sentence stops speaking but after any warnings have been spoken. Messages should be used for one-shot messages that can't wait for normal text messages to stop speaking, such as \char`\"{}You have mail.\char`\"{}. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em message}]The message to be spoken. \item[{\em talker}]Code for the talker to do the speaking. Example \char`\"{}en\char`\"{}. If NULL, defaults to the user's default talker. If no talker has been configured for the specified talker code, defaults to the closest matching talker. \end{description}
\end{Desc}
\index{KSpeech@{KSpeech}!setSentenceDelimiter@{setSentenceDelimiter}}
\index{setSentenceDelimiter@{setSentenceDelimiter}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual ASYNC KSpeech::set\-Sentence\-Delimiter (const {\bf QString} \& {\em delimiter})\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKSpeech_z1_5}


Sets the GREP pattern that will be used as the sentence delimiter. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em delimiter}]A valid GREP pattern.\end{description}
\end{Desc}
The default sentence delimiter is 

\footnotesize\begin{verbatim}
              ([\\.\\?\\!\\:\\;])(\\s|$|(\\n *\\n))
          \end{verbatim}
\normalsize


Note that backward slashes must be escaped. When KTTSD parses the text, it replaces all tabs, spaces, and formfeeds with a single space, and then replaces the sentence delimiters using the following statement: 

\footnotesize\begin{verbatim}
              QString::replace(sentenceDelimiter, "\\1\t");
          \end{verbatim}
\normalsize


which replaces all sentence delimiters with a tab, but preserving the first capture text (first parenthesis). In other words, the sentence punctuation is preserved. The tab is later used to separate the text into sentences.

Changing the sentence delimiter does not affect other applications.

\begin{Desc}
\item[See also:]sentenceparsing \end{Desc}
\index{KSpeech@{KSpeech}!setText@{setText}}
\index{setText@{setText}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual uint KSpeech::set\-Text (const {\bf QString} \& {\em text}, const {\bf QString} \& {\em talker})\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKSpeech_z1_6}


Queue a text job. 

Does not start speaking the text. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em text}]The message to be spoken. \item[{\em talker}]Code for the talker to do the speaking. Example \char`\"{}en\char`\"{}. If NULL, defaults to the user's default plugin. If no plugin has been configured for the specified Talker code, defaults to the closest matching talker. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Job number.\end{Desc}
Plain text is parsed into individual sentences using the current sentence delimiter. Call {\bf set\-Sentence\-Delimiter}{\rm (p.\,\pageref{classKSpeech_z1_5})} to change the sentence delimiter prior to calling set\-Text. Call {\bf get\-Text\-Count}{\rm (p.\,\pageref{classKSpeech_z1_9})} to retrieve the sentence count after calling set\-Text.

The text may contain speech mark language, such as Sable, JSML, or SSML, provided that the speech plugin/engine support it. In this case, sentence parsing follows the semantics of the markup language.

Call {\bf start\-Text}{\rm (p.\,\pageref{classKSpeech_z1_19})} to mark the job as speakable and if the job is the first speakable job in the queue, speaking will begin.

\begin{Desc}
\item[See also:]{\bf get\-Text\-Count}{\rm (p.\,\pageref{classKSpeech_z1_9})} 

{\bf start\-Text}{\rm (p.\,\pageref{classKSpeech_z1_19})} \end{Desc}
\index{KSpeech@{KSpeech}!appendText@{appendText}}
\index{appendText@{appendText}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual int KSpeech::append\-Text (const {\bf QString} \& {\em text}, uint {\em job\-Num} = {\tt 0})\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKSpeech_z1_7}


Adds another part to a text job. 

Does not start speaking the text. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em text}]The message to be spoken. \item[{\em job\-Num}]Job number of the text job. If zero, applies to the last job queued by the application, but if no such job, applies to the current job (if any). \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Part number for the added part. Parts are numbered starting at 1.\end{Desc}
The text is parsed into individual sentences. Call get\-Text\-Count to retrieve the sentence count. Call start\-Text to mark the job as speakable and if the job is the first speakable job in the queue, speaking will begin.

\begin{Desc}
\item[See also:]{\bf set\-Text}{\rm (p.\,\pageref{classKSpeech_z1_6})}. 

{\bf start\-Text}{\rm (p.\,\pageref{classKSpeech_z1_19})}. \end{Desc}
\index{KSpeech@{KSpeech}!setFile@{setFile}}
\index{setFile@{setFile}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual uint KSpeech::set\-File (const {\bf QString} \& {\em filename}, const {\bf QString} \& {\em talker}, const {\bf QString} \& {\em encoding})\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKSpeech_z1_8}


Queue a text job from the contents of a file. 

Does not start speaking the text. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em filename}]Full path to the file to be spoken. May be a URL. \item[{\em talker}]Code for the talker to do the speaking. Example \char`\"{}en\char`\"{}. If NULL, defaults to the user's default talker. If no plugin has been configured for the specified Talker code, defaults to the closest matching talker. \item[{\em encoding}]Name of the encoding to use when reading the file. If NULL or Empty, uses default stream encoding. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Job number. 0 if an error occurs.\end{Desc}
Plain text is parsed into individual sentences using the current sentence delimiter. Call {\bf set\-Sentence\-Delimiter}{\rm (p.\,\pageref{classKSpeech_z1_5})} to change the sentence delimiter prior to calling set\-Text. Call {\bf get\-Text\-Count}{\rm (p.\,\pageref{classKSpeech_z1_9})} to retrieve the sentence count after calling set\-Text.

The text may contain speech mark language, such as Sable, JSML, or SSML, provided that the speech plugin/engine support it. In this case, sentence parsing follows the semantics of the markup language.

Call {\bf start\-Text}{\rm (p.\,\pageref{classKSpeech_z1_19})} to mark the job as speakable and if the job is the first speakable job in the queue, speaking will begin.

\begin{Desc}
\item[See also:]{\bf get\-Text\-Count}{\rm (p.\,\pageref{classKSpeech_z1_9})} 

{\bf start\-Text}{\rm (p.\,\pageref{classKSpeech_z1_19})} \end{Desc}
\index{KSpeech@{KSpeech}!getTextCount@{getTextCount}}
\index{getTextCount@{getTextCount}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual int KSpeech::get\-Text\-Count (uint {\em job\-Num} = {\tt 0})\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKSpeech_z1_9}


Get the number of sentences in a text job. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em job\-Num}]Job number of the text job. If zero, applies to the last job queued by the application, but if no such job, applies to the current job (if any). \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The number of sentences in the job. -1 if no such job.\end{Desc}
The sentences of a job are given sequence numbers from 1 to the number returned by this method. The sequence numbers are emitted in the {\bf sentence\-Started}{\rm (p.\,\pageref{classKSpeech_z3_3})} and {\bf sentence\-Finished}{\rm (p.\,\pageref{classKSpeech_z3_4})} signals. \index{KSpeech@{KSpeech}!getCurrentTextJob@{getCurrentTextJob}}
\index{getCurrentTextJob@{getCurrentTextJob}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual uint KSpeech::get\-Current\-Text\-Job ()\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKSpeech_z1_10}


Get the job number of the current text job. 

\begin{Desc}
\item[Returns:]Job number of the current text job. 0 if no jobs.\end{Desc}
Note that the current job may not be speaking. See {\bf is\-Speaking\-Text}{\rm (p.\,\pageref{classKSpeech_z1_17})}.

\begin{Desc}
\item[See also:]{\bf get\-Text\-Job\-State}{\rm (p.\,\pageref{classKSpeech_z1_13})}. 

{\bf is\-Speaking\-Text}{\rm (p.\,\pageref{classKSpeech_z1_17})} \end{Desc}
\index{KSpeech@{KSpeech}!getTextJobCount@{getTextJobCount}}
\index{getTextJobCount@{getTextJobCount}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual uint KSpeech::get\-Text\-Job\-Count ()\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKSpeech_z1_11}


Get the number of jobs in the text job queue. 

\begin{Desc}
\item[Returns:]Number of text jobs in the queue. 0 if none. \end{Desc}
\index{KSpeech@{KSpeech}!getTextJobNumbers@{getTextJobNumbers}}
\index{getTextJobNumbers@{getTextJobNumbers}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf QString} KSpeech::get\-Text\-Job\-Numbers ()\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKSpeech_z1_12}


Get a comma-separated list of text job numbers in the queue. 

\begin{Desc}
\item[Returns:]Comma-separated list of text job numbers in the queue. \end{Desc}
\index{KSpeech@{KSpeech}!getTextJobState@{getTextJobState}}
\index{getTextJobState@{getTextJobState}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual int KSpeech::get\-Text\-Job\-State (uint {\em job\-Num} = {\tt 0})\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKSpeech_z1_13}


Get the state of a text job. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em job\-Num}]Job number of the text job. If zero, applies to the last job queued by the application, but if no such job, applies to the current job (if any). \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]State of the job. -1 if invalid job number.\end{Desc}
\begin{Desc}
\item[See also:]{\bf kttsd\-Job\-State}{\rm (p.\,\pageref{classKSpeech_w9})} \end{Desc}
\index{KSpeech@{KSpeech}!getTextJobInfo@{getTextJobInfo}}
\index{getTextJobInfo@{getTextJobInfo}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf QByte\-Array} KSpeech::get\-Text\-Job\-Info (uint {\em job\-Num} = {\tt 0})\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKSpeech_z1_14}


Get information about a text job. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em job\-Num}]Job number of the text job. If zero, applies to the last job queued by the application, but if no such job, applies to the current job (if any). \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A {\bf QData\-Stream} containing information about the job. Blank if no such job.\end{Desc}
The stream contains the following elements:\begin{itemize}
\item int state - Job state.\item {\bf QCString} app\-Id - DCOP sender\-Id of the application that requested the speech job.\item {\bf QString} talker - Talker Code requested by application.\item int seq - Current sentence being spoken. Sentences are numbered starting at 1.\item int sentence\-Count - Total number of sentences in the job.\item int part\-Num - Current part of the job begin spoken. Parts are numbered starting at 1.\item int part\-Count - Total number of parts in the job.\end{itemize}


Note that sequence numbers apply to the entire job. They do not start from 1 at the beginning of each part.

The following sample code will decode the stream: 

\footnotesize\begin{verbatim}                    QByteArray jobInfo = getTextJobInfo(jobNum);
                    QDataStream stream(jobInfo, IO_ReadOnly);
                    int state;
                    QCString appId;
                    QString talker;
                    int seq;
                    int sentenceCount;
                    int partNum;
                    int partCount;
                    stream >> state;
                    stream >> appId;
                    stream >> talker;
                    stream >> seq;
                    stream >> sentenceCount;
                    stream >> partNum;
                    stream >> partCount;
\end{verbatim}
\normalsize
 \index{KSpeech@{KSpeech}!talkerCodeToTalkerId@{talkerCodeToTalkerId}}
\index{talkerCodeToTalkerId@{talkerCodeToTalkerId}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf QString} KSpeech::talker\-Code\-To\-Talker\-Id (const {\bf QString} \& {\em talker\-Code})\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKSpeech_z1_15}


Given a Talker Code, returns the Talker ID of the talker that would speak a text job with that Talker Code. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em talker\-Code}]Talker Code. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Talker ID of the talker that would speak the text job. \end{Desc}
\index{KSpeech@{KSpeech}!getTextJobSentence@{getTextJobSentence}}
\index{getTextJobSentence@{getTextJobSentence}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf QString} KSpeech::get\-Text\-Job\-Sentence (uint {\em job\-Num} = {\tt 0}, uint {\em seq} = {\tt 0})\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKSpeech_z1_16}


Return a sentence of a job. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em job\-Num}]Job number of the text job. If zero, applies to the last job queued by the application, but if no such job, applies to the current job (if any). \item[{\em seq}]Sequence number of the sentence. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The specified sentence in the specified job. If no such job or sentence, returns \char`\"{}\char`\"{}. \end{Desc}
\index{KSpeech@{KSpeech}!isSpeakingText@{isSpeakingText}}
\index{isSpeakingText@{isSpeakingText}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual bool KSpeech::is\-Speaking\-Text () const\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKSpeech_z1_17}


Determine if kttsd is currently speaking any text jobs. 

\begin{Desc}
\item[Returns:]True if currently speaking any text jobs. \end{Desc}
\index{KSpeech@{KSpeech}!removeText@{removeText}}
\index{removeText@{removeText}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual ASYNC KSpeech::remove\-Text (uint {\em job\-Num} = {\tt 0})\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKSpeech_z1_18}


Remove a text job from the queue. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em job\-Num}]Job number of the text job. If zero, applies to the last job queued by the application, but if no such job, applies to the current job (if any).\end{description}
\end{Desc}
The job is deleted from the queue and the {\bf text\-Removed}{\rm (p.\,\pageref{classKSpeech_z3_12})} signal is emitted.

If there is another job in the text queue, and it is marked speakable, that job begins speaking. \index{KSpeech@{KSpeech}!startText@{startText}}
\index{startText@{startText}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual ASYNC KSpeech::start\-Text (uint {\em job\-Num} = {\tt 0})\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKSpeech_z1_19}


Start a text job at the beginning. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em job\-Num}]Job number of the text job. If zero, applies to the last job queued by the application, but if no such job, applies to the current job (if any).\end{description}
\end{Desc}
Rewinds the job to the beginning.

The job is marked speakable. If there are other speakable jobs preceeding this one in the queue, those jobs continue speaking and when finished, this job will begin speaking. If there are no other speakable jobs preceeding this one, it begins speaking.

The {\bf text\-Started}{\rm (p.\,\pageref{classKSpeech_z3_7})} signal is emitted when the text job begins speaking. When all the sentences of the job have been spoken, the job is marked for deletion from the text queue and the {\bf text\-Finished}{\rm (p.\,\pageref{classKSpeech_z3_8})} signal is emitted. \index{KSpeech@{KSpeech}!stopText@{stopText}}
\index{stopText@{stopText}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual ASYNC KSpeech::stop\-Text (uint {\em job\-Num} = {\tt 0})\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKSpeech_z1_20}


Stop a text job and rewind to the beginning. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em job\-Num}]Job number of the text job. If zero, applies to the last job queued by the application, but if no such job, applies to the current job (if any).\end{description}
\end{Desc}
The job is marked not speakable and will not be speakable until {\bf start\-Text}{\rm (p.\,\pageref{classKSpeech_z1_19})} or {\bf resume\-Text}{\rm (p.\,\pageref{classKSpeech_z1_22})} is called.

If there are speaking jobs preceeding this one in the queue, they continue speaking.

If the job is currently speaking, the {\bf text\-Stopped}{\rm (p.\,\pageref{classKSpeech_z3_9})} signal is emitted, the job stops speaking, and if the next job in the queue is speakable, it begins speaking.

Depending upon the speech engine and plugin used, speeking may not stop immediately (it might finish the current sentence). \index{KSpeech@{KSpeech}!pauseText@{pauseText}}
\index{pauseText@{pauseText}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual ASYNC KSpeech::pause\-Text (uint {\em job\-Num} = {\tt 0})\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKSpeech_z1_21}


Pause a text job. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em job\-Num}]Job number of the text job. If zero, applies to the last job queued by the application, but if no such job, applies to the current job (if any).\end{description}
\end{Desc}
The job is marked as paused and will not be speakable until {\bf resume\-Text}{\rm (p.\,\pageref{classKSpeech_z1_22})} or {\bf start\-Text}{\rm (p.\,\pageref{classKSpeech_z1_19})} is called.

If there are speaking jobs preceeding this one in the queue, they continue speaking.

If the job is currently speaking, the {\bf text\-Paused}{\rm (p.\,\pageref{classKSpeech_z3_10})} signal is emitted and the job stops speaking. Note that if the next job in the queue is speakable, it does not start speaking as long as this job is paused.

Depending upon the speech engine and plugin used, speeking may not stop immediately (it might finish the current sentence).

\begin{Desc}
\item[See also:]{\bf resume\-Text}{\rm (p.\,\pageref{classKSpeech_z1_22})} \end{Desc}
\index{KSpeech@{KSpeech}!resumeText@{resumeText}}
\index{resumeText@{resumeText}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual ASYNC KSpeech::resume\-Text (uint {\em job\-Num} = {\tt 0})\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKSpeech_z1_22}


Start or resume a text job where it was paused. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em job\-Num}]Job number of the text job. If zero, applies to the last job queued by the application, but if no such job, applies to the current job (if any).\end{description}
\end{Desc}
The job is marked speakable.

If the job was not paused, it is the same as calling {\bf start\-Text}{\rm (p.\,\pageref{classKSpeech_z1_19})}.

If there are speaking jobs preceeding this one in the queue, those jobs continue speaking and when finished this job will begin speaking where it left off.

The {\bf text\-Resumed}{\rm (p.\,\pageref{classKSpeech_z3_11})} signal is emitted when the job resumes.

\begin{Desc}
\item[See also:]{\bf pause\-Text}{\rm (p.\,\pageref{classKSpeech_z1_21})} \end{Desc}
\index{KSpeech@{KSpeech}!getTalkers@{getTalkers}}
\index{getTalkers@{getTalkers}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf QString\-List} KSpeech::get\-Talkers ()\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKSpeech_z1_23}


Get a list of the talkers configured in KTTS. 

\begin{Desc}
\item[Returns:]A {\bf QString\-List} of fully-specified talker codes, one for each talker user has configured.\end{Desc}
\begin{Desc}
\item[See also:]talkers \end{Desc}
\index{KSpeech@{KSpeech}!changeTextTalker@{changeTextTalker}}
\index{changeTextTalker@{changeTextTalker}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual ASYNC KSpeech::change\-Text\-Talker (const {\bf QString} \& {\em talker}, uint {\em job\-Num} = {\tt 0})\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKSpeech_z1_24}


Change the talker for a text job. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em job\-Num}]Job number of the text job. If zero, applies to the last job queued by the application, but if no such job, applies to the current job (if any). \item[{\em talker}]New code for the talker to do the speaking. Example \char`\"{}en\char`\"{}. If NULL, defaults to the user's default talker. If no plugin has been configured for the specified Talker code, defaults to the closest matching talker. \end{description}
\end{Desc}
\index{KSpeech@{KSpeech}!userDefaultTalker@{userDefaultTalker}}
\index{userDefaultTalker@{userDefaultTalker}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf QString} KSpeech::user\-Default\-Talker ()\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKSpeech_z1_25}


Get the user's default talker. 

\begin{Desc}
\item[Returns:]A fully-specified talker code.\end{Desc}
\begin{Desc}
\item[See also:]talkers 

{\bf get\-Talkers}{\rm (p.\,\pageref{classKSpeech_z1_23})} \end{Desc}
\index{KSpeech@{KSpeech}!moveTextLater@{moveTextLater}}
\index{moveTextLater@{moveTextLater}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual ASYNC KSpeech::move\-Text\-Later (uint {\em job\-Num} = {\tt 0})\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKSpeech_z1_26}


Move a text job down in the queue so that it is spoken later. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em job\-Num}]Job number of the text job. If zero, applies to the last job queued by the application, but if no such job, applies to the current job (if any).\end{description}
\end{Desc}
If the job is currently speaking, it is paused. If the next job in the queue is speakable, it begins speaking. \index{KSpeech@{KSpeech}!jumpToTextPart@{jumpToTextPart}}
\index{jumpToTextPart@{jumpToTextPart}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual int KSpeech::jump\-To\-Text\-Part (int {\em part\-Num}, uint {\em job\-Num} = {\tt 0})\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKSpeech_z1_27}


Jump to the first sentence of a specified part of a text job. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em part\-Num}]Part number of the part to jump to. Parts are numbered starting at 1. \item[{\em job\-Num}]Job number of the text job. If zero, applies to the last job queued by the application, but if no such job, applies to the current job (if any). \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Part number of the part actually jumped to.\end{Desc}
If part\-Num is greater than the number of parts in the job, jumps to last part. If part\-Num is 0, does nothing and returns the current part number. If no such job, does nothing and returns 0. Does not affect the current speaking/not-speaking state of the job. \index{KSpeech@{KSpeech}!moveRelTextSentence@{moveRelTextSentence}}
\index{moveRelTextSentence@{moveRelTextSentence}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual uint KSpeech::move\-Rel\-Text\-Sentence (int {\em n}, uint {\em job\-Num} = {\tt 0})\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKSpeech_z1_28}


Advance or rewind N sentences in a text job. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em n}]Number of sentences to advance (positive) or rewind (negative) in the job. \item[{\em job\-Num}]Job number of the text job. If zero, applies to the last job queued by the application, but if no such job, applies to the current job (if any). \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Sequence number of the sentence actually moved to. Sequence numbers are numbered starting at 1.\end{Desc}
If no such job, does nothing and returns 0. If n is zero, returns the current sequence number of the job. Does not affect the current speaking/not-speaking state of the job. \index{KSpeech@{KSpeech}!speakClipboard@{speakClipboard}}
\index{speakClipboard@{speakClipboard}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual ASYNC KSpeech::speak\-Clipboard ()\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKSpeech_z1_29}


Add the clipboard contents to the text queue and begin speaking it. 

\index{KSpeech@{KSpeech}!showDialog@{showDialog}}
\index{showDialog@{showDialog}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual void KSpeech::show\-Dialog ()\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKSpeech_z1_30}


Displays the KTTS Manager dialog. 

In this dialog, the user may backup or skip forward in any text job by sentence or part, rewind jobs, pause or resume jobs, or delete jobs. \index{KSpeech@{KSpeech}!kttsdExit@{kttsdExit}}
\index{kttsdExit@{kttsdExit}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual void KSpeech::kttsd\-Exit ()\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKSpeech_z1_31}


Stop the service. 

\index{KSpeech@{KSpeech}!reinit@{reinit}}
\index{reinit@{reinit}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual void KSpeech::reinit ()\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKSpeech_z1_32}


Re-start KTTSD. 

\index{KSpeech@{KSpeech}!kttsdStarted@{kttsdStarted}}
\index{kttsdStarted@{kttsdStarted}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSpeech::kttsd\-Started ()}\label{classKSpeech_z3_0}


This signal is emitted when KTTSD starts or restarts after a call to reinit. 

\index{KSpeech@{KSpeech}!kttsdExiting@{kttsdExiting}}
\index{kttsdExiting@{kttsdExiting}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSpeech::kttsd\-Exiting ()}\label{classKSpeech_z3_1}


This signal is emitted just before KTTSD exits. 

\index{KSpeech@{KSpeech}!markerSeen@{markerSeen}}
\index{markerSeen@{markerSeen}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSpeech::marker\-Seen (const {\bf QCString} \& {\em app\-Id}, const {\bf QString} \& {\em marker\-Name})}\label{classKSpeech_z3_2}


This signal is emitted when the speech engine/plugin encounters a marker in the text. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em app\-Id}]DCOP application ID of the application that queued the text. \item[{\em marker\-Name}]The name of the marker seen.\end{description}
\end{Desc}
\begin{Desc}
\item[See also:]markers \end{Desc}
\index{KSpeech@{KSpeech}!sentenceStarted@{sentenceStarted}}
\index{sentenceStarted@{sentenceStarted}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSpeech::sentence\-Started (const {\bf QCString} \& {\em app\-Id}, uint {\em job\-Num}, uint {\em seq})}\label{classKSpeech_z3_3}


This signal is emitted whenever a sentence begins speaking. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em app\-Id}]DCOP application ID of the application that queued the text. \item[{\em job\-Num}]Job number of the text job. \item[{\em seq}]Sequence number of the text.\end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf get\-Text\-Count}{\rm (p.\,\pageref{classKSpeech_z1_9})} \end{Desc}
\index{KSpeech@{KSpeech}!sentenceFinished@{sentenceFinished}}
\index{sentenceFinished@{sentenceFinished}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSpeech::sentence\-Finished (const {\bf QCString} \& {\em app\-Id}, uint {\em job\-Num}, uint {\em seq})}\label{classKSpeech_z3_4}


This signal is emitted when a sentence has finished speaking. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em app\-Id}]DCOP application ID of the application that queued the text. \item[{\em job\-Num}]Job number of the text job. \item[{\em seq}]Sequence number of the text.\end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf get\-Text\-Count}{\rm (p.\,\pageref{classKSpeech_z1_9})} \end{Desc}
\index{KSpeech@{KSpeech}!textSet@{textSet}}
\index{textSet@{textSet}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSpeech::text\-Set (const {\bf QCString} \& {\em app\-Id}, uint {\em job\-Num})}\label{classKSpeech_z3_5}


This signal is emitted whenever a new text job is added to the queue. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em app\-Id}]The DCOP sender\-Id of the application that created the job. \item[{\em job\-Num}]Job number of the text job. \end{description}
\end{Desc}
\index{KSpeech@{KSpeech}!textAppended@{textAppended}}
\index{textAppended@{textAppended}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSpeech::text\-Appended (const {\bf QCString} \& {\em app\-Id}, uint {\em job\-Num}, int {\em part\-Num})}\label{classKSpeech_z3_6}


This signal is emitted whenever a new part is appended to a text job. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em app\-Id}]The DCOP sender\-Id of the application that created the job. \item[{\em job\-Num}]Job number of the text job. \item[{\em part\-Num}]Part number of the new part. Parts are numbered starting at 1. \end{description}
\end{Desc}
\index{KSpeech@{KSpeech}!textStarted@{textStarted}}
\index{textStarted@{textStarted}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSpeech::text\-Started (const {\bf QCString} \& {\em app\-Id}, uint {\em job\-Num})}\label{classKSpeech_z3_7}


This signal is emitted whenever speaking of a text job begins. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em app\-Id}]The DCOP sender\-Id of the application that created the job. \item[{\em job\-Num}]Job number of the text job. \end{description}
\end{Desc}
\index{KSpeech@{KSpeech}!textFinished@{textFinished}}
\index{textFinished@{textFinished}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSpeech::text\-Finished (const {\bf QCString} \& {\em app\-Id}, uint {\em job\-Num})}\label{classKSpeech_z3_8}


This signal is emitted whenever a text job is finished. 

The job has been marked for deletion from the queue and will be deleted when another job reaches the Finished state. (Only one job in the text queue may be in state Finished at one time.) If {\bf start\-Text}{\rm (p.\,\pageref{classKSpeech_z1_19})} or {\bf resume\-Text}{\rm (p.\,\pageref{classKSpeech_z1_22})} is called before the job is deleted, it will remain in the queue for speaking. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em app\-Id}]The DCOP sender\-Id of the application that created the job. \item[{\em job\-Num}]Job number of the text job. \end{description}
\end{Desc}
\index{KSpeech@{KSpeech}!textStopped@{textStopped}}
\index{textStopped@{textStopped}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSpeech::text\-Stopped (const {\bf QCString} \& {\em app\-Id}, uint {\em job\-Num})}\label{classKSpeech_z3_9}


This signal is emitted whenever a speaking text job stops speaking. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em app\-Id}]The DCOP sender\-Id of the application that created the job. \item[{\em job\-Num}]Job number of the text job.\end{description}
\end{Desc}
The signal is only emitted if {\bf stop\-Text()}{\rm (p.\,\pageref{classKSpeech_z1_20})} is called and the job is currently speaking. \index{KSpeech@{KSpeech}!textPaused@{textPaused}}
\index{textPaused@{textPaused}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSpeech::text\-Paused (const {\bf QCString} \& {\em app\-Id}, uint {\em job\-Num})}\label{classKSpeech_z3_10}


This signal is emitted whenever a speaking text job is paused. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em app\-Id}]The DCOP sender\-Id of the application that created the job. \item[{\em job\-Num}]Job number of the text job. \end{description}
\end{Desc}
\index{KSpeech@{KSpeech}!textResumed@{textResumed}}
\index{textResumed@{textResumed}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSpeech::text\-Resumed (const {\bf QCString} \& {\em app\-Id}, uint {\em job\-Num})}\label{classKSpeech_z3_11}


This signal is emitted when a text job, that was previously paused, resumes speaking. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em app\-Id}]The DCOP sender\-Id of the application that created the job. \item[{\em job\-Num}]Job number of the text job. \end{description}
\end{Desc}
\index{KSpeech@{KSpeech}!textRemoved@{textRemoved}}
\index{textRemoved@{textRemoved}!KSpeech@{KSpeech}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSpeech::text\-Removed (const {\bf QCString} \& {\em app\-Id}, uint {\em job\-Num})}\label{classKSpeech_z3_12}


This signal is emitted whenever a text job is deleted from the queue. 

The job is no longer in the queue when this signal is emitted. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em app\-Id}]The DCOP sender\-Id of the application that created the job. \item[{\em job\-Num}]Job number of the text job. \end{description}
\end{Desc}


The documentation for this class was generated from the following file:\begin{CompactItemize}
\item 
kspeech.h\end{CompactItemize}
