QTextToSpeechEngine Class

The QTextToSpeechEngine class is the base for text-to-speech engine integrations. More...

Header: #include <QTextToSpeechEngine>
qmake: QT += texttospeech
Inherits: QObject

Public Functions

QTextToSpeechEngine(QObject *parent = nullptr)
virtual QVector<QLocale> availableLocales() const = 0
virtual QVector<QVoice> availableVoices() const = 0
virtual QLocale locale() const = 0
virtual void pause() = 0
virtual double pitch() const = 0
virtual double rate() const = 0
virtual void resume() = 0
virtual void say(const QString &text) = 0
virtual bool setLocale(const QLocale &locale) = 0
virtual bool setPitch(double pitch) = 0
virtual bool setRate(double rate) = 0
virtual bool setVoice(const QVoice &voice) = 0
virtual bool setVolume(double volume) = 0
virtual QTextToSpeech::State state() const = 0
virtual void stop() = 0
virtual QVoice voice() const = 0
virtual double volume() const = 0

Signals

void stateChanged(QTextToSpeech::State state)

Static Protected Members

QVoice createVoice(const QString &name, QVoice::Gender gender, QVoice::Age age, const QVariant &data)
QVariant voiceData(const QVoice &voice)

Detailed Description

An engine implementation must derive from QTextToSpeechEngine and implement all its pure virtual methods.

Member Function Documentation

QTextToSpeechEngine::QTextToSpeechEngine(QObject *parent = nullptr)

Constructs the text-to-speech engine base class with parent.

[signal] void QTextToSpeechEngine::stateChanged(QTextToSpeech::State state)

Emitted when the text-to-speech engine state has changed.

This signal is connected to QTextToSpeech::stateChanged() signal.

[pure virtual] QVector<QLocale> QTextToSpeechEngine::availableLocales() const

Implementation of QTextToSpeech::availableLocales().

[pure virtual] QVector<QVoice> QTextToSpeechEngine::availableVoices() const

Implementation of QTextToSpeech::availableVoices().

[static protected] QVoice QTextToSpeechEngine::createVoice(const QString &name, QVoice::Gender gender, QVoice::Age age, const QVariant &data)

Creates a voice for a text-to-speech engine.

Parameters name, gender, age and data are directly stored in the QVoice instance.

[pure virtual] QLocale QTextToSpeechEngine::locale() const

Implementation of QTextToSpeech::locale().

See also setLocale().

[pure virtual] void QTextToSpeechEngine::pause()

Implementation of QTextToSpeech::pause().

[pure virtual] double QTextToSpeechEngine::pitch() const

Implementation of QTextToSpeech::pitch().

See also setPitch().

[pure virtual] double QTextToSpeechEngine::rate() const

Implementation of QTextToSpeech::rate().

See also setRate().

[pure virtual] void QTextToSpeechEngine::resume()

Implementation of QTextToSpeech::resume().

[pure virtual] void QTextToSpeechEngine::say(const QString &text)

Implementation of QTextToSpeech::say(text).

[pure virtual] bool QTextToSpeechEngine::setLocale(const QLocale &locale)

Implementation QTextToSpeech::setLocale(locale).

Return true if the operation was successful. In this case, the current voice (as returned by voice()) should also be updated to a new, valid value.

See also locale().

[pure virtual] bool QTextToSpeechEngine::setPitch(double pitch)

Implementation of QTextToSpeech::setPitch(pitch).

Return true if the operation was successful.

See also pitch().

[pure virtual] bool QTextToSpeechEngine::setRate(double rate)

Implementation of QTextToSpeech::setRate(rate).

Return true if the operation was successful.

See also rate().

[pure virtual] bool QTextToSpeechEngine::setVoice(const QVoice &voice)

Implementation of QTextToSpeech::setVoice(voice).

Return true if the operation was successful.

See also voice().

[pure virtual] bool QTextToSpeechEngine::setVolume(double volume)

Implementation of QTextToSpeech::setVolume(volume).

Return true if the operation was successful.

See also volume().

[pure virtual] QTextToSpeech::State QTextToSpeechEngine::state() const

Implementation of QTextToSpeech::state().

[pure virtual] void QTextToSpeechEngine::stop()

Implementation of QTextToSpeech::stop().

[pure virtual] QVoice QTextToSpeechEngine::voice() const

Implementation of QTextToSpeech::voice().

See also setVoice().

[static protected] QVariant QTextToSpeechEngine::voiceData(const QVoice &voice)

Returns the engine-specific private data for the given voice.

[pure virtual] double QTextToSpeechEngine::volume() const

Implementation of QTextToSpeech::volume().

See also setVolume().

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.