QTextToSpeech Set default QLocale

In Qt 5.9.0 Class QTextToSpeech provides convenient access to the mechanisms of text-to-speech.

Below is a Qt example for QTextToSpeech here .

How can I change the locale and write another language (not English)?

I tried this code but didn't work:

QLocale locale;
locale.setDefault(QLocale::Persian);
m_speech->setLocale(locale);

      

Screenshot example

+3


source to share


1 answer


You need to first check if the locale you are looking for is available with a QTextToSpeech::availableLocales()

public function and then you can use if available.



+3


source







All Articles