• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KSpeech

Public Slots | Signals | Properties | List of all members
OrgKdeKSpeechInterface Class Reference
Inheritance diagram for OrgKdeKSpeechInterface:
Inheritance graph
[legend]

Public Slots

QString applicationName ()
 
bool autoConfigureTalkersOn ()
 
void changeJobTalker (int jobNum, const QString &talker)
 
int defaultPriority ()
 
QString defaultTalker ()
 
bool filteringOn ()
 
int getCurrentJob ()
 
int getJobCount (int priority)
 
QByteArray getJobInfo (int jobNum)
 
QStringList getJobNumbers (int priority)
 
QString getJobSentence (int jobNum, int sentenceNum)
 
int getJobState (int jobNum)
 
int getSentenceCount (int jobNum)
 
int getTalkerCapabilities1 (const QString &talker)
 
int getTalkerCapabilities2 (const QString &talker)
 
QStringList getTalkerCodes ()
 
QStringList getTalkerVoices (const QString &talker)
 
QString htmlFilterXsltFile ()
 
bool isApplicationPaused ()
 
bool isSpeaking () const
 
bool isSystemManager ()
 
void kttsdExit ()
 
void moveJobLater (int jobNum)
 
int moveRelSentence (int jobNum, int n)
 
void pause ()
 
void reinit ()
 
void removeAllJobs ()
 
void removeJob (int jobNum)
 
void resume ()
 
int say (const QString &text, int options)
 
int sayClipboard ()
 
int sayFile (const QString &filename, const QString &encoding)
 
QString sentenceDelimiter ()
 
void setApplicationName (const QString &applicationName)
 
void setAutoConfigureTalkersOn (bool autoConfigureTalkersOn)
 
void setCallingAppId (const QString &appId)
 
void setDefaultPriority (int defaultPriority)
 
void setDefaultTalker (const QString &defaultTalker)
 
void setFilteringOn (bool filteringOn)
 
void setHtmlFilterXsltFile (const QString &htmlFilterXsltFile)
 
void setIsSystemManager (bool isSystemManager)
 
void setSentenceDelimiter (const QString &sentenceDelimiter)
 
void setSsmlFilterXsltFile (const QString &ssmlFilterXsltFile)
 
void showManagerDialog ()
 
QString ssmlFilterXsltFile ()
 
QString talkerToTalkerId (const QString &talker)
 
QString version () const
 

Signals

void jobStateChanged (const QString &appId, int jobNum, int state)
 
void kttsdExiting ()
 
void kttsdStarted ()
 
void marker (const QString &appId, int jobNum, int markerType, const QString &markerData)
 

Properties

bool isSpeaking
 
QString version
 

Detailed Description

D-Bus Interface to KSpeech.

#include "kspeechinterface.h"

The D-Bus interface to KSpeech. Applications may speak text using this class, or by sending D-Bus messages to application "org.kde.kttsd", object path "/KSpeech", interface "org.kde.KSpeech".

You must generate the kspeechinterface.h file using the qdbusxml2cpp utility. See Using OrgKdeKSpeechInterface for more information.

Definition at line 787 of file Mainpage.dox.

Member Function Documentation

QString OrgKdeKSpeechInterface::applicationName ( )
slot

Returns the friendly display name for the application.

Returns
Application display name.

If application has not provided a friendly name, the D-Bus connection name is returned.

See also
setApplicationName
bool OrgKdeKSpeechInterface::autoConfigureTalkersOn ( )
slot

Returns whether KTTSD will automatically attempt to configure new talkers to meet required talker attributes.

Returns
True if KTTSD will autoconfigure talkers.
See also
setAutoConfigureTalkersOn
defaultTalker
Talkers, Talker Codes, and Plugins
void OrgKdeKSpeechInterface::changeJobTalker ( int  jobNum,
const QString &  talker 
)
slot

Change the talker of an already-submitted job.

Parameters
jobNumJob Number. If 0, the last job submitted by the application.
talkerDesired new talker.
See also
Talkers, Talker Codes, and Plugins
int OrgKdeKSpeechInterface::defaultPriority ( )
slot

Returns the default priority for speech jobs submitted by the application.

Returns
Default job priority. See KSpeech::JobPriority.
See also
setDefaultPriority
Speech Jobs and Priorities
QString OrgKdeKSpeechInterface::defaultTalker ( )
slot

Returns the default talker for the application.

Returns
Talker.

The default is "", which uses the default talker configured by user.

See also
setDefaultTalker
Talkers, Talker Codes, and Plugins
bool OrgKdeKSpeechInterface::filteringOn ( )
slot

Returns whether speech jobs for this application are filtered using configured filter plugins.

Returns
True if filtering is on.

Filtering is on by default.

