.PP
.TH "KSpeech" kde3 "11 Jun 2005" "Version Version 3.4.1" "interfaces/kspeech Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KSpeech \- kspeech - the \fBKDE\fP Text-to-Speech API.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kspeech.h>\fP
.PP
Inherits \fBDCOPObject\fP.
.PP
.SS "Public Types"

.in +1c
.ti -1c
.RI "enum \fBkttsdJobState\fP { \fBjsQueued\fP =  0, \fBjsSpeakable\fP =  1, \fBjsSpeaking\fP =  2, \fBjsPaused\fP =  3, \fBjsFinished\fP =  4 }"
.br
.ti -1c
.RI "enum \fBkttsdMarkupType\fP { \fBmtPlain\fP =  0, \fBmtJsml\fP =  1, \fBmtSsml\fP =  2, \fBmtSable\fP =  3 }"
.br
.in -1c
.SS "DCOP Member Functions"

.PP
.RI "\fBDCOP Methods\fP"
.br

.in +1c
.in +1c
.ti -1c
.RI "virtual bool \fBsupportsMarkup\fP (const \fBQString\fP &talker, uint markupType=0) const =0"
.br
.ti -1c
.RI "virtual bool \fBsupportsMarkers\fP (const \fBQString\fP &talker) const =0"
.br
.ti -1c
.RI "virtual ASYNC \fBsayScreenReaderOutput\fP (const \fBQString\fP &msg, const \fBQString\fP &talker)=0"
.br
.ti -1c
.RI "virtual ASYNC \fBsayWarning\fP (const \fBQString\fP &warning, const \fBQString\fP &talker)=0"
.br
.ti -1c
.RI "virtual ASYNC \fBsayMessage\fP (const \fBQString\fP &message, const \fBQString\fP &talker)=0"
.br
.ti -1c
.RI "virtual ASYNC \fBsetSentenceDelimiter\fP (const \fBQString\fP &delimiter)=0"
.br
.ti -1c
.RI "virtual uint \fBsetText\fP (const \fBQString\fP &text, const \fBQString\fP &talker)=0"
.br
.ti -1c
.RI "virtual int \fBappendText\fP (const \fBQString\fP &text, uint jobNum=0)=0"
.br
.ti -1c
.RI "virtual uint \fBsetFile\fP (const \fBQString\fP &filename, const \fBQString\fP &talker, const \fBQString\fP &encoding)=0"
.br
.ti -1c
.RI "virtual int \fBgetTextCount\fP (uint jobNum=0)=0"
.br
.ti -1c
.RI "virtual uint \fBgetCurrentTextJob\fP ()=0"
.br
.ti -1c
.RI "virtual uint \fBgetTextJobCount\fP ()=0"
.br
.ti -1c
.RI "virtual \fBQString\fP \fBgetTextJobNumbers\fP ()=0"
.br
.ti -1c
.RI "virtual int \fBgetTextJobState\fP (uint jobNum=0)=0"
.br
.ti -1c
.RI "virtual \fBQByteArray\fP \fBgetTextJobInfo\fP (uint jobNum=0)=0"
.br
.ti -1c
.RI "virtual \fBQString\fP \fBtalkerCodeToTalkerId\fP (const \fBQString\fP &talkerCode)=0"
.br
.ti -1c
.RI "virtual \fBQString\fP \fBgetTextJobSentence\fP (uint jobNum=0, uint seq=0)=0"
.br
.ti -1c
.RI "virtual bool \fBisSpeakingText\fP () const =0"
.br
.ti -1c
.RI "virtual ASYNC \fBremoveText\fP (uint jobNum=0)=0"
.br
.ti -1c
.RI "virtual ASYNC \fBstartText\fP (uint jobNum=0)=0"
.br
.ti -1c
.RI "virtual ASYNC \fBstopText\fP (uint jobNum=0)=0"
.br
.ti -1c
.RI "virtual ASYNC \fBpauseText\fP (uint jobNum=0)=0"
.br
.ti -1c
.RI "virtual ASYNC \fBresumeText\fP (uint jobNum=0)=0"
.br
.ti -1c
.RI "virtual \fBQStringList\fP \fBgetTalkers\fP ()=0"
.br
.ti -1c
.RI "virtual ASYNC \fBchangeTextTalker\fP (const \fBQString\fP &talker, uint jobNum=0)=0"
.br
.ti -1c
.RI "virtual \fBQString\fP \fBuserDefaultTalker\fP ()=0"
.br
.ti -1c
.RI "virtual ASYNC \fBmoveTextLater\fP (uint jobNum=0)=0"
.br
.ti -1c
.RI "virtual int \fBjumpToTextPart\fP (int partNum, uint jobNum=0)=0"
.br
.ti -1c
.RI "virtual uint \fBmoveRelTextSentence\fP (int n, uint jobNum=0)=0"
.br
.ti -1c
.RI "virtual ASYNC \fBspeakClipboard\fP ()=0"
.br
.ti -1c
.RI "virtual void \fBshowDialog\fP ()=0"
.br
.ti -1c
.RI "virtual void \fBkttsdExit\fP ()=0"
.br
.ti -1c
.RI "virtual void \fBreinit\fP ()=0"
.br
.in -1c
.in -1c
.PP
.RI "\fBDCOP Signals\fP"
.br

