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 DCOP.
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 DCOP Interface. Full documentation for both APIs is available online at the KDE Accessibility web site (http://accessibility.kde.org).
Applications communicate requests for Text-to-Speech services via the KDE DCOP 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
dcop kttsd KSpeech setText "
text
" "talker
"
where
is the text to be spoken, and text
is a language code
such as talker
, en
, etc. This command does
not speak the text; instead it queues a text job for speaking.cy
Example.
dcop kttsd KSpeech setText "This is a test." "en"
To speak the last queued text job
dcop kttsd KSpeech startText
0
In this case, 0
refers to the last text job queued.
You may also specify a specific job number. (If no job number is given, a 0
is required.)
To stop the currently speaking text job
dcop kttsd KSpeech stopText 0
Depending upon the speech plugin used, speaking may not immediately stop.
There are many more commands that can be sent. To see a list of possible commands,
dcop kttsd KSpeech
or read the KDE Text-to-Speech API online.
Would you like to make a comment or contribute an update to this page?
Send feedback to the KDE Docs Team