See also
setFilteringOn
Filters
int OrgKdeKSpeechInterface::getCurrentJob ( )
slot

Returns the job number of the currently speaking job (any application).

Returns
Job Number
int OrgKdeKSpeechInterface::getJobCount ( int  priority)
slot

Returns the number of jobs belonging to the application with the specified job priority.

Parameters
priorityJob Priority. See KSpeech::JobPriority.
Returns
Number of jobs.

If priority is KSpeech::jpAll, returns the number of jobs belonging to the application (all priorities).

When called from a System Manager, returns count of all jobs of the specified priority for all applications.

See also
Speech Jobs and Priorities
QByteArray OrgKdeKSpeechInterface::getJobInfo ( int  jobNum)
slot

Get information about a job.

Parameters
jobNumJob Number. If 0, the last job submitted by the application.
Returns
A QDataStream containing information about the job. Blank if no such job.

The stream contains the following elements:

  • int priority Job Type.
  • int state Job state.
  • QString appId D-Bus senderId of the application that requested the speech job.
  • QString talker Talker code as requested by application.
  • int sentenceNum Current sentence being spoken. Sentences are numbered starting at 1.
  • int sentenceCount Total number of sentences in the job.
  • QString applicationName Application's friendly name (if provided by app)

If the job is currently filtering, waits for that to finish before returning.

The following sample code will decode the stream:

             QByteArray jobInfo = m_kspeech->getJobInfo(jobNum);
             if (jobInfo != QByteArray()) {
                 QDataStream stream(&jobInfo, QIODevice::ReadOnly);
                 qint32 priority;
                 qint32 state;
                 QString talker;
                 qint32 sentenceNum;
                 qint32 sentenceCount;
                 QString applicationName;
                 stream >> priority;
                 stream >> state;
                 stream >> appId;
                 stream >> talker;
                 stream >> sentenceNum;
                 stream >> sentenceCount;
                 stream >> applicationName;
             };
QStringList OrgKdeKSpeechInterface::getJobNumbers ( int  priority)
slot

Returns a list job numbers for the jobs belonging to the application with the specified priority.

Parameters
priorityJob Priority. See KSpeech::JobPriority.
Returns
List of job numbers. Note that the numbers are strings.

If priority is KSpeech::jpAll, returns the job numbers belonging to the application (all priorities).

When called from a System Manager, returns job numbers of the specified priority for all applications.

See also
Speech Jobs and Priorities
QString OrgKdeKSpeechInterface::getJobSentence ( int  jobNum,
int  sentenceNum 
)
slot

Return a sentence of a job.

Parameters
jobNumJob Number. If 0, the last job submitted by the application.
sentenceNumSentence Number. Sentence numbers start at 1.
Returns
The specified sentence in the specified job. If no such job or sentence, returns "".
int OrgKdeKSpeechInterface::getJobState ( int  jobNum)
slot

Returns the state of a job.

Parameters
jobNumJob Number. If 0, the last job submitted by the application.
Returns
Job state. See KSpeech::JobState.
int OrgKdeKSpeechInterface::getSentenceCount ( int  jobNum)
slot

Returns the number of sentences in a job.

Parameters
jobNumJob Number. If 0, the last job submitted by the application.
Returns
Number of sentences in the job.
int OrgKdeKSpeechInterface::getTalkerCapabilities1 ( const QString &  talker)
slot

Returns a bitarray giving the capabilities of a talker.

Parameters
talkerTalker. Example: "en".
Returns
A word with bits set according to the capabilities of the talker.
See also
getTalkerCapabilities2
int OrgKdeKSpeechInterface::getTalkerCapabilities2 ( const QString &  talker)
slot

Returns a bitarray giving the capabilities of a talker.

Parameters
talkerTalker. Example: "en".
Returns
A word with bits set according to the capabilities of the talker.
See also
getTalkerCapabilities1
QStringList OrgKdeKSpeechInterface::getTalkerCodes ( )
slot

Return a list of full Talker Codes for configured talkers.

Returns
List of Talker codes.
See also
Talkers, Talker Codes, and Plugins
QStringList OrgKdeKSpeechInterface::getTalkerVoices ( const QString &  talker)
slot

Return a list of the voice codes of voices available in the synthesizer corresponding to a talker.

Parameters
talkerTalker. Example: "synthesizer='Festival'"
Returns
List of voice codes.

Voice codes are synthesizer specific.

See also
Talkers, Talker Codes, and Plugins
QString OrgKdeKSpeechInterface::htmlFilterXsltFile ( )
slot

Returns the full path name to XSLT file used to convert HTML markup to speakable form.

Returns
XSLT filename.
See also
setHtmlFilterXsltFile
Filters
bool OrgKdeKSpeechInterface::isApplicationPaused ( )
slot