.in +1c
.in +1c
.ti -1c
.RI "void \fBkttsdStarted\fP ()"
.br
.ti -1c
.RI "void \fBkttsdExiting\fP ()"
.br
.ti -1c
.RI "void \fBmarkerSeen\fP (const \fBQCString\fP &appId, const \fBQString\fP &markerName)"
.br
.ti -1c
.RI "void \fBsentenceStarted\fP (const \fBQCString\fP &appId, uint jobNum, uint seq)"
.br
.ti -1c
.RI "void \fBsentenceFinished\fP (const \fBQCString\fP &appId, uint jobNum, uint seq)"
.br
.ti -1c
.RI "void \fBtextSet\fP (const \fBQCString\fP &appId, uint jobNum)"
.br
.ti -1c
.RI "void \fBtextAppended\fP (const \fBQCString\fP &appId, uint jobNum, int partNum)"
.br
.ti -1c
.RI "void \fBtextStarted\fP (const \fBQCString\fP &appId, uint jobNum)"
.br
.ti -1c
.RI "void \fBtextFinished\fP (const \fBQCString\fP &appId, uint jobNum)"
.br
.ti -1c
.RI "void \fBtextStopped\fP (const \fBQCString\fP &appId, uint jobNum)"
.br
.ti -1c
.RI "void \fBtextPaused\fP (const \fBQCString\fP &appId, uint jobNum)"
.br
.ti -1c
.RI "void \fBtextResumed\fP (const \fBQCString\fP &appId, uint jobNum)"
.br
.ti -1c
.RI "void \fBtextRemoved\fP (const \fBQCString\fP &appId, uint jobNum)"
.br
.in -1c
.in -1c
.SS "Public Attributes"

.in +1c
.ti -1c
.RI "k_dcop_signals \fB__pad0__\fP: void ignoreThis()"
.br
.in -1c
.SH "Detailed Description"
.PP 
kspeech - the \fBKDE\fP Text-to-Speech API. 

\fBVersion:\fP
.RS 4
1.0 Draft 9
.RE
.PP
\fBSince:\fP
.RS 4
\fBKDE\fP 3.4
.RE
.PP
This class defines the DCOP interface for applications desiring to speak text. Applications may speak text by sending DCOP messages to application 'kttsd' object 'KSpeech'.
.PP
KTTSD -- the \fBKDE\fP Text-to-Speech Deamon -- is the program that supplies the services in the \fBKDE\fP Text-to-Speech API.
.PP
\fBWarning:\fP
.RS 4
The KSpeech interface is still being developed and is likely to change in the future.
.RE
.PP
.SH "Features"
.PP
.IP "\(bu" 2
Priority system for Screen Readers, warnings and messages, while still playing regular texts.
.IP "\(bu" 2
Long text is parsed into sentences. User may backup by sentence or part, replay, pause, and stop playing.
.IP "\(bu" 2
Handles multiple speaking applications. Text messages are treated like print jobs. Jobs may be created, started, stopped, paused, resumed, and deleted.
.IP "\(bu" 2
Speak contents of clipboard.
.IP "\(bu" 2
Speak \fBKDE\fP notifications.
.IP "\(bu" 2
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.
.PP
.SH "Requirements"
.PP
You may build any \fBKDE\fP application to use KSpeech, since the interface is in kdelibs, but the kdeaccessibility package must be installed for KTTS to function.
.PP
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.
.SH "Design Goals"
.PP
The \fBKDE\fP Text-to-Speech API is designed with the following goals:
.PP
.IP "\(bu" 2
Support the features enumerated above.
.IP "\(bu" 2
Plugin-based architecture for support of a wide variety of speech synthesis engines and drivers.
.IP "\(bu" 2
Permit generation of speech from the command line (or via shell scripts) using the \fBKDE\fP DCOP utilities.
.IP "\(bu" 2
Provide a lightweight and easily usable interface for applications to generate speech output.
.IP "\(bu" 2
Applications need not be concerned about contention over the speech device.
.IP "\(bu" 2
Provide limited support for speech markup languages, such as Sable, Java Speech Markup Language (JSML), and Speech Markup Meta-language (SMML).
.IP "\(bu" 2
Provide limited support for embedded speech markers.
.IP "\(bu" 2
Asynchronous to prevent system blocking.
.IP "\(bu" 2
Plugin-based audio architecture. Currently supports aRts but will support additional audio engines in the future, such as gstreamer.
.IP "\(bu" 2
Compatible with original KTTSD API as developed by José Pablo Ezequiel 'Pupeno' Fernández (avoid breaking existing applications).
.PP
.PP
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).
.PP
.PP
.nf

         application
              ^
              |  via DCOP (the KDE Text-to-Speech API)
              v
            kttsd
              ^
              |  KTTSD plugin API
              v
         kttsd plugin
              ^
              |
              v
        speech engine
   .fi
.PP
.PP
The KTTSD Plugin API is documented in \fBPluginConf\fP in the kdeaccessibility module.
.PP
There is a separate GUI application, called kttsmgr, for providing KTTSD configuration and job management.
.PP
kttsd maintains 4 types of speech output:
.IP "\(bu" 2
Screen Reader Output
.IP "\(bu" 2
Warnings
.IP "\(bu" 2
Messages
.IP "\(bu" 2
Text Jobs
.PP
.PP
Method \fBsayScreenReaderOutput\fP 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.
.PP
Methods \fBsayWarning\fP and \fBsayMessage\fP 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.
.PP
\fBsetText\fP places text into the text job queue. \fBstartText\fP begins speaking jobs. When one job finishes, the next job begins. Method \fBappendText\fP 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 \fBjumpToTextPart\fP and \fBmoveRelTextSentence\fP. Text jobs may be paused, stopped, and resumed or deleted from the queue. See \fBpauseText\fP, \fBstopText\fP, \fBresumeText\fP, and \fBremoveText\fP.
.SH "DCOP Command-line Interface"
.PP
To create a text job to be spoken
.PP
.PP
.nf

     dcop kttsd KSpeech setText <text> <talker>
   .fi
.PP
.PP
where <text> is the text to be spoken, and <talker> is usually a language code such as 'en', 'cy', etc.
.PP
Example.
.PP
.PP
.nf

     dcop kttsd KSpeech setText "This is a test." "en"
   .fi
.PP
.PP
To start speaking the text.
.PP
.PP
.nf

     dcop kttsd KSpeech startText 0
   .fi
.PP
.PP
To stop speaking and rewind to the beginning of the text.
.PP
.PP
.nf

     dcop kttsd KSpeech stopText 0
   .fi
