3

In Qt 5.9.0, The QTextToSpeech class provides a convenient access to text-to-speech engines.

There is a Qt example for QTextToSpeech here.

How Can I change locale and write other language(non-english) ?

I tried this code, not working:

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

Example Screenshot

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Farhad
  • 4,119
  • 8
  • 43
  • 66

1 Answers1

4

You need to first validate if the locale you are looking for is available on your platform with QTextToSpeech::availableLocales() public function and then you may use if that is available.

Azeem
  • 11,148
  • 4
  • 27
  • 40