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

jovie

  • sources
  • kde-4.12
  • kdeaccessibility
  • jovie
  • jovie
speaker.cpp
Go to the documentation of this file.
1 /***************************************************** vim:set ts=4 sw=4 sts=4:
2  Speaker class.
3 
4  This class is in charge of getting the messages, warnings and text from
5  the queue and calling speech-dispatcher to actually speak the texts.
6  -------------------
7  Copyright:
8  (C) 2006 by Gary Cramblitt <garycramblitt@comcast.net>
9  (C) 2009 by Jeremy Whiting <jpwhiting@kde.org>
10  -------------------
11  Original author: Gary Cramblitt <garycramblitt@comcast.net>
12 
13  This program is free software; you can redistribute it and/or modify
14  it under the terms of the GNU General Public License as published by
15  the Free Software Foundation; either version 2 of the License, or
16  (at your option) any later version.
17 
18  This program is distributed in the hope that it will be useful,
19  but WITHOUT ANY WARRANTY; without even the implied warranty of
20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  GNU General Public License for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with this program; if not, write to the Free Software
25  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  ******************************************************************************/
27 
28 // Speaker includes.
29 #include "speaker.h"
30 #include "speaker.moc"
31 
32 // System includes.
33 
34 // Qt includes.
35 #include <QtCore/QFile>
36 #include <QtCore/QDir>
37 #include <QtGui/QApplication>
38 #include <QtDBus/QtDBus>
39 #include <QtXml/QDomDocument>
40 
41 // KDE includes.
42 #include <kconfiggroup.h>
43 #include <kdebug.h>
44 #include <klocale.h>
45 #include <kstandarddirs.h>
46 #include <ktemporaryfile.h>
47 #include <kservicetypetrader.h>
48 #include <kspeech.h>
49 //#include <kio/job.h>
50 
51 // KTTS includes.
52 #include "utils.h"
53 #include "talkercode.h"
54 
55 // KTTSD includes.
56 //#include "talkermgr.h"
57 #include "ssmlconvert.h"
58 
59 
101 class SpeakerPrivate
102 {
103  SpeakerPrivate(Speaker *parent) :
104  connection(NULL),
105  filterMgr(new FilterMgr()),
106  config(new KConfig(QLatin1String( "kttsdrc" ))),
107  q(parent)
108  {
109  filterMgr->init();
110  }
111 
112  ~SpeakerPrivate()
113  {
114  spd_close(connection);
115  connection = NULL;
116 
117  // from speechdata class
118  // kDebug() << "Running: SpeechDataPrivate::~SpeechDataPrivate";
119  // Walk through jobs and emit jobStateChanged signal for each job.
120  //foreach (SpeechJob* job, allJobs)
121  // delete job;
122  //allJobs.clear();
123 
124  delete filterMgr;
125  delete config;
126 
127  foreach (AppData* applicationData, appData)
128  delete applicationData;
129  appData.clear();
130  }
131 
132  friend class Speaker;
133 
134 protected:
135 
136  bool ConnectToSpeechd()
137  {
138  bool retval = false;
139  connection = spd_open("jovie", "main", NULL, SPD_MODE_THREADED);
140  if (connection != NULL)
141  {
142  kDebug() << "successfully opened connection to speech dispatcher";
143  connection->callback_begin = connection->callback_end =
144  connection->callback_cancel = connection->callback_pause =
145  connection->callback_resume = Speaker::speechdCallback;
146 
147  spd_set_notification_on(connection, SPD_BEGIN);
148  spd_set_notification_on(connection, SPD_END);
149  spd_set_notification_on(connection, SPD_CANCEL);
150  spd_set_notification_on(connection, SPD_PAUSE);
151  spd_set_notification_on(connection, SPD_RESUME);
152  char ** modulenames = spd_list_modules(connection);
153  while (modulenames != NULL && modulenames[0] != NULL)
154  {
155  outputModules << QLatin1String( modulenames[0] );
156  modulenames++;
157  kDebug() << "added module " << outputModules.last();
158  }
159 
160  readTalkerData();
161 
162  retval = true;
163  }
164  return retval;
165  }
166 
167  // try to reconnect to speech-dispatcher, return true on success
168  bool reconnect()
169  {
170  spd_close(connection);
171  return ConnectToSpeechd();
172  }
173 
174  void readTalkerData()
175  {
176  config->reparseConfiguration();
177  // Iterate through list of the TalkerCode IDs.
178  KConfigGroup ttsconfig(config, "General");
179  QStringList talkerIDsList = ttsconfig.readEntry("TalkerIDs", QStringList());
180  // kDebug() << "TalkerListModel::loadTalkerCodesFromConfig: talkerIDsList = " << talkerIDsList;
181  if (!talkerIDsList.isEmpty())
182  {
183  QStringList::ConstIterator itEnd = talkerIDsList.constEnd();
184  for (QStringList::ConstIterator it = talkerIDsList.constBegin(); it != itEnd; ++it)
185  {
186  QString talkerID = *it;
187  kDebug() << "TalkerListWidget::loadTalkerCodes: talkerID = " << talkerID;
188  KConfigGroup talkGroup(config, "Talkers");
189  QString talkerCode = talkGroup.readEntry(talkerID);
190  TalkerCode tc = TalkerCode(talkerCode, true);
191  if (defaultTalker.name().isEmpty())
192  defaultTalker = tc;
193  kDebug() << "TalkerCodeWidget::loadTalkerCodes: talkerCode = " << talkerCode;
194  //tc.setId(talkerID);
195  // do something with the talker codes read in
196  }
197  currentTalker = defaultTalker;
198 
199  q->setOutputModule(defaultTalker.outputModule());
200  q->setLanguage(defaultTalker.language());
201  q->setVoiceType(defaultTalker.voiceType());
202  q->setVolume(defaultTalker.volume());
203  q->setPitch(defaultTalker.pitch());
204  q->setSpeed(defaultTalker.rate());
205  }
206  }
207 
211  QStringList outputModules;
212 
213  SPDConnection * connection;
214 
218  mutable QMap<QString, AppData*> appData;
219 
223  FilterMgr * filterMgr;
224 
228  KConfig *config;
229 
230  Speaker *q;
231 
236  TalkerCode defaultTalker;
237 
242  TalkerCode currentTalker;
243 };
244 
245 /* Public Methods ==========================================================*/
246 
247 Speaker * Speaker::m_instance = NULL;
248 
249 Speaker * Speaker::Instance()
250 {
251  if (m_instance == NULL)
252  {
253  m_instance = new Speaker();
254  }
255  return m_instance;
256 }
257 
258 void Speaker::speechdCallback(size_t msg_id, size_t /*client_id*/, SPDNotificationType type)
259 {
260  kDebug() << "speechdCallback called with messageid: " << msg_id << " and type: " << type;
261  //KSpeech::JobState state(KSpeech::jsQueued);
262  //switch (type) {
263  // case SPD_EVENT_BEGIN:
264  // state = KSpeech::jsSpeaking;
265  // break;
266  // case SPD_EVENT_END:
267  // state = KSpeech::jsFinished;
268  // break;
269  // case SPD_EVENT_INDEX_MARK:
270  // break;
271  // case SPD_EVENT_CANCEL:
272  // state = KSpeech::jsDeleted;
273  // break;
274  // case SPD_EVENT_PAUSE:
275  // state = KSpeech::jsPaused;
276  // break;
277  // case SPD_EVENT_RESUME:
278  // state = KSpeech::jsSpeaking;
279  // break;
280  //}
281 }
282 
283 Speaker::Speaker() :
284  d(new SpeakerPrivate(this))
285 {
286  if (!d->ConnectToSpeechd())
287  {
288  kDebug() << "connection: " << d->connection;
289  kError() << "could not get a connection to speech-dispatcher"<< endl;
290  }
291  // kDebug() << "Running: Speaker::Speaker()";
292  // Connect ServiceUnregistered signal from DBUS so we know when apps have exited.
293  connect (QDBusConnection::sessionBus().interface(), SIGNAL(serviceUnregistered(QString)),
294  this, SLOT(slotServiceUnregistered(QString)));
295 }
296 
297 Speaker::~Speaker(){
298  kDebug() << "Running: Speaker::~Speaker()";
299  delete d;
300 }
301 
302 void Speaker::init()
303 {
304  // from speechdata
305  // Create an initial FilterMgr for the pool to save time later.
306  kDebug() << "Running: Speaker::init()";
307  delete d->filterMgr;
308  d->filterMgr = new FilterMgr();
309  d->filterMgr->init();
310 
311  // Reread config setting the top voice if there is one.
312  d->readTalkerData();
313 }
314 
315 AppData* Speaker::getAppData(const QString& appId) const
316 {
317  if (!d->appData.contains(appId))
318  d->appData.insert(appId, new AppData(appId));
319  return d->appData[appId];
320 }
321 
322 bool Speaker::isSsml(const QString &text)
323 {
325  QDomDocument ssml;
326  ssml.setContent(text, false); // No namespace processing.
328  QDomElement root = ssml.documentElement();
329  return (root.tagName() == QLatin1String( "speak" ));
330 }
331 
332 QStringList Speaker::parseText(const QString &text, const QString &appId /*=NULL*/)
333 {
334  // There has to be a better way
335  // kDebug() << "I'm getting: "<< text << " from application " << appId;
336  if (isSsml(text)) {
337  QStringList tempList(text);
338  return tempList;
339  }
340  // See if app has specified a custom sentence delimiter and use it, otherwise use default.
341  QRegExp sentenceDelimiter(getAppData(appId)->sentenceDelimiter());
342  QString temp = text;
343  // Replace spaces, tabs, and formfeeds with a single space.
344  temp.replace(QRegExp(QLatin1String( "[ \\t\\f]+") ), QLatin1String( " " ));
345  // Replace sentence delimiters with tab.
346  temp.replace(sentenceDelimiter, QLatin1String( "\\1\t" ));
347  // Replace remaining newlines with spaces.
348  temp.replace(QLatin1Char( '\n' ),QLatin1Char( ' ' ));
349  temp.replace(QLatin1Char( '\r' ),QLatin1Char( ' ' ));
350  // Remove leading spaces.
351  temp.replace(QRegExp(QLatin1String( "\\t +" )), QLatin1String( "\t" ));
352  // Remove trailing spaces.
353  temp.replace(QRegExp(QLatin1String( " +\\t" )), QLatin1String( "\t" ));
354  // Remove blank lines.
355  temp.replace(QRegExp(QLatin1String( "\t\t+" )),QLatin1String( "\t" ));
356  // Split into sentences.
357  QStringList tempList = temp.split( QLatin1Char( '\t' ), QString::SkipEmptyParts);
358 
359 // for ( QStringList::Iterator it = tempList.begin(); it != tempList.end(); ++it ) {
360 // kDebug() << "'" << *it << "'";
361 // }
362  return tempList;
363 }
364 
365 int Speaker::say(const QString& appId, const QString& text, int sayOptions)
366 {
367  QString filteredText = text;
368  int jobNum = -1;
369 
370  AppData* appData = getAppData(appId);
371  KSpeech::JobPriority priority = appData->defaultPriority();
372  TalkerCode talkerCode = d->currentTalker;
373  //kDebug() << "Speaker::say priority = " << priority;
374  //kDebug() << "Running: Speaker::say appId = " << appId << " text = " << text;
375  //QString talker = appData->defaultTalker();
376 
377  SPDPriority spdpriority = SPD_PROGRESS; // default to least priority
378  switch (priority)
379  {
380  case KSpeech::jpScreenReaderOutput:
381  spdpriority = SPD_IMPORTANT;
382  break;
383  case KSpeech::jpWarning:
384  spdpriority = SPD_NOTIFICATION;
385  break;
386  case KSpeech::jpMessage:
387  spdpriority = SPD_MESSAGE;
388  break;
389  case KSpeech::jpText:
390  spdpriority = SPD_TEXT;
391  break;
392  case KSpeech::jpProgress:
393  spdpriority = SPD_PROGRESS;
394  break;
395  }
396 
397  if (appData->filteringOn()) {
398  filteredText = d->filterMgr->convert(text, &talkerCode, appId);
399  }
400 
401  // Change the voice to the talkerCode from the filter if needed.
402  if (talkerCode != d->currentTalker)
403  {
404  kDebug() << "Changing language from " << d->currentTalker.getTranslatedDescription() <<
405  " to " << talkerCode.getTranslatedDescription();
406  setOutputModule(talkerCode.outputModule());
407  // If there's a voiceName, use it, otherwise just use the language
408  if (!talkerCode.voiceName().isEmpty())
409  {
410  setVoiceName(talkerCode.voiceName());
411  }
412  else
413  {
414  setLanguage(TalkerCode::languageCodeToLanguage(talkerCode.language()));
415  }
416  setVoiceType(talkerCode.voiceType());
417  setVolume(talkerCode.volume());
418  setSpeed(talkerCode.rate());
419  setPitch(talkerCode.pitch());
420  }
421  emit newJobFiltered(text, filteredText);
422 
423  while (jobNum == -1 && d->connection != NULL)
424  {
425  switch (sayOptions)
426  {
427  case KSpeech::soNone:
428  jobNum = spd_say(d->connection, spdpriority, filteredText.toUtf8().data());
429  break;
430  case KSpeech::soPlainText:
431  jobNum = spd_say(d->connection, spdpriority, filteredText.toUtf8().data());
432  break;
433  case KSpeech::soHtml:
434  jobNum = spd_say(d->connection, spdpriority, filteredText.toUtf8().data());
435  break;
436  case KSpeech::soSsml:
437  spd_set_data_mode(d->connection, SPD_DATA_SSML);
438  jobNum = spd_say(d->connection, spdpriority, filteredText.toUtf8().data());
439  spd_set_data_mode(d->connection, SPD_DATA_TEXT);
440  break;
441  case KSpeech::soChar:
442  spd_set_spelling(d->connection, SPD_SPELL_ON);
443  jobNum = spd_say(d->connection, spdpriority, filteredText.toUtf8().data());
444  spd_set_spelling(d->connection, SPD_SPELL_OFF);
445  break;
446  case KSpeech::soKey:
447  jobNum = spd_key(d->connection, spdpriority, filteredText.toUtf8().data());
448  break;
449  case KSpeech::soSoundIcon:
450  jobNum = spd_sound_icon(d->connection, spdpriority, filteredText.toUtf8().data());
451  break;
452  }
453  if (jobNum == -1 && d->connection != NULL)
454  {
455  // job failure
456  // try to reconnect once
457  kDebug() << "trying to reconnect to speech dispatcher";
458  if (!d->reconnect())
459  {
460  // replace this with an error stored in kttsd in a log? to be viewed on hover over kttsmgr?
461  kDebug() << "could not connect to speech dispatcher";
462  }
463  }
464  }
465 
466  if (jobNum != -1)
467  {
468  kDebug() << "incoming job with text: " << text;
469  kDebug() << "saying post filtered text: " << filteredText;
470  }
471 
473  appData->jobList()->append(jobNum);
474  return jobNum;
475 }
476 
477 int Speaker::findJobNumByAppId(const QString& appId) const
478 {
479  if (appId.isEmpty())
480  return 0; // d->lastJobNum;
481  else
482  return getAppData(appId)->lastJobNum();
483 }
484 
485 void Speaker::requestExit()
486 {
487  // kDebug() << "Speaker::requestExit: Running";
488  //d->exitRequested = true;
489 }
490 
491 bool Speaker::isSpeaking()
492 {
493  return true; // TODO: ask speech-dispatcher somehow?
494 }
495 
496 void Speaker::setTalker(int jobNum, const QString &talker)
497 {
498  kDebug() << "Speaker::setTalker this is not implemented yet in speech-dispatcher";
499 }
500 
501 QStringList Speaker::outputModules()
502 {
503  return d->outputModules;
504 }
505 
506 QStringList Speaker::languagesByModule(const QString & module)
507 {
508  QStringList languages;
509  if (d->connection && module != QLatin1String("dummy") &&
510  spd_set_output_module(d->connection, module.toUtf8().data()) == 0)
511  {
512  SPDVoice ** voices = spd_list_synthesis_voices(d->connection);
513  while (voices != NULL && voices[0] != NULL)
514  {
515  if (!languages.contains(QLatin1String( voices[0]->language) ))
516  languages << QLatin1String( voices[0]->language );
517  ++voices;
518  }
519  }
520  return languages;
521 }
522 
523 QStringList Speaker::getPossibleTalkers()
524 {
525  QStringList talkers;
526 
527  foreach (const QString &module, d->outputModules)
528  {
529  if (d->connection &&
530  spd_set_output_module(d->connection, module.toUtf8().data()) == 0)
531  {
532  SPDVoice ** voices = spd_list_synthesis_voices(d->connection);
533  kDebug() << "Got voices for output module " << module;
534  while (voices != NULL && voices[0] != NULL)
535  {
536  TalkerCode code;
537  code.setOutputModule(module);
538  code.setVoiceName(QLatin1String(voices[0]->name));
539  code.setLanguage(QLatin1String(voices[0]->language));
540  talkers.append (code.getTalkerCode());
541  ++voices;
542  }
543  }
544  }
545 
546  return talkers;
547 }
548 
549 void Speaker::setSpeed(int speed)
550 {
551  if (d->connection) {
552  spd_set_voice_rate(d->connection, speed);
553  d->currentTalker.setRate(speed);
554  }
555 }
556 
557 int Speaker::speed()
558 {
559  return d->currentTalker.rate();
560 }
561 
562 void Speaker::setPitch(int pitch)
563 {
564  if (d->connection) {
565  spd_set_voice_pitch(d->connection, pitch);
566  d->currentTalker.setPitch(pitch);
567  }
568 }
569 
570 int Speaker::pitch()
571 {
572  return d->currentTalker.pitch();
573 }
574 
575 void Speaker::setVolume(int volume)
576 {
577  if (d->connection) {
578  spd_set_volume(d->connection, volume);
579  d->currentTalker.setVolume(volume);
580  }
581 }
582 
583 int Speaker::volume()
584 {
585  return d->currentTalker.volume();
586 }
587 
588 void Speaker::setOutputModule(const QString & module)
589 {
590  if (d->connection) {
591  int result = spd_set_output_module(d->connection, module.toUtf8().data());
592  d->currentTalker.setOutputModule(module);
593  // discard result for now, TODO: add error reporting
594  }
595 }
596 
597 QString Speaker::outputModule()
598 {
599  return d->currentTalker.outputModule();
600 }
601 
602 void Speaker::setVoiceName(const QString & voiceName)
603 {
604  if (d->connection) {
605  int result = spd_set_synthesis_voice(d->connection, voiceName.toUtf8().data());
606  d->currentTalker.setVoiceName(voiceName);
607  }
608 }
609 
610 QString Speaker::voiceName()
611 {
612  return d->currentTalker.voiceName();
613 }
614 
615 void Speaker::setLanguage(const QString & language)
616 {
617  if (d->connection) {
618  int result = spd_set_language(d->connection, language.toUtf8().data());
619  d->currentTalker.setLanguage(language);
620  // discard result for now, TODO: add error reporting
621  }
622 }
623 
624 QString Speaker::language()
625 {
626  return d->currentTalker.language();
627 }
628 
629 void Speaker::setVoiceType(int voiceType)
630 {
631  if (d->connection) {
632  int result = spd_set_voice_type(d->connection, SPDVoiceType(voiceType));
633  d->currentTalker.setVoiceType(voiceType);
634  // discard result for now, TODO: add error reporting
635  }
636 }
637 
638 int Speaker::voiceType()
639 {
640  return d->currentTalker.voiceType();
641 }
642 
643 void Speaker::stop()
644 {
645  if (d->connection)
646  spd_stop(d->connection);
647  else
648  kDebug() << "unable to stop as there's no connection to speech-dispatcher";
649 }
650 
651 void Speaker::cancel()
652 {
653  if (d->connection)
654  spd_cancel(d->connection);
655  else
656  kDebug() << "unable to cancel as there's no connection to speech-dispatcher";
657 }
658 
659 void Speaker::pause()
660 {
661  if (d->connection)
662  spd_pause(d->connection);
663  else
664  kDebug() << "unable to pause as there's no connection to speech-dispatcher";
665 }
666 
667 void Speaker::resume()
668 {
669  if (d->connection)
670  spd_resume(d->connection);
671  else
672  kDebug() << "unable to resume as there's no connection to speech-dispatcher";
673 }
674 
675 bool Speaker::isApplicationPaused(const QString& appId)
676 {
677  return getAppData(appId)->isApplicationPaused();
678 }
679 
680 void Speaker::slotServiceUnregistered(const QString& serviceName)
681 {
682  if (d->appData.contains(serviceName))
683  d->appData[serviceName]->setUnregistered(true);
684 }
Speaker::requestExit
void requestExit()
Tells the thread to exit.
Definition: speaker.cpp:485
TalkerCode::setLanguage
void setLanguage(const QString &language)
Definition: talkercode.cpp:159
Speaker::getAppData
AppData * getAppData(const QString &appId) const
Get application data.
Definition: speaker.cpp:315
TalkerCode::getTranslatedDescription
QString getTranslatedDescription() const
The Talker Code translated for display.
Definition: talkercode.cpp:221
Speaker::pitch
int pitch()
Definition: speaker.cpp:570
TalkerCode::language
QString language() const
Definition: talkercode.cpp:119
AppData::filteringOn
bool filteringOn() const
Returns the applications's current filtering enabled flag.
Definition: appdata.cpp:79
AppData::isApplicationPaused
bool isApplicationPaused() const
Returns whether the jobs of the application are currently paused.
Definition: appdata.cpp:81
Speaker::findJobNumByAppId
int findJobNumByAppId(const QString &appId) const
Given an appId, returns the last (most recently queued) Job Number with that appId, or if no such job, the Job Number of the last (most recent) job in the queue.
Definition: speaker.cpp:477
ssmlconvert.h
TalkerCode::setOutputModule
void setOutputModule(const QString &moduleName)
Definition: talkercode.cpp:189
Speaker::isApplicationPaused
bool isApplicationPaused(const QString &appId)
Return true if the application is paused.
Definition: speaker.cpp:675
TalkerCode::voiceName
QString voiceName() const
Definition: talkercode.cpp:144
Speaker::voiceName
QString voiceName()
Definition: speaker.cpp:610
Speaker::setOutputModule
void setOutputModule(const QString &module)
Definition: speaker.cpp:588
Speaker::speed
int speed()
Definition: speaker.cpp:557
Speaker::cancel
void cancel()
Stops the currently spoken message from this connection (if there is any) and discards all the queued...
Definition: speaker.cpp:651
Speaker::resume
void resume()
Resumes the speech.
Definition: speaker.cpp:667
AppData::lastJobNum
int lastJobNum() const
Return the JobNum of the last job queued by the application.
Definition: appdata.cpp:91
Speaker::~Speaker
~Speaker()
Destructor.
Definition: speaker.cpp:297
utils.h
speaker.h
TalkerCode::volume
int volume() const
Definition: talkercode.cpp:129
talkercode.h
Speaker::setVolume
void setVolume(int volume)
Definition: speaker.cpp:575
AppData
Definition: appdata.h:38
Speaker::setVoiceName
void setVoiceName(const QString &voiceName)
Definition: speaker.cpp:602
Speaker::outputModule
QString outputModule()
Definition: speaker.cpp:597
TalkerCode::getTalkerCode
QString getTalkerCode() const
Definition: talkercode.cpp:202
Speaker::Instance
static Speaker * Instance()
singleton accessor
Definition: speaker.cpp:249
TalkerCode::rate
int rate() const
Definition: talkercode.cpp:134
TalkerCode::languageCodeToLanguage
static QString languageCodeToLanguage(const QString &languageCode)
Converts a language code plus optional country code to language description.
Definition: talkercode.cpp:282
TalkerCode
Definition: talkercode.h:38
Speaker::newJobFiltered
void newJobFiltered(const QString &prefilterText, const QString &postfilterText)
This signal is emitted when a new job coming in is filtered (or not filtered if no filters are on)...
Speaker::language
QString language()
Definition: speaker.cpp:624
Speaker::say
int say(const QString &appId, const QString &text, int sayOptions)
Queue and start a speech job.
Definition: speaker.cpp:365
Speaker::voiceType
int voiceType()
Definition: speaker.cpp:638
AppData::defaultPriority
KSpeech::JobPriority defaultPriority() const
Returns the default priority (job type) for the application.
Definition: appdata.cpp:75
FilterMgr
Definition: filtermgr.h:40
Speaker::volume
int volume()
Definition: speaker.cpp:583
Speaker::isSpeaking
bool isSpeaking()
Determine if kttsd is currently speaking any jobs.
Definition: speaker.cpp:491
Speaker::languagesByModule
QStringList languagesByModule(const QString &module)
Definition: speaker.cpp:506
Speaker::init
void init()
(re)initializes the filtermgr
Definition: speaker.cpp:302
Speaker::stop
void stop()
Stops the message currently being spoken on a given connection.
Definition: speaker.cpp:643
Speaker::outputModules
QStringList outputModules()
Get the output modules available from speech-dispatcher.
Definition: speaker.cpp:501
Speaker::setSpeed
void setSpeed(int speed)
Definition: speaker.cpp:549
Speaker::pause
void pause()
Pauses the speech.
Definition: speaker.cpp:659
TalkerCode::voiceType
int voiceType() const
Definition: talkercode.cpp:124
TalkerCode::outputModule
QString outputModule() const
Definition: talkercode.cpp:149
TalkerCode::setVoiceName
void setVoiceName(const QString &voiceName)
Definition: talkercode.cpp:184
Speaker::setPitch
void setPitch(int pitch)
Definition: speaker.cpp:562
Speaker::setLanguage
void setLanguage(const QString &language)
Definition: speaker.cpp:615
Speaker
Definition: speaker.h:65
AppData::jobList
TJobListPtr jobList() const
List of jobs for this app.
Definition: appdata.cpp:98
TalkerCode::pitch
int pitch() const
Definition: talkercode.cpp:139
Speaker::setTalker
void setTalker(int jobNum, const QString &talker)
Change the talker for a job.
Definition: speaker.cpp:496
Speaker::getPossibleTalkers
QStringList getPossibleTalkers()
Definition: speaker.cpp:523
Speaker::speechdCallback
static void speechdCallback(size_t msg_id, size_t client_id, SPDNotificationType type)
Definition: speaker.cpp:258
Speaker::setVoiceType
void setVoiceType(int voiceType)
Definition: speaker.cpp:629
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:32:25 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

jovie

Skip menu "jovie"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdeaccessibility API Reference

Skip menu "kdeaccessibility API Reference"
  • jovie

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