.PP
.PP
Depending upon the speech plugin used, speaking may not immediately stop.
.PP
To stop and remove a text job.
.PP
.PP
.nf

     dcop kttsd KSpeech removeText 0
   .fi
.PP
.PP
Note: For more information about talker codes, see \fBTalkers, Talker Codes, and Plugins\fP below.
.SH "Calling KTTSD from a Program"
.PP
There are two methods of making DCOP calls from your application to KTTSD.
.PP
.IP "\(bu" 2
Manually code them using dcopClient 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.
.IP "\(bu" 2
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.
.PP
.PP
To make DCOP calls from your program using kspeech_stub, follow these steps:
.PP
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:
.PP
.PP
.nf

     #include <kspeech_stub.h>
     class MyPart: public KParts::ReadOnlyPart, public KSpeech_stub {
   .fi
.PP
.PP
2. In your class constructor, initialize \fBDCOPStub\fP, giving it the sender 'kttsd', object 'KSpeech'.
.PP
.PP
.nf

     MyPart::MyPart(QWidget *parent, const char *name) :
        KParts::ReadOnlyPart(parent, name),
        DCOPStub("kttsd", "KSpeech") {
   .fi
.PP
.PP
3. See if KTTSD is running, and if not, start it.
.PP
.PP
.nf

     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;
     }
   .fi
.PP
.PP
4. Make calls to KTTSD in your code.
.PP
.PP
.nf

     uint jobNum = setText("Hello World", "en");
     startText(jobNum);
   .fi
.PP
.PP
4. Add kspeech_DIR and kspeech.stub to your Makefile.am. Example:
.PP
.PP
.nf

     kspeech_DIR = $(kde_includes)
     libmypart_la_SOURCES = kspeech.stub
   .fi
.PP
.SH "Signals Emitted by KTTSD"
.PP
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 appId argument to determine whether the signal belongs to them or not.
.PP
To receive KTTSD DCOP signals, follow these steps:
.PP
1. Include \fBkspeechsink.h\fP in your code. Derive an object from the \fBKSpeechSink\fP 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 sentenceStarted:
.PP
.PP
.nf

     #include <kspeechsink.h>
     class MyPart:
         public KParts::ReadOnlyPart,
         virtual public KSpeechSink
     {
         protected:
            ASYNC sentenceStarted(const QCString& appId, const uint jobNum, const uint seq);
   .fi
.PP
.PP
You can combine sending and receiving in one object.
.PP
.PP
.nf

     #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);
   .fi
.PP
.PP
See below for the signals you can declare.
.PP
2. In your class constructor, initialize \fBDCOPObject\fP with the name of your DCOP receiving object.
.PP
.PP
.nf

     MyPart::MyPart(QWidget *parent, const char *name) :
         KParts::ReadOnlyPart(parent, name),
         DCOPObject("mypart_kspeechsink") {
   .fi
.PP
.PP
Use any name you like.
.PP
3. Where appropriate (usually in your constructor), make sure your \fBDCOPClient\fP is registered and connect the KTTSD DCOP signals to your declared receiving methods.
.PP
.PP
.nf

     // 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);
   .fi
.PP
.PP
Notice that the argument signatures differ slightly from the actual declarations. For example
.PP
.PP
.nf

     ASYNC sentenceStarted(const QCString& appId, const uint jobNum, const uint seq);
   .fi
.PP
.PP
becomes
.PP
.PP
.nf

       "sentenceStarted(QCString,uint,uint)",
   .fi
.PP
.PP
in the connectDCOPSignal call.
.PP
4. Write the definition for the received signal. Be sure to check whether the signal is intended for your application.
.PP
.PP
.nf

     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.
     }
   .fi
.PP
.PP
5. Add kspeechsink_DIR and kspeechsink.skel to your Makefile.am. Example for an app both sending and receiving.
.PP
.PP
.nf

     kspeech_DIR = $(kde_includes)
     kspeechsink_DIR = $(kde_includes)
     libmypart_la_SOURCES = kspeech.stub kspeechsink.skel
   .fi
.PP
.SH "Talkers, Talker Codes, and Plugins"
.PP
Many of the methods permit you to specify a desired 'talker'. This may be a simple language code, such as 'en' for English, 'es' for Spanish, etc. Code as NULL to use the default configured talker.
.PP
Within KTTSMGR, the user has the ability to configure more than one talker for each language, with different voices, genders, volumes, and talking speeds.
.PP
Talker codes serve two functions:
.IP "\(bu" 2
They identify configured plugins, and
.IP "\(bu" 2
They provide a way for applications to specify the desired speaking attributes that influence the choice of plugin to speak text.
.PP
.PP
A Talker Code consists of a series of XML tags and attributes. An example of a full Talker Code with all attributes specified is
.PP
<voice lang='en' name='kal' gender='male'/> <prosody volume='soft' rate='fast'/> <kttsd synthesizer='Festival' />
.PP
(The \fIvoice\fP and \fIprosody\fP tags are adapted from the W3C Speech Synthesis Markup Language (SSML) and Java Speech Markup Language (JSML). The \fIkttsd\fP tag is an extension to the SMML and JSML languages to support named synthesizers and text encodings.) KTTS doesn't really care about the \fIvoice\fP, \fIprosody\fP, and \fIkttsd\fP tags. In fact, they may be omitted and just the attributes specified. The example above then becomes
.PP
lang='en' name='kal' gender='male' volume='soft' rate='fast' synthesizer='Festival'
.PP
The attributes may be specified in any order.
.PP
For clarity, the rest of the discussion will omit the \fIvoice\fP, \fIprosody\fP, and \fIkttsd\fP tags.
.PP
The attributes that make up a talker code are:
.PP
.IP "\(bu" 2
\fIlang\fP. 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.
.IP "\(bu" 2
\fIsynthesizer\fP. The name of the synthesizer (plugin) used to produce the speech.
.IP "\(bu" 2
\fIgender\fP. May be either 'male', 'female', or 'neutral'.
.IP "\(bu" 2
\fIname\fP. The name of the voice code. The choice of voice codes is synthesizer-specific.
.IP "\(bu" 2
\fIvolume\fP. May be 'loud', 'medium', or 'quiet'. A synonym for 'quiet' is 'soft'.
.IP "\(bu" 2
\fIrate\fP. May be 'fast', 'medium', or 'slow'.
.PP
.PP
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 'plugin' and a 'talker'. A talker is a configured instance of a plugin. Each plugin (if it supports it) may be configured as multiple talkers.
.PP
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.
.PP
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
.PP
lang='en' gender='female'
.PP
If the talker code is not in XML attribute format, it assumed to be a \fIlang\fP attribute. So the talker code
.PP
en
.PP
is interpreted as
.PP
lang='en'
.PP
When a program requests a talker code in calls to \fBsetText\fP, \fBappendText\fP, \fBsayMessage\fP, \fBsayWarning\fP, and \fBsayScreenReaderOutput\fP, KTTSD tries to match the requested talker code to the closest matching configured talker.
.PP
The \fIlang\fP attribute has highest priority (attempting to speak English with a Spanish synthesizer would likely be unintelligible). So the language attribute is said to have 'priority'. If an application does not specify a language attribute, a default one will be assumed. The rest of the attributes are said to be 'preferred'. If KTTSD cannot find a talker with the exact preferred attributes requested, the closest matching talker will likely still be understandable.
.PP
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
.PP
lang='en' gender='*female' volume='soft'
.PP
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.
.PP
The algorithm used by KTTSD to find a matching talker is as follows:
.PP
.IP "\(bu" 2
If language code is not specified by the application, assume default configured by user. The primary language code automatically has priority.
.IP "\(bu" 2
(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)
.IP "\(bu" 2
The talker that matches on the most priority attributes wins.
.IP "\(bu" 2
If a tie, the one that matches on the most preferred attributes wins.
.IP "\(bu" 2
If there is still a tie, the one nearest the top of the kttsmgr display (first configured) will be chosen.
.PP
.PP
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
.PP
lang='en_GB' gender='male' volume='medium'
.PP
then a talker configured as lang='en' gender='male' volume='medium' would be picked over one configured as lang='en_GB' gender='female' volume='soft', 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,
.PP
lang='*en_GB' gender='male' volume='medium'
.PP
To specify that American English is priority, put an asterisk in front of en_US, like this.
.PP
lang='*en_US' gender='male' volume='medium'
.PP
Here the application is indicating that a talker that speaks American English has priorty over one that speaks a different form of English.
.PP
(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.
.PP
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 \fBgetTalkers\fP, and if there are none, display an error message to the user.
.PP
Applications can implement their own talker-matching algorithm by calling \fBgetTalkers\fP, 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.
.PP
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.)
.PP
The above scheme is designed to balance the needs of applications against user preferences. Applications are given the control they \fImight\fP 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:
.PP
.IP "\(bu" 2
It is legitimate to give a NULL (0) talker code, in which case, the user's default talker will be used.
.IP "\(bu" 2
If you know the language code, give that in the talker code, otherwise leave it out.
.IP "\(bu" 2
If there is an attribute your application \fIrequires\fP 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 \fBgetTalkers\fP 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.)
.IP "\(bu" 2
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.
.PP
.PP
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.
.SH "Speech Markup"
.PP
Note: Speech Markup is not yet fully implemented in KTTSD.
.PP
Each of the five methods for queueing text to be spoken -- \fBsayScreenReaderOutput\fP, \fBsetText\fP, \fBappendText\fP, \fBsayMessage\fP, and \fBsayWarning\fP -- may contain speech markup, provided that the plugin the user has configured supports that markup. The markup languages and plugins currently supported are:
.PP
.IP "\(bu" 2
Speech Synthesis Markup language (SSML): Festival and Hadifix.
.PP
.PP
This may change in the future as synthesizers improve.
.PP
Before including markup in the text sent to kttsd, the application should query whether the currently-configured plugin supports the markup language by calling \fBsupportsMarkup\fP.
.PP
It it does not support the markup, it will be stripped out of the text.
.SH "Support for Markers"
.PP
Note: Markers are not yet implemented in KTTSD.
.PP
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 \fBmarkerSeen\fP 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 \fBsupportsMarkers\fP method to determine if the currently configured plugin supports markers or not.
.SH "Sentence Parsing"
.PP
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 \fBsetText\fP and \fBappendText\fP 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).
.PP
Sentence Boundary Detection also permits the user to rewind by sentences.
.PP
The default sentence delimiter used for plain text is as follows:
.PP
.IP "\(bu" 2
A period (.), question mark (?), exclamation mark (!), colon (:), or semi-colon (;) followed by whitespace (including newline), or
.IP "\(bu" 2
Two newlines in a row separated by optional whitespace, or
.IP "\(bu" 2
The end of the text.
.PP
.PP
When given text containing speech markup, KTTSD automatically determines the markup type and parses based on the sentence semantics of the markup language.
.PP
An application may change the sentence delimiter by calling \fBsetSentenceDelimiter\fP prior to calling \fBsetText\fP. Changing the delimiter does not affect other applications.
.PP
Text given to KTTSD via the \fBsayWarning\fP, \fBsayMessage\fP, and \fBsayScreenReaderOutput\fP methods is \fInot\fP parsed into sentences. For this reason, applications should \fInot\fP send long messages with these methods.
.SH "Authors"
.PP
\fBAuthor:\fP
.RS 4
José Pablo Ezequiel 'Pupeno' Fernández <pupeno@kde.org> 
.PP
Gary Cramblitt <garycramblitt@comcast.net> 
.PP
Olaf Schmidt <ojschmidt@kde.org> 
.PP
Gunnar Schmi Dt <gunnar@schmi-dt.de> 
.RE
.PP

