New Proklam

Pupeno pupeno at
Mon Sep 23 23:10:17 BST 2002

Hash: SHA1

After some intresting discution in kde-accessibility I decided to redising 
Proklam to satisfy the necesities of everyone (specifically, the project that 
showed me the faults in the current design was KMouth, developed by Gunnar 
Schmi Dt).
The new design I think it's much more better than the old one and much more 
ambitious. I'm also trying to work with the Gnome people so there is some 
kind of interoperatibility between Proklam and gnome-speech.
Attached to this file is a simple draft of the new design. Everyone intrested, 
please, read it and post your comments. I think Proklam design still needs a 
lot of work till it is mature enough.
Thank you.
- -- 
Pupeno: pupeno at
- ---
Help the hungry children of Argentina, 
please go to (and make it your homepage):
PS: people in the recent kde-accessibility discution, please, note that the 
message/warning/text design has been changed for a more versatile aproach.
PSPS: The latest copy of this file may be accessed in KDE CVS server, in 
kdenonbeta repository in the directory proklam or with the web interface in or maybe 
directly to 
(the file isn't available in the web interface when this mail is being 
Version: GnuPG v1.0.7 (GNU/Linux)

-------------- next part --------------
Proklam architecture
The goal of this document is to describe Proklam's architecture.
External architecture which means the interface that will be used by other applications to communicate with Proklam.
Internal architecture which is how Proklam will work with the plug ins, configuration, etc, etc.

External architecture
Proklam will offer a set of functions available thru dcop to any application to use them. Optionally, there will be a class called KSpeech that will allow an easy way to use this functions.
Proklam has two types of texts to be spoken which has different functionality:
  Messages: Short messages of high priority (.i.e: 'You have new e-mail in the folder kde-devel', 'Babylon 5 is about to start in 10 minutes in channel 55', 'Instant message from John Smith', 'Power failure, computer will shut down')
  Texts: Long texts of low priority (i.e.: big txt, web pages, KWord documents).

Messages are ment for short queueable text with variable priority.
The priority will be an integer that will show which texts to be spoken first, the higher the priorty, the soon the texts gets spoken. A standard numbering system should be made so the priority from application to application remains consistent.
There is a configured number that will divide the messages in two, the ones that can interrumpt paragraphs and the ones that can't, see Texts for more information.

Texts are ment for long single navegable texts.
The texts will be parsed and divided into sentences and paragraphs. This will allow the navegability per sentence and per paragraph as well as stop and resuming in the same sentence.
This also allow to check for high priority messages. The messages with a priority over some number that can be configured will be spoken between sentences. Between paragraphs, all the available messages will be spoken.

DCOP Exported functions
int sayMsg(const QString &text, const QString &lang, int priority)
  text is the text to be spoken.
  lang is the language of this text (i.e.: en, es, de). There may be an optional language xml which will mean that the language is specified in the message with xml tags (<german></german><spanish></spanish>) this will allow to have more than one language in the same message.
  priority is the number that gives the priority to this text, see Messages and Texts for more information.
  Returns the id of the message, this id is used to do anything to the message, if it returns -1, a problem ocurred.

bool rmMsg(int id)
  Removes a message of id id, if the message is deleted sucesfully, true is returned, otherwise, false is returned.

int msgs();
  Returns the amount of messages in the queue;

void setText(const QString &text);
  This sets the text to be spoken. When running this function, all the parsing of the text is done but it's not spoken unless the playText function is called.

QString getText();
  This function returns the text in Proklam's memory.

bool removeText();
  Removes the text, if everything is ok, returns true, if something goes wrong, returns false.
bool prevParText();
  Previous one paragraph, if it is done, it returns true, if it isn't (there's not text or the paragraph is the first one) it returns false

bool prevSenText();
  Previous one sentence, if it is done, it returns true, if it isn't (there's no text or the sentence is the first one) it returns false.
int stopText();
  Stops the text... if it returns 0, there was no text to be stopped or it was already stopped, if it returns 1, the text was stoped succesfully but it will continue until the end of the sentence, if it returns 2, the text was stoped at once and the sentece pointer remained in the current sentence.

bool isTextStoped();
  Returns true if the text is stoped (or non existance), otherwise, false.
bool playText();
  Starts playing text from where the sentence pointer is. Returns true if the text is started to being played, false if something goes wrong (i.e.: no text).

bool nextSenText();    
  Next one sentence, if it is done, it returns true, if it isn't (there's no text or the sentence is the last one) it returns false.
bool nextParText();
  Next one paragraph, if it is done, it returns true, if it isn't (there's not text or the paragraph is the last one) it returns false
QStringList languages();
  This will return the list of languages supported (configured with working plug ins) by Proklam at that time.

Internal architecture
Proklam is a plug in based system. This allows to have any number of plug ins depending on any amount of libraries no matter how rare, unstandard, uportable or hard to compile they are.
Proklam will try to provide as much as posible all the features porvided by the TTS systems providing emulation for the features that some TTS doesn't provie (depending on the kind of feature this emulation could be done in the core or in the plug in).
Proklam plug ins system will be language centric to allow applications to speak in more than one language.
A default language will be selected that will be used if no language is specified or if the specified language is not suported.
Proklam will have per language configuration allowing to load diferent plug ins for diferent languages or the same plug in for diferent languages and tunning the system for the best performance. (One language may require more memory than others).

More information about the kde-core-devel mailing list