QVoice#

The QVoice class represents a particular voice. More

Synopsis#

Properties#

  • age - The age of a voice

  • gender - The gender of a voice

  • language - The language of the voice

  • locale - The locale of the voice

  • name - The name of a voice

Functions#

Static functions#

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description#

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

class PySide6.QtTextToSpeech.QVoice#

PySide6.QtTextToSpeech.QVoice(other)

Parameters:

otherPySide6.QtTextToSpeech.QVoice

Constructs an empty QVoice .

Application code cannot construct arbitrary voice instances. Use availableVoices() or findVoices() instead to select a supported voice.

Copy-constructs a QVoice from other.

Note

Properties can be used directly when from __feature__ import true_property is used or via accessor functions otherwise.

property PᅟySide6.QtTextToSpeech.QVoice.age: Age#

This property holds the age of a voice.

Access functions:
property PᅟySide6.QtTextToSpeech.QVoice.gender: Gender#

This property holds the gender of a voice.

Access functions:
property PᅟySide6.QtTextToSpeech.QVoice.language: Language#

This property holds the language of the voice.

This is the language attribute of the voice’s locale .

Access functions:
property PᅟySide6.QtTextToSpeech.QVoice.locale: PySide6.QtCore.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.

Access functions:
property PᅟySide6.QtTextToSpeech.QVoice.name: str#

This property holds the name of a voice.

Access functions:
PySide6.QtTextToSpeech.QVoice.Gender#

The gender of a voice.

Constant

Description

QVoice.Male

Voice of a male

QVoice.Female

Voice of a female

QVoice.Unknown

Voice of unknown gender

PySide6.QtTextToSpeech.QVoice.Age#

The age of a voice.

Constant

Description

QVoice.Child

Voice of a child

QVoice.Teenager

Voice of a teenager

QVoice.Adult

Voice of an adult

QVoice.Senior

Voice of a senior

QVoice.Other

Voice of unknown age

PySide6.QtTextToSpeech.QVoice.age()#
Return type:

Age

Getter of property age .

static PySide6.QtTextToSpeech.QVoice.ageName(age)#
Parameters:

ageAge

Return type:

str

Returns a string representing the age class of a voice.

PySide6.QtTextToSpeech.QVoice.gender()#
Return type:

Gender

Getter of property gender .

static PySide6.QtTextToSpeech.QVoice.genderName(gender)#
Parameters:

genderGender

Return type:

str

̈́ Returns the gender name of a voice.

PySide6.QtTextToSpeech.QVoice.language()#
Return type:

Language

Getter of property language .

PySide6.QtTextToSpeech.QVoice.locale()#
Return type:

PySide6.QtCore.QLocale

Getter of property locale .

PySide6.QtTextToSpeech.QVoice.name()#
Return type:

str

Getter of property name .

PySide6.QtTextToSpeech.QVoice.__ne__(rhs)#
Parameters:

rhsPySide6.QtTextToSpeech.QVoice

Return type:

bool

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

PySide6.QtTextToSpeech.QVoice.__eq__(rhs)#
Parameters:

rhsPySide6.QtTextToSpeech.QVoice

Return type:

bool

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.

PySide6.QtTextToSpeech.QVoice.swap(other)#
Parameters:

otherPySide6.QtTextToSpeech.QVoice

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