.PP
Definition at line 600 of file kspeech.h.
.SH "Member Enumeration Documentation"
.PP 
.SS "enum \fBKSpeech::kttsdJobState\fP"
.PP
Job states returned by method \fBgetTextJobState\fP. 
.PP
\fBEnumeration values: \fP
.in +1c
.TP
\fB\fIjsQueued \fP\fP
Job has been queued but is not yet speakable. 
.TP
\fB\fIjsSpeakable \fP\fP
Job is speakable, but is not speaking. 
.TP
\fB\fIjsSpeaking \fP\fP
Job is currently speaking. 
.TP
\fB\fIjsPaused \fP\fP
Job has been paused. 
.TP
\fB\fIjsFinished \fP\fP
Job is finished and is deleteable. 
.PP
Definition at line 608 of file kspeech.h.
.SS "enum \fBKSpeech::kttsdMarkupType\fP"
.PP
Speech markup language types. 
.PP
\fBEnumeration values: \fP
.in +1c
.TP
\fB\fImtPlain \fP\fP
Plain text. 
.TP
\fB\fImtJsml \fP\fP
Java Speech Markup Language. 
.TP
\fB\fImtSsml \fP\fP
Speech Synthesis Markup Language 
.TP
\fB\fImtSable \fP\fP
Sable 2.0. 
.PP
Definition at line 621 of file kspeech.h.
.SH "Member Function Documentation"
.PP 
.SS "virtual bool KSpeech::supportsMarkup (const \fBQString\fP & talker, uint markupType = \fC0\fP) const\fC [pure virtual]\fP"
.PP
Determine whether the currently-configured speech plugin supports a speech markup language. 
.PP
\fBParameters:\fP
.RS 4
\fItalker\fP Code for the talker to do the speaking. Example 'en'. If NULL, defaults to the user's default talker. 
.br
\fImarkupType\fP The kttsd code for the desired speech markup language. 
.RE
.PP
\fBReturns:\fP
.RS 4
True if the plugin currently configured for the indicated talker supports the indicated speech markup language. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBkttsdMarkupType\fP 
.RE
.PP

