docs.kde.org
Developer's Guide to KTTS
Prev
Next

Chapter 4. Developer's Guide to KTTS

Table of Contents

The KTTS D-Bus Interface

KTTS has two Application Programmer Interfaces (APIs):

  • The KDE Text-to-Speech API, which is used by application programmers to give their applications TTS capabilities. Applications communicate with KTTSD via D-Bus.

  • The KTTSD Plugin API, which is used to add speech synthesis plugins to KTTSD so that KTTS will work with a new speech synthesis engine.

The following section gives a short description of the KDE Text-to-Speech API D-Bus Interface. Full documentation for both APIs is available online at the KDE Accessibility web site (http://accessibility.kde.org).

The KTTS D-Bus Interface

Applications communicate requests for Text-to-Speech services via the KDE D-Bus interface to program kttsd object KSpeech.

Enter the following commands in a Konsole.

If KTTSD is not already running

kttsd

To queue a text job to be spoken

qdbus org.kde.kttsd /KSpeech say "text" "options"

where text is the text to be spoken, and options is a language code such as en, cy, etc.

Example.

qdbus org.kde.kttsd /KSpeech say "This is a test." "en"

There are many more commands that can be sent. To see a list of possible commands,

qdbus org.kde.kttsd /KSpeech

or read the KDE Text-to-Speech API online.

Prev
Next
Contents