Returns whether application is paused.

Returns
True if application is paused.
See also
pause
bool OrgKdeKSpeechInterface::isSpeaking ( ) const
slot

Returns true if KTTSD is currently speaking.

Returns
True if currently speaking.
bool OrgKdeKSpeechInterface::isSystemManager ( )
slot

Returns whether this is a System Manager application.

Returns
True if the application is a System Manager.
See also
setIsSystemManager
void OrgKdeKSpeechInterface::jobStateChanged ( const QString &  appId,
int  jobNum,
int  state 
)
signal

This signal is emitted each time the state of a job changes.

Parameters
appIdThe D-Bus connection name of the application that submitted the job.
jobNumJob Number.
stateJob state. KSpeech::JobState.
void OrgKdeKSpeechInterface::kttsdExit ( )
slot

Shuts down KTTSD.

Do not call this!

void OrgKdeKSpeechInterface::kttsdExiting ( )
signal

This signal is emitted just before KTTS exits.

void OrgKdeKSpeechInterface::kttsdStarted ( )
signal

This signal is emitted when KTTSD starts.

void OrgKdeKSpeechInterface::marker ( const QString &  appId,
int  jobNum,
int  markerType,
const QString &  markerData 
)
signal

This signal is emitted when a marker is processed.

Currently only emits mtSentenceBegin and mtSentenceEnd.

Parameters
appIdThe D-Bus connection name of the application that submitted the job.
jobNumJob Number of the job emitting the marker.
markerTypeThe type of marker. See KSpeech::MarkerType. Currently either mtSentenceBegin or mtSentenceEnd.
markerDataData for the marker. Currently, this is the sentence number of the sentence begun or ended. Sentence numbers begin at 1.
void OrgKdeKSpeechInterface::moveJobLater ( int  jobNum)
slot

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

If the job is already speaking, it is stopped and will resume when processing next gets to it.

Parameters
jobNumJob Number. If 0, the last job submitted by the application.

Since there is only one ScreenReaderOutput, this method is meaningless for ScreenReaderOutput jobs.

int OrgKdeKSpeechInterface::moveRelSentence ( int  jobNum,
int  n 
)
slot

Advance or rewind N sentences in a job.

Parameters
jobNumJob Number. If 0, the last job submitted by the application.
nNumber of sentences to advance (positive) or rewind (negative) in the job.
Returns
Number of the sentence actually moved to. Sentence numbers are numbered starting at 1.

If no such job, does nothing and returns 0. If n is zero, returns the current sentence number of the job. Does not affect the current speaking/not-speaking state of the job.

Since ScreenReaderOutput jobs are not split into sentences, this method is meaningless for ScreenReaderOutput jobs.

void OrgKdeKSpeechInterface::pause ( )
slot

Pauses speech jobs belonging to the application.

When called by a System Manager, pauses all jobs of all applications.

See also
isApplicationPaused
void OrgKdeKSpeechInterface::reinit ( )
slot

Cause KTTSD to re-read its configuration.

void OrgKdeKSpeechInterface::removeAllJobs ( )
slot

Removes all jobs belonging to the application.

When called from a System Manager, removes all jobs of all applications.

See also
removeJob
void OrgKdeKSpeechInterface::removeJob ( int  jobNum)
slot

Removes the specified job.

If the job is speaking, it is stopped.

Parameters
jobNumJob Number. If 0, the last job submitted by the application.
See also
removeAllJobs
void OrgKdeKSpeechInterface::resume ( )
slot

Resumes speech jobs belonging to the application.

When called by a System Manager, resumes all jobs of all applications.

int OrgKdeKSpeechInterface::say ( const QString &  text,
int  options 
)
slot

Creates and starts a speech job.

The job is created at the application's default job priority using the default talker.

Parameters
textThe text to be spoken.
optionsSpeech options. See KSpeech::SayOptions.
Returns
Job Number for the new job.
See also
Speech Jobs and Priorities
int OrgKdeKSpeechInterface::sayClipboard ( )
slot

Submits a speech job from the contents of the clipboard.

The job is spoken using application's default talker.

Returns
Job Number for the new job.
See also
defaultTalker
Speech Jobs and Priorities
int OrgKdeKSpeechInterface::sayFile ( const QString &  filename,
const QString &  encoding 
)
slot

Creates and starts a speech job from a specified file.

Parameters
filenameFull path name of the file.
encodingThe encoding of the file. Default UTF-8.
Returns
Job Number for the new job.

The job is spoken using application's default talker.

See also
defaultTalker

Plain text is parsed into individual sentences using the current sentence delimiter. Call setSentenceDelimiter to change the sentence delimiter prior to calling sayFile. Call getSentenceCount to retrieve the sentence count after calling sayFile.

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

