summaryrefslogtreecommitdiffstats
path: root/src/tts/qtexttospeechengine.cpp
blob: a107fc2e8612d6a9a0ab4f0534ff5e43ce173fc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the Qt Speech module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL3$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or later as published by the Free
** Software Foundation and appearing in the file LICENSE.GPL included in
** the packaging of this file. Please review the following information to
** ensure the GNU General Public License version 2.0 requirements will be
** met: http://www.gnu.org/licenses/gpl-2.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/

#include "qtexttospeechengine.h"

#include <QLoggingCategory>

QT_BEGIN_NAMESPACE


/*!
  \class QTextToSpeechEngine
  \inmodule QtSpeech
  \brief The QTextToSpeechEngine class is the base for text-to-speech engine integrations.

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

/*! \fn QVector<QLocale> QTextToSpeechEngine::availableLocales() const

  Implementation of \l QTextToSpeech::availableLocales().
*/

/*! \fn QVector<QVoice> QTextToSpeechEngine::availableVoices() const

  Implementation of \l QTextToSpeech::availableVoices().
*/

/*! \fn void QTextToSpeechEngine::say(const QString &text)

  Implementation of \l {QTextToSpeech::say()}{QTextToSpeech::say}(\a text).
*/

/*! \fn void QTextToSpeechEngine::stop()

  Implementation of \l QTextToSpeech::stop().
*/

/*! \fn void QTextToSpeechEngine::pause()

  Implementation of \l QTextToSpeech::pause().
*/

/*! \fn void QTextToSpeechEngine::resume()

  Implementation of \l QTextToSpeech::resume().
*/

/*! \fn void QTextToSpeechEngine::rate() const

  Implementation of \l QTextToSpeech::rate().
*/

/*! \fn bool QTextToSpeechEngine::setRate(double rate)

  Implementation of \l {QTextToSpeech::setRate()}{QTextToSpeech::setRate}(\a rate).

  Return \c true if the operation was successful.
*/

/*! \fn void QTextToSpeechEngine::pitch() const

  Implementation of \l QTextToSpeech::pitch().
*/

/*! \fn bool QTextToSpeechEngine::setPitch(double pitch)

  Implementation of \l {QTextToSpeech::setPitch()}{QTextToSpeech::setPitch}(\a pitch).

  Return \c true if the operation was successful.
*/

/*! \fn QLocale QTextToSpeechEngine::locale() const

  Implementation of QTextToSpeech::locale().
*/

/*! \fn bool QTextToSpeechEngine::setLocale(const QLocale &locale)

  Implementation \l {QTextToSpeech::setLocale()}{QTextToSpeech::setLocale}(\a locale).

  Return \c 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.
*/

/*! \fn double QTextToSpeechEngine::volume() const

  Implementation of QTextToSpeech::volume().
*/

/*! \fn bool QTextToSpeechEngine::setVolume(double volume)

  Implementation of \l {QTextToSpeech::setVolume()}{QTextToSpeech::setVolume}(\a volume).

  Return \c true if the operation was successful.
*/

/*! \fn QVoice QTextToSpeechEngine::voice() const

  Implementation of \l QTextToSpeech::voice().
*/

/*! \fn bool QTextToSpeechEngine::setVoice(const QVoice &voice)

  Implementation of \l {QTextToSpeech::setVoice()}{QTextToSpeech::setVoice}(\a voice).

  Return \c true if the operation was successful.
*/

/*! \fn QTextToSpeech::State QTextToSpeechEngine::state() const

  Implementation of QTextToSpeech::state().
*/

/*! \fn void QTextToSpeechEngine::stateChanged(QTextToSpeech::State state)

  Emitted when the text-to-speech engine \a state has changed.

  This signal is connected to QTextToSpeech::stateChanged() signal.
*/

/*!
  Constructs the text-to-speech engine base class with \a parent.
*/
QTextToSpeechEngine::QTextToSpeechEngine(QObject *parent):
    QObject(parent)
{
}

QTextToSpeechEngine::~QTextToSpeechEngine()
{
}

/*!
  Creates a voice for a text-to-speech engine.

  Parameters \a name, \a gender, \a age and \a data are directly stored in the QVoice instance.
*/
QVoice QTextToSpeechEngine::createVoice(const QString &name, QVoice::Gender gender, QVoice::Age age, const QVariant &data)
{
    return QVoice(name, gender, age, data);
}

/*!
  Returns the engine-specific private data for the given \a voice.

*/
QVariant QTextToSpeechEngine::voiceData(const QVoice &voice)
{
    return voice.data();
}

QT_END_NAMESPACE