This PR adds the ability to switch the text-to-speech engine away from Qt Speech (libspeechd on Linux, Sin-Ji or other voices on macOS, etc.) to a series of audio files downloaded from Google TTS.
This alternative works as follows:
User chooses Google TTS in the Advanced settings pane.
User is prompted to do a one-time download of the audio files.
After download is complete and files are unzipped, user clicks on the speaker button for Cantonese or Mandarin.
The Jyutping or Pinyin for a phrase is split into a list of syllables using ChineseUtils::segmentJyutping or ChineseUtils::segmentPinyin respectively.
The audio file for each syllable is played. (For example, hoi1 wui2 => Jyut Dictionary plays hoi1.mp3 and wui2.mp3.)
Closes #132.
Type of change
[x] New feature (non-breaking change which adds functionality)
How Has This Been Tested?
Test Configuration:
Tested default behaviour (downloading audio files successfully and switching to Google TTS).
Tested interrupted download (disabling Wi-Fi/ethernet during download), making sure that error code was displayed.
Description
This PR adds the ability to switch the text-to-speech engine away from Qt Speech (
libspeechd
on Linux,Sin-Ji
or other voices on macOS, etc.) to a series of audio files downloaded from Google TTS.This alternative works as follows:
ChineseUtils::segmentJyutping
orChineseUtils::segmentPinyin
respectively.Closes #132.
Type of change
How Has This Been Tested?
Test Configuration:
Tested default behaviour (downloading audio files successfully and switching to Google TTS).
Tested interrupted download (disabling Wi-Fi/ethernet during download), making sure that error code was displayed.
[x] macOS
OS and version: macOS 14.1 Sonoma
Toolchain: Xcode 15 clang/clang++
Qt Version: 5.15.12, provided by KDE craft
[x] Ubuntu
OS and version: Pop!_OS 22.04
Toolchain: g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Qt Version: 5.15.2
[x] Windows
OS and version: Windows 11 22H2 22621.1555
Toolchain: MinGW 8.1.0
Qt Version: 5.15.12, provided by KDE craft
Checklist:
black
for Python code,.clang-format
in thesrc/jyut-dict
directory for C++)