|
libosmscout 0.1
|
Abstract text-to-speech engine. More...
#include <TTSEngine.h>
Inheritance diagram for osmscout::TTSEngine:Public Slots | |
| virtual void | initVoice (const Voice &voice)=0 |
| Initialize the engine for the given voice. | |
| virtual void | playMessage (QString message)=0 |
| Prepare the message (when it is not cached yet) and play it right away. | |
| virtual void | prepareMessage (QString message)=0 |
| Synthesize the message to an audio file (cached in a temporary directory) without playing it. | |
Signals | |
| void | playAudioFilesRequest (const QList< QUrl > &audioFiles) |
Public Member Functions | |
| virtual Voice | getVoice ()=0 |
| TTSEngine & | operator= (const TTSEngine &)=delete |
| TTSEngine & | operator= (TTSEngine &&)=delete |
| TTSEngine () | |
| TTSEngine (const TTSEngine &)=delete | |
| TTSEngine (TTSEngine &&)=delete | |
| ~TTSEngine () override | |
Protected Member Functions | |
| virtual void | cleanCache () |
| Called on the engine thread when the background thread starts. | |
Protected Attributes | |
| QThread * | thread |
| engine background thread (owns itself, deleted on finish) | |
Abstract text-to-speech engine.
It synthesizes spoken navigation instructions and plays them through the provided VoiceCorePlayer.
Speech synthesis may be a slow, synchronous operation (see PiperTTSEngine), so the engine runs in its own background thread. All operations (initVoice, prepareMessage, playMessage) are executed asynchronously on that thread, they should be invoked through a queued connection (e.g. QMetaObject::invokeMethod with Qt::QueuedConnection).
The background thread is created and started by the base constructor. When it starts, cleanCache() is invoked on the engine thread (default implementation is empty, a derived class may override it to prune its cache).
| osmscout::TTSEngine::TTSEngine | ( | ) |
References cleanCache(), and thread.
|
delete |
|
delete |
|
override |
References thread.
|
protectedvirtual |
Called on the engine thread when the background thread starts.
The default implementation does nothing; a derived class may override it to clean up its on-disk cache. Runs on the engine thread.
Reimplemented in osmscout::PiperTTSEngine.
Referenced by TTSEngine().
|
pure virtual |
Implemented in osmscout::PiperTTSEngine.
|
pure virtualslot |
Initialize the engine for the given voice.
Runs asynchronously on the engine thread.
Implemented in osmscout::PiperTTSEngine.
|
signal |
Referenced by osmscout::PiperTTSEngine::playMessage().
|
pure virtualslot |
Prepare the message (when it is not cached yet) and play it right away.
Runs asynchronously on the engine thread.
Implemented in osmscout::PiperTTSEngine.
|
pure virtualslot |
Synthesize the message to an audio file (cached in a temporary directory) without playing it.
Runs asynchronously on the engine thread.
Implemented in osmscout::PiperTTSEngine.
|
protected |
engine background thread (owns itself, deleted on finish)
Referenced by TTSEngine(), and ~TTSEngine().