이 페이지에서

QVoice Class

QVoice 클래스는 특정 음성을 나타냅니다. 더 보기...

헤더: #include <QVoice>
CMake: find_package(Qt6 REQUIRED COMPONENTS TextToSpeech)
target_link_libraries(mytarget PRIVATE Qt6::TextToSpeech)
qmake: QT += texttospeech

공개 유형

enum Age { Child, Teenager, Adult, Senior, Other }
enum Gender { Male, Female, Unknown }

속성

  • (since 6.4) locale : const QLocale
  • name : const QString

공용 함수

QVoice()
QVoice(const QVoice &other)
QVoice(QVoice &&other)
~QVoice()
QVoice::Age age() const
QVoice::Gender gender() const
QLocale::Language language() const
QLocale locale() const
QString name() const
(since 6.4) void swap(QVoice &other)
QVoice &operator=(QVoice &&other)
QVoice &operator=(const QVoice &other)

정적 공용 멤버

QString ageName(QVoice::Age age)
QString genderName(QVoice::Gender gender)
bool operator!=(const QVoice &lhs, const QVoice &rhs)
(since 6.4) QDataStream &operator<<(QDataStream &stream, const QVoice &voice)
(since 6.4) QDebug operator<<(QDebug debug, const QVoice &voice)
bool operator==(const QVoice &lhs, const QVoice &rhs)
(since 6.4) QDataStream &operator>>(QDataStream &stream, QVoice &voice)

상세 설명

현재 텍스트 음성 변환 엔진에서 지원하는 음성을 얻으려면 QTextToSpeech::availableVoices() 또는 QTextToSpeech::findVoices()을 사용하십시오.

멤버 유형 설명

enum QVoice::Age

목소리의 나이.

Constant값설명
QVoice::Child0어린이의 목소리
QVoice::Teenager1십대의 목소리
QVoice::Adult2성인의 목소리
QVoice::Senior3노인의 목소리
QVoice::Other4연령 불명의 목소리

enum QVoice::Gender

목소리의 성별.

상수값설명
QVoice::Male0남성의 목소리
QVoice::Female1여성의 목소리
QVoice::Unknown2성별 미상의 목소리

속성 설명

[read-only] age : const Age

이 속성은 목소리의 나이를 나타냅니다

액세스 기능:

QVoice::Age age() const

[read-only] gender : const Gender

이 속성은 음성의 성별을 나타냅니다

액세스 기능:

QVoice::Gender gender() const

[read-only, since 6.6] language : QLocale::Language

이 속성은 음성의 언어를 나타냅니다.

이는 음성의 ` locale` 속성 중 하나인 ` language `입니다.

이 열거형은 Qt 6.6에서 도입되었습니다.

액세스 함수:

QLocale::Language language() const

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

이 속성은 음성의 로케일을 나타냅니다.

로케일에는 음성의 언어와 지역(즉, 억양 또는 방언)이 포함됩니다.

이 열거형은 Qt 6.4에서 도입되었습니다.

액세스 함수:

QLocale locale() const

[read-only] name : const QString

이 속성은 음성 이름을 저장합니다

Access 함수:

QString name() const

멤버 함수 설명서

QVoice::QVoice()

빈 QVoice 객체를 생성합니다.

애플리케이션 코드에서는 임의의 음성 인스턴스를 생성할 수 없습니다. 대신 QTextToSpeech::availableVoices() 또는 QTextToSpeech::findVoices()를 사용하여 지원되는 음성을 선택하십시오.

[noexcept] QVoice::QVoice(const QVoice &other)

other 에서 QVoice 객체를 복사하여 생성합니다.

[constexpr noexcept default] QVoice::QVoice(QVoice &&other)

other 에서 데이터를 가져와 QVoice 객체를 생성합니다.

[noexcept] QVoice::~QVoice()

QVoice 인스턴스를 삭제합니다.

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

음성의 ` age ` 클래스를 나타내는 문자열을 반환합니다.

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

̈́ 보이스의 ‘ gender ’ 이름을 반환합니다.

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

other 를 이 음성으로 교체합니다. 이 작업은 매우 빠르며 실패하는 일이 없습니다.

이 기능은 Qt 6.4에서 도입되었습니다.

[noexcept] QVoice &QVoice::operator=(QVoice &&other)

other 를 이 QVoice 객체로 이동합니다.

[noexcept] QVoice &QVoice::operator=(const QVoice &other)

이 QVoice 객체에 other 를 할당합니다.

관련 비멤버

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

lhs 보이스와 rhs 보이스가 서로 다른지 여부를 반환합니다.

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

voice 를 데이터 스트림 stream 으로 직렬화합니다.

이 함수는 Qt 6.4에서 도입되었습니다.

‘Qt 데이터 유형 직렬화’항목도 참조하십시오 .

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

voice 에 대한 정보를 debug 스트림에 기록합니다.

이 함수는 Qt 6.4에서 도입되었습니다.

QDebug도 참조하십시오 .

[noexcept] bool operator==(const QVoice &lhs, const QVoice &rhs)

lhs 음성과 rhs 음성이 동일한지 여부를 반환합니다.

두 보이스(voice)는 name, locale, gender 및 age 가 동일하고, 동일한 텍스트 음성 변환 엔진에 속할 경우 동일하다고 간주됩니다.

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

데이터 스트림 stream 에서 voice 를 역직렬화합니다.

이 함수는 Qt 6.4에서 도입되었습니다.

‘Qt 데이터 유형 직렬화’항목도 참조하십시오 .

© 2026 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.