.SS "virtual bool KSpeech::supportsMarkers (const \fBQString\fP & talker) const\fC [pure virtual]\fP"
.PP
Determine whether the currently-configured speech plugin supports markers in speech markup. 
.PP
\fBParameters:\fP
.RS 4
\fItalker\fP Code for the talker to do the speaking. Example 'en'. If NULL, defaults to the user's default talker. 
.RE
.PP
\fBReturns:\fP
.RS 4
True if the plugin currently configured for the indicated talker supports markers. 
.RE
.PP

.SS "virtual ASYNC KSpeech::sayScreenReaderOutput (const \fBQString\fP & msg, const \fBQString\fP & talker)\fC [pure virtual]\fP"
.PP
Say a message as soon as possible, interrupting any other speech in progress. 
.PP
IMPORTANT: This method is reserved for use by Screen Readers and should not be used by any other applications. 
.PP
\fBParameters:\fP
.RS 4
\fImsg\fP The message to be spoken. 
.br
\fItalker\fP Code for the talker to do the speaking. Example 'en'. 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.
.RE
.PP
If an existing Screen Reader output is in progress, it is stopped and discarded and replaced with this new message. 
.SS "virtual ASYNC KSpeech::sayWarning (const \fBQString\fP & warning, const \fBQString\fP & talker)\fC [pure virtual]\fP"
.PP
Say a warning. 
.PP
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 'WARNING. CPU is overheating.' 
.PP
\fBParameters:\fP
.RS 4
\fIwarning\fP The warning to be spoken. 
.br
\fItalker\fP Code for the talker to do the speaking. Example 'en'. 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. 
.RE
.PP

.SS "virtual ASYNC KSpeech::sayMessage (const \fBQString\fP & message, const \fBQString\fP & talker)\fC [pure virtual]\fP"
.PP
Say a message. 
.PP
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 'You have mail.'. 
.PP
\fBParameters:\fP
.RS 4
\fImessage\fP The message to be spoken. 
.br
\fItalker\fP Code for the talker to do the speaking. Example 'en'. 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. 
.RE
.PP

.SS "virtual ASYNC KSpeech::setSentenceDelimiter (const \fBQString\fP & delimiter)\fC [pure virtual]\fP"
.PP
Sets the GREP pattern that will be used as the sentence delimiter. 
.PP
\fBParameters:\fP
.RS 4
\fIdelimiter\fP A valid GREP pattern.
.RE
.PP
The default sentence delimiter is 
.PP
.nf

              ([\\.\\?\\!\\:\\;])(\\s|$|(\\n *\\n))
          
.fi
.PP
.PP
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: 
.PP
.nf

              QString::replace(sentenceDelimiter, "\\1\t");
          
.fi
.PP
.PP
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.
.PP
Changing the sentence delimiter does not affect other applications.
.PP
\fBSee also:\fP
.RS 4
sentenceparsing 
.RE
.PP

.SS "virtual uint KSpeech::setText (const \fBQString\fP & text, const \fBQString\fP & talker)\fC [pure virtual]\fP"
.PP
Queue a text job. 
.PP
Does not start speaking the text. 
.PP
\fBParameters:\fP
.RS 4
\fItext\fP The message to be spoken. 
.br
\fItalker\fP Code for the talker to do the speaking. Example 'en'. 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. 
.RE
.PP
\fBReturns:\fP
.RS 4
Job number.
.RE
.PP
Plain text is parsed into individual sentences using the current sentence delimiter. Call \fBsetSentenceDelimiter\fP to change the sentence delimiter prior to calling setText. Call \fBgetTextCount\fP to retrieve the sentence count after calling setText.
.PP
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.
.PP
Call \fBstartText\fP to mark the job as speakable and if the job is the first speakable job in the queue, speaking will begin.
.PP
\fBSee also:\fP
.RS 4
\fBgetTextCount\fP 
.PP
\fBstartText\fP 
.RE
.PP

