[Kde-accessibility] KTTS News

Mikolaj Machowski mikmach at wp.pl
Sun Jan 30 16:00:01 CET 2005


Dnia niedziela, 30 stycznia 2005 03:03, Gary Cramblitt napisał:
> On Friday 28 January 2005 01:18 pm, Mikolaj Machowski wrote:
> > > > Added to english string replacer 'Word' BTW 'by the way' and voice
> > > > still reads it as 'bee tee dabl:u'.
>
> You added BTW to the String Replacer (English) filter but your default
> (topmost) Talker is Polish Festival, so unless you are somehow telling
> KTTSD that your text is English, KTTS is assuming the text is Polish. 
> Therefore the String Replacer (English) filter doesn't apply itself. 
> Either remove the "Language is" from the String Replacer (English)
> filter, or add BTW to the String Replacer (Polish) filter.

I was changing default talkers, I am not so stupid :)
Ah - looks like small omission/bug - in Filter Configuration you cannot
choose 'any language' (blank field), this is possible in Talker
Chooser's language configuration, so this is possible and should be
available.

Still cannot force BTW to 'by the way'.

BTW Talker chooser is really great :). One thing - by default Talker
Chooser filter should be first in the list (if this is possible and not
done already) because it can affect most other filters.

Oops. Dcop is in dead water. I see no possibility to allow kttsmgr to
choose talkers. When apps are using pure dcop Talker Chooser doesn't
work. Kpdf is an example - they don't have time to implement full
solution so used simple dcop call:

ui/pageview.cpp:
    // [2] speech selection using KTTSD
    DCOPClient * client = DCOPClient::mainClient();
    if ( !client->isAttached() )
	client->attach();
    // serialize the text to speech (selectedText) and the
    // preferred reader ("" is the default voice) ...
    QByteArray data;
    QDataStream arg( data, IO_WriteOnly );
    arg << selectedText;
    arg << QString();
    // ..and send it to KTTSD
    client->send( "kttsd", "KSpeech", "sayMessage(QString,QString)", 
data );

Also can be problem for script authors.

Solution: create special talker ID which enable to use internal KTTSD
filters/settings.

Currently this is for example:
dcop kttsd KSpeech sayMessage "This is it" 0

(empty -> '', is translated to 0 and kpdf always will speak with
default)

which uses default

dcop kttsd KSpeech sayMessage "This is it" 1
uses second voice.

Let 0 be a special ID which will take all properties of voice from
processed from internal settings not directly use default.

Similar problem have Konqueror.

Current solution also isn't very intuitional (for non-program writers)
because IDs in kttsmgr are starting from 1.

> > > > 'Polish replacements' also doesn't work.
>
> These should be Regular Expressions, i.e. check the Regular Expression
> radio button in the config dialog for each word.
> "Word" type filters are internally implemented as regular expressions of
> the form \bword\b, which means that the left and right parens would have
> to have word boundaries (spaces) on either side for them to be matched. 
> Also note the backslashes I added.

OK and sorry, Vim-habits when words are defined in more sophisticated
way. Works now.
>
>
> You didn't include { and }.  Was that on purpose?

Yes. To make testing faster. Whole list will be much longer.
Question: I'd like to make such file publicly available. Could it be
posted somewhere on kde-accessibility site?

BTW - this filter will be rather easy: s/[^a-zA-Z0-9{diacritics}]/ /

Of course I could make it available from my site but this would have
much less visibility.

Thanks for your attention :)

m.

-- 
LaTeX + Vim = http://vim-latex.sourceforge.net/
Vim Universal Templates 
	http://www.vim.org/scripts/script.php?script_id=1078
CLEWN - http://clewn.sf.net




More information about the kde-accessibility mailing list