See also
Speech Jobs and Priorities
QString OrgKdeKSpeechInterface::sentenceDelimiter ( )
slot

Returns the regular expression used to perform Sentence Boundary Detection (SBD) for the application.

Returns
Sentence delimiter regular expression.

The default sentence delimiter is

       ([\\.\\?\\!\\:\\;])(\\s|$|(\\n *\\n))

Note that backward slashes must be escaped.

See also
setSentenceDelimiter
Sentence Parsing
void OrgKdeKSpeechInterface::setApplicationName ( const QString &  applicationName)
slot

Sets a friendly display name for the application.

Parameters
applicationNameFriendly name for the application.
See also
applicationName
void OrgKdeKSpeechInterface::setAutoConfigureTalkersOn ( bool  autoConfigureTalkersOn)
slot

Sets whether KTTSD will automatically attempt to configure new talkers to meet required talker attributes.

Parameters
autoConfigureTalkersOnTrue to enable auto configuration.
See also
autoConfigureTalkersOn
Talkers, Talker Codes, and Plugins
void OrgKdeKSpeechInterface::setCallingAppId ( const QString &  appId)
slot

Called by DBusAdaptor so that KTTSD knows the application that called it.

Parameters
appIdD-Bus connection name that called KSpeech.
void OrgKdeKSpeechInterface::setDefaultPriority ( int  defaultPriority)
slot

Sets the default priority for speech jobs submitted by the application.

Parameters
defaultPriorityDefault job priority. See KSpeech::JobPriority.
See also
defaultPriority
Speech Jobs and Priorities
void OrgKdeKSpeechInterface::setDefaultTalker ( const QString &  defaultTalker)
slot

Sets the default talker for the application.

Parameters
defaultTalkerDefault talker. Example: "en".
See also
defaultTalker
Talkers, Talker Codes, and Plugins
void OrgKdeKSpeechInterface::setFilteringOn ( bool  filteringOn)
slot

Sets whether speech jobs for this application are filtered using configured filter plugins.

Parameters
filteringOnTrue to set filtering on.
See also
filteringOn
Filters
void OrgKdeKSpeechInterface::setHtmlFilterXsltFile ( const QString &  htmlFilterXsltFile)
slot

Sets the full path name to an XSLT file used to convert HTML markup to speakable form.

Parameters
htmlFilterXsltFileXSLT filename.
See also
htmlFilterXsltFile
Filters
void OrgKdeKSpeechInterface::setIsSystemManager ( bool  isSystemManager)
slot

Sets whether this is a System Manager application.

Parameters
isSystemManagerTrue if this is a System Manager.

System Managers are used to control and configure overall TTS output. When True, many of the KSpeech methods alter their behavior.

See also
isSystemManager
void OrgKdeKSpeechInterface::setSentenceDelimiter ( const QString &  sentenceDelimiter)
slot

Sets the regular expression used to perform Sentence Boundary Detection (SBD) for the application.

Parameters
sentenceDelimiterSentence delimiter regular expression.
See also
sentenceDelimiter
Sentence Parsing
void OrgKdeKSpeechInterface::setSsmlFilterXsltFile ( const QString &  ssmlFilterXsltFile)
slot

Sets the full path name to XSLT file used to convert SSML markup to a speakable form.

Parameters
ssmlFilterXsltFileXSLT filename.
See also
ssmlFilterXsltFile
Filters
void OrgKdeKSpeechInterface::showManagerDialog ( )
slot

Display the KttsMgr program so that user can configure KTTS options.

Only one instance of KttsMgr is displayed.

QString OrgKdeKSpeechInterface::ssmlFilterXsltFile ( )
slot

Returns the full path name to XSLT file used to convert SSML markup to a speakable form.

Returns
XSLT filename.
See also
setSsmlFilterXsltFile
Filters
QString OrgKdeKSpeechInterface::talkerToTalkerId ( const QString &  talker)
slot

Given a talker, returns the Talker ID for the talker.

that will speak the job.

Parameters
talkerTalker. Example: "en".
Returns
Talker ID. A Talker ID is an internally-assigned identifier for a talker.

This method is normally used only by System Managers.

QString OrgKdeKSpeechInterface::version ( ) const
slot

Returns the version number of KTTSD.

Returns
Version number string.

Property Documentation

bool OrgKdeKSpeechInterface::isSpeaking
read

Definition at line 791 of file Mainpage.dox.

QString OrgKdeKSpeechInterface::version
read

Definition at line 792 of file Mainpage.dox.


The documentation for this class was generated from the following file:
  • Mainpage.dox
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:52:17 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KSpeech

Skip menu "KSpeech"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal