IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QVoice Class

The QVoice class represents a particular voice.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QVoice Class

  • Header: QVoice

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS TextToSpeech)

    target_link_libraries(mytarget PRIVATE Qt6::TextToSpeech)

  • qmake: QT += texttospeech

Detailed Description

To get a voice that is supported by the current text-to-speech engine, use QTextToSpeech::availableVoices().

Member Type Documentation

 

enum QVoice::Age

The age of a voice.

Constant

Value

Description

QVoice::Child

0

Voice of a child

QVoice::Teenager

1

Voice of a teenager

QVoice::Adult

2

Voice of an adult

QVoice::Senior

3

Voice of a senior

QVoice::Other

4

Voice of unknown age

enum QVoice::Gender

The gender of a voice.

Constant

Value

Description

QVoice::Male

0

Voice of a male

QVoice::Female

1

Voice of a female

QVoice::Unknown

2

Voice of unknown gender

Property Documentation

 

[read-only] age : const Age

This property holds the age of a voice

Access functions:

  • age() const

[read-only] gender : const Gender

This property holds the gender of a voice

Access functions:

  • gender() const

[read-only, since 6.4] locale : const QLocale

This property holds the locale of the voice

The locale includes the language and the territory (i.e. accent or dialect) of the voice.

This property was introduced in Qt 6.4.

Access functions:

  • locale() const

[read-only] name : const QString

This property holds the name of a voice

Access functions:

  • name() const

Member Function Documentation

 

QVoice::QVoice()

Constructs an empty QVoice.

QVoice::QVoice(const QVoice &other)

Copy-constructs a QVoice from other.

QVoice::QVoice(QVoice &&other)

Constructs a QVoice object by moving from other.

QVoice::~QVoice()

Destroys the QVoice instance.

[static] QString QVoice::ageName(QVoice::Age age)

Returns a string representing the age class of a voice.

[static] QString QVoice::genderName(QVoice::Gender gender)

̈́ Returns the gender name of a voice.

[since 6.4] void QVoice::swap(QVoice &other)

Swaps other with this voice. This operation is very fast and never fails.

This function was introduced in Qt 6.4.

QVoice &QVoice::operator=(const QVoice &other)

Assigns other to this QVoice object.

QVoice &QVoice::operator=(QVoice &&other)

Moves other into this QVoice object.

Related Non-Members

 

bool operator!=(const QVoice &lhs, const QVoice &rhs)

Returns whether the lhs voice and the rhs voice are different.

[since 6.4] QDataStream &operator<<(QDataStream &stream, const QVoice &voice)

Serializes voice to data stream stream.

This function was introduced in Qt 6.4.

See Also

[since 6.4] QDebug operator<<(QDebug debug, const QVoice &voice)

Writes information about voice to the debug stream.

This function was introduced in Qt 6.4.

See Also

See also QDebug

bool operator==(const QVoice &lhs, const QVoice &rhs)

Returns whether the lhs voice and the rhs voice are identical.

Two voices are identical if name, locale, gender, and age are identical, and if they belong to the same text-to-speech engine.

[since 6.4] QDataStream &operator>>(QDataStream &stream, QVoice &voice)

Deserializes voice from data stream stream.

This function was introduced in Qt 6.4.

See Also

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+