QTextToSpeechEngine Class

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

Header: #include <QTextToSpeechEngine>
Inherits: QObject

Public Functions

QTextToSpeechEngine(QObject *parent = nullptr)
virtual QList<QLocale> availableLocales() const = 0
virtual QList<QVoice> availableVoices() const = 0
virtual QTextToSpeech::Capabilities capabilities() const
virtual QLocale locale() const = 0
virtual void pause(QTextToSpeech::BoundaryHint hint) = 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(QTextToSpeech::BoundaryHint hint) = 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, const QLocale &locale, QVoice::Gender gender, QVoice::Age age, const QVariant &data)
QVariant voiceData(const QVoice &voice)

Detailed Description

\inmoduleQtTextToSpeech

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

Member Function Documentation

[explicit] QTextToSpeechEngine::QTextToSpeechEngine(QObject *parent = nullptr)

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

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

Implementation of QTextToSpeech::availableLocales().

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

Implementation of QTextToSpeech::availableVoices().

[virtual] QTextToSpeech::Capabilities QTextToSpeechEngine::capabilities() const

Implementation of QTextToSpeech::engineCapabilities(). If this function is not implemented, then the capabilities will be read from the plugin meta data.

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

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

Parameters name, locale, 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(QTextToSpeech::BoundaryHint hint)

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().

[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] void QTextToSpeechEngine::stop(QTextToSpeech::BoundaryHint hint)

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().