QTextToSpeech plugin threading question
-
Hi all,
I'm writting a plugin for QTextToSpeech to use another speech engine than the ones available now.
This engine syncronously generates speech audio samples that I need to pass to a QAudioOutput to play it.
I will use the QTextToSpeech api from a Qml UI.
I' wondering if and where I should you threads:
1/ Do I need to put my engine in a dedicated thread ?
2/ Do I need to put the QAudioOutput in a dedicated thread ?Thanks in advance for your feedback on this.
Cheers
-
Hi,
Does that task takes time/resources ? If so, then I would move the engine handling in its own thread. Doing so, you'll likely have the QAudioOuput in the same thread as the engine.
-
@X-Krys have you checked the source code for the QTextToSpeech plugins? In particular, QTextToSpeechProcessor which:
// A common base class for text-to-speech engine integrations
// that require audio output implementation and thread handling. -
@Pablo-J.-Rogina Oh I totally missed it! I looked at some plugins but not flite implementation that use it, gonna have a look! thanks!