QTextToSpeechEngine Class

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

头: #include <QTextToSpeechEngine>
qmake: QT += texttospeech
继承: QObject

公共函数

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

信号

void stateChanged (QTextToSpeech::State state )

静态保护成员

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

详细描述

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

成员函数文档编制

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 已改变。

This signal is connected to QTextToSpeech::stateChanged () 信号。

[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.

参数 name , gender , age and data are directly stored in the QVoice 实例。

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

Implementation of QTextToSpeech::locale ().

另请参阅 setLocale ().

[pure virtual] void QTextToSpeechEngine:: pause ()

Implementation of QTextToSpeech::pause ().

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

Implementation of QTextToSpeech::pitch ().

另请参阅 setPitch ().

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

Implementation of QTextToSpeech::rate ().

另请参阅 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 )

实现 QTextToSpeech::setLocale ( locale ).

返回 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.

另请参阅 locale ().

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

Implementation of QTextToSpeech::setPitch ( pitch ).

返回 true if the operation was successful.

另请参阅 pitch ().

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

Implementation of QTextToSpeech::setRate ( rate ).

返回 true if the operation was successful.

另请参阅 rate ().

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

Implementation of QTextToSpeech::setVoice ( voice ).

返回 true if the operation was successful.

另请参阅 voice ().

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

Implementation of QTextToSpeech::setVolume ( volume ).

返回 true if the operation was successful.

另请参阅 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 ().

另请参阅 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 ().

另请参阅 setVolume ().