Provides TTS URL generation.
More...
|
enum | Emotion { NoEmotion = -1
, Neutral
, Good
, Evil
} |
| Defines emotion to use. More...
|
|
enum | TtsError {
NoError
, UnsupportedEngine
, UnsupportedLanguage
, UnsupportedVoice
,
UnsupportedEmotion
} |
| Indicates all possible error conditions found during the processing of the URLs generation. More...
|
|
enum | Voice {
NoVoice = -1
, Zahar
, Ermil
, Jane
,
Oksana
, Alyss
, Omazh
} |
| Defines voice to use. More...
|
|
Example:
tts.
generateUrls(QLatin1String(
"Hello World!"), DOnlineTranslator::Google, DOnlineTranslator::English);
QList<QUrl> urls = tts.
media();
◆ Emotion
◆ TtsError
Enumerator |
---|
NoError | No error condition.
|
UnsupportedEngine | Specified engine does not support TTS.
|
UnsupportedLanguage | Unsupported language by specified engine.
|
UnsupportedVoice | Unsupported voice by specified engine.
|
UnsupportedEmotion | Unsupported emotion by specified engine.
|
◆ Voice
◆ DOnlineTts()
Digikam::DOnlineTts::DOnlineTts |
( |
QObject *const |
parent = nullptr | ) |
|
|
explicit |
Constructs an object with empty data and with parent. You can use generateUrls() to create URLs for use in QMediaPlayer.
- Parameters
-
◆ emotion()
Used only by Yandex.
- Parameters
-
- Returns
- corresponding emotion
◆ emotionCode()
QString Digikam::DOnlineTts::emotionCode |
( |
Emotion |
emotion | ) |
|
|
static |
Used only by Yandex.
- Parameters
-
emotion | the emotion to use |
- Returns
- code for emotion
◆ error()
Error that was found during the generating tts. If no error was found, returns TtsError::NoError. The text of the error can be obtained by errorString().
- Returns
- last error
◆ errorString()
QString Digikam::DOnlineTts::errorString |
( |
| ) |
const |
A human-readable description of the last tts URL generation error that occurred.
- Returns
- last error string
◆ generateUrls()
Splits text into parts (engines have a limited number of characters per request) and returns list with the generated API URLs to play.
- Parameters
-
text | the text to speak |
engine | online translation engine |
lang | text language |
voice | the voice to use (used only by Yandex) |
emotion | the emotion to use (used only by Yandex) |
◆ media()
QList< QUrl > Digikam::DOnlineTts::media |
( |
| ) |
const |
- Returns
- List of generated URLs
◆ voice()
Used only by Yandex.
- Parameters
-
- Returns
- corresponding voice
◆ voiceCode()
QString Digikam::DOnlineTts::voiceCode |
( |
Voice |
voice | ) |
|
|
static |
- Parameters
-
- Returns
- code for voice