.SS "virtual int KSpeech::appendText (const \fBQString\fP & text, uint jobNum = \fC0\fP)\fC [pure virtual]\fP"
.PP
Adds another part to a text job. 
.PP
Does not start speaking the text. 
.PP
\fBParameters:\fP
.RS 4
\fItext\fP The message to be spoken. 
.br
\fIjobNum\fP 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). 
.RE
.PP
\fBReturns:\fP
.RS 4
Part number for the added part. Parts are numbered starting at 1.
.RE
.PP
The text is parsed into individual sentences. Call getTextCount to retrieve the sentence count. Call startText to mark the job as speakable and if the job is the first speakable job in the queue, speaking will begin.
.PP
\fBSee also:\fP
.RS 4
\fBsetText\fP. 
.PP
\fBstartText\fP. 
.RE
.PP

.SS "virtual uint KSpeech::setFile (const \fBQString\fP & filename, const \fBQString\fP & talker, const \fBQString\fP & encoding)\fC [pure virtual]\fP"
.PP
Queue a text job from the contents of a file. 
.PP
Does not start speaking the text. 
.PP
\fBParameters:\fP
.RS 4
\fIfilename\fP Full path to the file to be spoken. May be a URL. 
.br
\fItalker\fP Code for the talker to do the speaking. Example 'en'. 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. 
.br
\fIencoding\fP Name of the encoding to use when reading the file. If NULL or Empty, uses default stream encoding. 
.RE
.PP
\fBReturns:\fP
.RS 4
Job number. 0 if an error occurs.
.RE
.PP
Plain text is parsed into individual sentences using the current sentence delimiter. Call \fBsetSentenceDelimiter\fP to change the sentence delimiter prior to calling setText. Call \fBgetTextCount\fP to retrieve the sentence count after calling setText.
.PP
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.
.PP
Call \fBstartText\fP to mark the job as speakable and if the job is the first speakable job in the queue, speaking will begin.
.PP
\fBSee also:\fP
.RS 4
\fBgetTextCount\fP 
.PP
\fBstartText\fP 
.RE
.PP

.SS "virtual int KSpeech::getTextCount (uint jobNum = \fC0\fP)\fC [pure virtual]\fP"
.PP
Get the number of sentences in a text job. 
.PP
\fBParameters:\fP
.RS 4
\fIjobNum\fP 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). 
.RE
.PP
\fBReturns:\fP
.RS 4
The number of sentences in the job. -1 if no such job.
.RE
.PP
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 \fBsentenceStarted\fP and \fBsentenceFinished\fP signals. 
.SS "virtual uint KSpeech::getCurrentTextJob ()\fC [pure virtual]\fP"
.PP
Get the job number of the current text job. 
.PP
\fBReturns:\fP
.RS 4
Job number of the current text job. 0 if no jobs.
.RE
.PP
Note that the current job may not be speaking. See \fBisSpeakingText\fP.
.PP
\fBSee also:\fP
.RS 4
\fBgetTextJobState\fP. 
.PP
\fBisSpeakingText\fP 
.RE
.PP

.SS "virtual uint KSpeech::getTextJobCount ()\fC [pure virtual]\fP"
.PP
Get the number of jobs in the text job queue. 
.PP
\fBReturns:\fP
.RS 4
Number of text jobs in the queue. 0 if none. 
.RE
.PP

.SS "virtual \fBQString\fP KSpeech::getTextJobNumbers ()\fC [pure virtual]\fP"
.PP
Get a comma-separated list of text job numbers in the queue. 
.PP
\fBReturns:\fP
.RS 4
Comma-separated list of text job numbers in the queue. 
.RE
.PP

.SS "virtual int KSpeech::getTextJobState (uint jobNum = \fC0\fP)\fC [pure virtual]\fP"
.PP
Get the state of a text job. 
.PP
\fBParameters:\fP
.RS 4
\fIjobNum\fP 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). 
.RE
.PP
\fBReturns:\fP
.RS 4
State of the job. -1 if invalid job number.
.RE
.PP
\fBSee also:\fP
.RS 4
\fBkttsdJobState\fP 
.RE
.PP

.SS "virtual \fBQByteArray\fP KSpeech::getTextJobInfo (uint jobNum = \fC0\fP)\fC [pure virtual]\fP"
.PP
Get information about a text job. 
.PP
\fBParameters:\fP
.RS 4
\fIjobNum\fP 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). 
.RE
.PP
\fBReturns:\fP
.RS 4
A \fBQDataStream\fP containing information about the job. Blank if no such job.
.RE
.PP
The stream contains the following elements:
.IP "\(bu" 2
int state - Job state.
.IP "\(bu" 2
\fBQCString\fP appId - DCOP senderId of the application that requested the speech job.
.IP "\(bu" 2
\fBQString\fP talker - Talker Code requested by application.
.IP "\(bu" 2
int seq - Current sentence being spoken. Sentences are numbered starting at 1.
.IP "\(bu" 2
int sentenceCount - Total number of sentences in the job.
.IP "\(bu" 2
int partNum - Current part of the job begin spoken. Parts are numbered starting at 1.
.IP "\(bu" 2
int partCount - Total number of parts in the job.
.PP
.PP
Note that sequence numbers apply to the entire job. They do not start from 1 at the beginning of each part.
.PP
The following sample code will decode the stream: 
.PP
.nf
                    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;

.fi
.PP
 
.SS "virtual \fBQString\fP KSpeech::talkerCodeToTalkerId (const \fBQString\fP & talkerCode)\fC [pure virtual]\fP"
.PP
Given a Talker Code, returns the Talker ID of the talker that would speak a text job with that Talker Code. 
.PP
\fBParameters:\fP
.RS 4
\fItalkerCode\fP Talker Code. 
.RE
.PP
\fBReturns:\fP
.RS 4
Talker ID of the talker that would speak the text job. 
.RE
.PP

.SS "virtual \fBQString\fP KSpeech::getTextJobSentence (uint jobNum = \fC0\fP, uint seq = \fC0\fP)\fC [pure virtual]\fP"
.PP
Return a sentence of a job. 
.PP
\fBParameters:\fP
.RS 4
\fIjobNum\fP 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). 
.br
\fIseq\fP Sequence number of the sentence. 
.RE
.PP
\fBReturns:\fP
.RS 4
The specified sentence in the specified job. If no such job or sentence, returns ''. 
.RE
.PP

