|
libosmscout 0.1
|
Piper (libpiper) based text-to-speech engine. More...
#include <PiperTTSEngine.h>
Inheritance diagram for osmscout::PiperTTSEngine:Public Member Functions | |
| Voice | getVoice () override |
| void | initVoice (const Voice &voice) override |
| Initialize the engine for the given voice. | |
| PiperTTSEngine (const QString &espeakDataDir) | |
| void | playMessage (QString message) override |
| Prepare the message (when it is not cached yet) and play it right away. | |
| void | prepareMessage (QString message) override |
| Synthesize the message to an audio file (cached in a temporary directory) without playing it. | |
| ~PiperTTSEngine () override | |
Public Member Functions inherited from osmscout::TTSEngine | |
| TTSEngine & | operator= (const TTSEngine &)=delete |
| TTSEngine & | operator= (TTSEngine &&)=delete |
| TTSEngine () | |
| TTSEngine (const TTSEngine &)=delete | |
| TTSEngine (TTSEngine &&)=delete | |
| ~TTSEngine () override | |
Protected Member Functions | |
| void | cleanCache () override |
| Remove the oldest synthesized WAV files when the cache directory exceeds the size limit. | |
Additional Inherited Members | |
Public Slots inherited from osmscout::TTSEngine | |
Signals inherited from osmscout::TTSEngine | |
| void | playAudioFilesRequest (const QList< QUrl > &audioFiles) |
Protected Attributes inherited from osmscout::TTSEngine | |
| QThread * | thread |
| engine background thread (owns itself, deleted on finish) | |
Piper (libpiper) based text-to-speech engine.
Synthesis is performed with the (synchronous) Piper API on the engine background thread. Each message is rendered into a WAV file placed in the per-application cache directory (e.g. ~/.cache/... on Unix) and cached, so repeated messages are synthesized only once. Playback is delegated to the VoiceCorePlayer.
Support for Piper is optional; this class is only compiled and available when the library was built with libpiper (see the CMake / Meson build files). When libpiper is missing, NavigationModule simply keeps its TTS engine unset.
|
explicit |
| player | audio player used to play synthesized messages. |
| espeakDataDir | path to the espeak-ng data directory required by Piper. |
|
override |
|
overrideprotectedvirtual |
Remove the oldest synthesized WAV files when the cache directory exceeds the size limit.
Called on the engine thread when the engine thread starts.
Reimplemented from osmscout::TTSEngine.
References osmscout::Log::Debug(), osmscout::log, and osmscout::Log::Warn().
|
overridevirtual |
Implements osmscout::TTSEngine.
|
overridevirtual |
Initialize the engine for the given voice.
Runs asynchronously on the engine thread.
Implements osmscout::TTSEngine.
References osmscout::AppendFileToDir(), osmscout::Log::Debug(), osmscout::Log::Error(), osmscout::ExistsInFilesystem(), osmscout::Voice::getDir(), osmscout::Voice::getModelFile(), osmscout::Voice::getName(), osmscout::Voice::isPiper(), osmscout::Voice::isValid(), osmscout::log, and osmscout::Log::Warn().
|
overridevirtual |
Prepare the message (when it is not cached yet) and play it right away.
Runs asynchronously on the engine thread.
Implements osmscout::TTSEngine.
References osmscout::TTSEngine::playAudioFilesRequest().
|
overridevirtual |
Synthesize the message to an audio file (cached in a temporary directory) without playing it.
Runs asynchronously on the engine thread.
Implements osmscout::TTSEngine.