.SS "virtual bool KSpeech::isSpeakingText () const\fC [pure virtual]\fP"
.PP
Determine if kttsd is currently speaking any text jobs. 
.PP
\fBReturns:\fP
.RS 4
True if currently speaking any text jobs. 
.RE
.PP

.SS "virtual ASYNC KSpeech::removeText (uint jobNum = \fC0\fP)\fC [pure virtual]\fP"
.PP
Remove a text job from the queue. 
.PP
\fBParameters:\fP
.RS 4
\fIjobNum\fP 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).
.RE
.PP
The job is deleted from the queue and the \fBtextRemoved\fP signal is emitted.
.PP
If there is another job in the text queue, and it is marked speakable, that job begins speaking. 
.SS "virtual ASYNC KSpeech::startText (uint jobNum = \fC0\fP)\fC [pure virtual]\fP"
.PP
Start a text job at the beginning. 
.PP
\fBParameters:\fP
.RS 4
\fIjobNum\fP 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).
.RE
.PP
Rewinds the job to the beginning.
.PP
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.
.PP
The \fBtextStarted\fP 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 \fBtextFinished\fP signal is emitted. 
.SS "virtual ASYNC KSpeech::stopText (uint jobNum = \fC0\fP)\fC [pure virtual]\fP"
.PP
Stop a text job and rewind to the beginning. 
.PP
\fBParameters:\fP
.RS 4
\fIjobNum\fP 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).
.RE
.PP
The job is marked not speakable and will not be speakable until \fBstartText\fP or \fBresumeText\fP is called.
.PP
If there are speaking jobs preceeding this one in the queue, they continue speaking.
.PP
If the job is currently speaking, the \fBtextStopped\fP signal is emitted, the job stops speaking, and if the next job in the queue is speakable, it begins speaking.
.PP
Depending upon the speech engine and plugin used, speeking may not stop immediately (it might finish the current sentence). 
.SS "virtual ASYNC KSpeech::pauseText (uint jobNum = \fC0\fP)\fC [pure virtual]\fP"
.PP
Pause a text job. 
.PP
\fBParameters:\fP
.RS 4
\fIjobNum\fP 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).
.RE
.PP
The job is marked as paused and will not be speakable until \fBresumeText\fP or \fBstartText\fP is called.
.PP
If there are speaking jobs preceeding this one in the queue, they continue speaking.
.PP
If the job is currently speaking, the \fBtextPaused\fP 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.
.PP
Depending upon the speech engine and plugin used, speeking may not stop immediately (it might finish the current sentence).
.PP
\fBSee also:\fP
.RS 4
\fBresumeText\fP 
.RE
.PP

.SS "virtual ASYNC KSpeech::resumeText (uint jobNum = \fC0\fP)\fC [pure virtual]\fP"
.PP
Start or resume a text job where it was paused. 
.PP
\fBParameters:\fP
.RS 4
\fIjobNum\fP 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).
.RE
.PP
The job is marked speakable.
.PP
If the job was not paused, it is the same as calling \fBstartText\fP.
.PP
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.
.PP
The \fBtextResumed\fP signal is emitted when the job resumes.
.PP
\fBSee also:\fP
.RS 4
\fBpauseText\fP 
.RE
.PP

.SS "virtual \fBQStringList\fP KSpeech::getTalkers ()\fC [pure virtual]\fP"
.PP
Get a list of the talkers configured in KTTS. 
.PP
\fBReturns:\fP
.RS 4
A \fBQStringList\fP of fully-specified talker codes, one for each talker user has configured.
.RE
.PP
\fBSee also:\fP
.RS 4
talkers 
.RE
.PP

.SS "virtual ASYNC KSpeech::changeTextTalker (const \fBQString\fP & talker, uint jobNum = \fC0\fP)\fC [pure virtual]\fP"
.PP
Change the talker for a text job. 
.PP
\fBParameters:\fP
.RS 4
\fIjobNum\fP 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). 
.br
\fItalker\fP New code for the talker to do the speaking. Example 'en'. 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. 
.RE
.PP

.SS "virtual \fBQString\fP KSpeech::userDefaultTalker ()\fC [pure virtual]\fP"
.PP
Get the user's default talker. 
.PP
\fBReturns:\fP
.RS 4
A fully-specified talker code.
.RE
.PP
\fBSee also:\fP
.RS 4
talkers 
.PP
\fBgetTalkers\fP 
.RE
.PP

.SS "virtual ASYNC KSpeech::moveTextLater (uint jobNum = \fC0\fP)\fC [pure virtual]\fP"
.PP
Move a text job down in the queue so that it is spoken later. 
.PP
\fBParameters:\fP
.RS 4
\fIjobNum\fP 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).
.RE
.PP
If the job is currently speaking, it is paused. If the next job in the queue is speakable, it begins speaking. 
.SS "virtual int KSpeech::jumpToTextPart (int partNum, uint jobNum = \fC0\fP)\fC [pure virtual]\fP"
.PP
Jump to the first sentence of a specified part of a text job. 
.PP
\fBParameters:\fP
.RS 4
\fIpartNum\fP Part number of the part to jump to. Parts are numbered starting at 1. 
.br
\fIjobNum\fP 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). 
.RE
.PP
\fBReturns:\fP
.RS 4
Part number of the part actually jumped to.
.RE
.PP
If partNum is greater than the number of parts in the job, jumps to last part. If partNum 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. 
.SS "virtual uint KSpeech::moveRelTextSentence (int n, uint jobNum = \fC0\fP)\fC [pure virtual]\fP"
.PP
Advance or rewind N sentences in a text job. 
.PP
\fBParameters:\fP
.RS 4
\fIn\fP Number of sentences to advance (positive) or rewind (negative) in the job. 
.br
\fIjobNum\fP 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). 
.RE
.PP
\fBReturns:\fP
.RS 4
Sequence number of the sentence actually moved to. Sequence numbers are numbered starting at 1.
.RE
.PP
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. 
.SS "virtual ASYNC KSpeech::speakClipboard ()\fC [pure virtual]\fP"
.PP
Add the clipboard contents to the text queue and begin speaking it. 
.PP
.SS "virtual void KSpeech::showDialog ()\fC [pure virtual]\fP"
.PP
Displays the KTTS Manager dialog. 
.PP
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. 
.SS "virtual void KSpeech::kttsdExit ()\fC [pure virtual]\fP"
.PP
Stop the service. 
.PP
.SS "virtual void KSpeech::reinit ()\fC [pure virtual]\fP"
.PP
Re-start KTTSD. 
.PP
.SS "void KSpeech::kttsdStarted ()"
.PP
This signal is emitted when KTTSD starts or restarts after a call to reinit. 
.PP
.SS "void KSpeech::kttsdExiting ()"
.PP
This signal is emitted just before KTTSD exits. 
.PP
.SS "void KSpeech::markerSeen (const \fBQCString\fP & appId, const \fBQString\fP & markerName)"
.PP
This signal is emitted when the speech engine/plugin encounters a marker in the text. 
.PP
\fBParameters:\fP
.RS 4
\fIappId\fP DCOP application ID of the application that queued the text. 
.br
\fImarkerName\fP The name of the marker seen.
.RE
.PP
\fBSee also:\fP
.RS 4
markers 
.RE
.PP

.SS "void KSpeech::sentenceStarted (const \fBQCString\fP & appId, uint jobNum, uint seq)"
.PP
This signal is emitted whenever a sentence begins speaking. 
.PP
\fBParameters:\fP
.RS 4
\fIappId\fP DCOP application ID of the application that queued the text. 
.br
\fIjobNum\fP Job number of the text job. 
.br
\fIseq\fP Sequence number of the text.
.RE
.PP
\fBSee also:\fP
.RS 4
\fBgetTextCount\fP 
.RE
.PP

.SS "void KSpeech::sentenceFinished (const \fBQCString\fP & appId, uint jobNum, uint seq)"
.PP
This signal is emitted when a sentence has finished speaking. 
.PP
\fBParameters:\fP
.RS 4
\fIappId\fP DCOP application ID of the application that queued the text. 
.br
\fIjobNum\fP Job number of the text job. 
.br
\fIseq\fP Sequence number of the text.
.RE
.PP
\fBSee also:\fP
.RS 4
\fBgetTextCount\fP 
.RE
.PP

.SS "void KSpeech::textSet (const \fBQCString\fP & appId, uint jobNum)"
.PP
This signal is emitted whenever a new text job is added to the queue. 
.PP
\fBParameters:\fP
.RS 4
\fIappId\fP The DCOP senderId of the application that created the job. 
.br
\fIjobNum\fP Job number of the text job. 
.RE
.PP

.SS "void KSpeech::textAppended (const \fBQCString\fP & appId, uint jobNum, int partNum)"
.PP
This signal is emitted whenever a new part is appended to a text job. 
.PP
\fBParameters:\fP
.RS 4
\fIappId\fP The DCOP senderId of the application that created the job. 
.br
\fIjobNum\fP Job number of the text job. 
.br
\fIpartNum\fP Part number of the new part. Parts are numbered starting at 1. 
.RE
.PP

.SS "void KSpeech::textStarted (const \fBQCString\fP & appId, uint jobNum)"
.PP
This signal is emitted whenever speaking of a text job begins. 
.PP
\fBParameters:\fP
.RS 4
\fIappId\fP The DCOP senderId of the application that created the job. 
.br
\fIjobNum\fP Job number of the text job. 
.RE
.PP

.SS "void KSpeech::textFinished (const \fBQCString\fP & appId, uint jobNum)"
.PP
This signal is emitted whenever a text job is finished. 
.PP
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 \fBstartText\fP or \fBresumeText\fP is called before the job is deleted, it will remain in the queue for speaking. 
.PP
\fBParameters:\fP
.RS 4
\fIappId\fP The DCOP senderId of the application that created the job. 
.br
\fIjobNum\fP Job number of the text job. 
.RE
.PP

.SS "void KSpeech::textStopped (const \fBQCString\fP & appId, uint jobNum)"
.PP
This signal is emitted whenever a speaking text job stops speaking. 
.PP
\fBParameters:\fP
.RS 4
\fIappId\fP The DCOP senderId of the application that created the job. 
.br
\fIjobNum\fP Job number of the text job.
.RE
.PP
The signal is only emitted if \fBstopText()\fP is called and the job is currently speaking. 
.SS "void KSpeech::textPaused (const \fBQCString\fP & appId, uint jobNum)"
.PP
This signal is emitted whenever a speaking text job is paused. 
.PP
\fBParameters:\fP
.RS 4
\fIappId\fP The DCOP senderId of the application that created the job. 
.br
\fIjobNum\fP Job number of the text job. 
.RE
.PP

.SS "void KSpeech::textResumed (const \fBQCString\fP & appId, uint jobNum)"
.PP
This signal is emitted when a text job, that was previously paused, resumes speaking. 
.PP
\fBParameters:\fP
.RS 4
\fIappId\fP The DCOP senderId of the application that created the job. 
.br
\fIjobNum\fP Job number of the text job. 
.RE
.PP

.SS "void KSpeech::textRemoved (const \fBQCString\fP & appId, uint jobNum)"
.PP
This signal is emitted whenever a text job is deleted from the queue. 
.PP
The job is no longer in the queue when this signal is emitted. 
.PP
\fBParameters:\fP
.RS 4
\fIappId\fP The DCOP senderId of the application that created the job. 
.br
\fIjobNum\fP Job number of the text job. 
.RE
.PP


.SH "Author"
.PP 
Generated automatically by Doxygen for interfaces/kspeech Library from the source code.
