Text to Speech - eliranwong/UniqueBible GitHub Wiki

Text-to-Speech Feature

UBA users can access text-to-speech through right-click context menu, Master Control "Miscellaneous" tab and Note Editor "Text Utility" toolbar.

Text-to-speech Engines

Unique Bible App supports five different text-to-speech engines or modules. Two of them require internet connection, and the rest does not.

Online Text-to-speech engines:

  1. Google Cloud Text-to-speech service - personal credential required (see below); nice voices with support of many languages; voice setup is not required; support speed adjustment and mp3 file export. Read more at https://cloud.google.com/text-to-speech To begin and create credential key, read https://cloud.google.com/text-to-speech/docs/before-you-begin

  2. Python gTTS package - UBA installs this package for users on startup; no setup is required; support mp3 file export. However, this package does not support speed adjustment. Read more at https://pypi.org/project/gTTS/

Offline Text-to-speech engines:

  1. Apple macOS built-in tts engine - read https://github.com/eliranwong/UniqueBible/wiki/Use-Apple-macOS-Built-in-Text-to-speech

  2. Espeak - online tts engine for Linux users; support speed adjustment and multiple languages; setup is required, e.g. https://github.com/eliranwong/ChromeOSLinux/blob/main/multimedia/espeak.md

  3. QTextToSpeech - built-in qt tts engine; support multiple languages on Windows and macOS; setup of non-default voices is required; support speed adjustment. However, its behaviour varies across different platforms. In addition, it does not support mp3 file export.

Setup of Google Cloud Text-to-speech

Google Cloud Text-to-speech offers more features than the rest of the engines UBA supports. However, it requires extra steps for setup:

  1. Create a credential key for Google Cloud text-to-speech service and download it. Read for details at https://cloud.google.com/text-to-speech/docs/before-you-begin

  2. Rename the credential key file to "credentials_GoogleCloudTextToSpeech.json"

  3. Place the credential key file "credentials_GoogleCloudTextToSpeech.json" in UniqueBibleApp folder.

Config flags

You may set config flags via menu UniqueBible > Config Flags:

If "credentials_GoogleCloudTextToSpeech.json" is in place, UBA uses Google Cloud Text-to-speech engine automatically.

If "credentials_GoogleCloudTextToSpeech.json" is in not place, the follow config flags control which text-to-speech engine is used.

forceOnlineTts - in case both online and offline engines are available, UBA uses offline engines by default unless users set this option on to instruct UBA to use online tts engines instead.

espeak - enable this option on Linux to uses espeak tts engine when "forceOnlineTts" is disabled.

Enter "speech" in search field to quickly locate the two items mentioned above.

Select Default Text-to-Speech Voice:

Default Text-to-Speech Voice is uses with "Speak" feature triggered from right-click context menu:

Default text-to-speech language is configurable via Material menu layout: UniqueBible > Other Preferences > Select Default Text-to-speech Voice.

Select Second and Third Text-to-speech Voices

Users can have two more handy text-to-speech buttons displayed on the second top toolbar. With three buttons in place, users can quickly use three different voices to read selected or entered text. For example, users who study original bible languages may like to select English, Hebrew and Greek voices for the three buttons.

The second and the third instant TTS buttons are visible only if you define the second and the third voices via material menu layout menu.

Select non-default Voices

You can select non-default voices via right-click context menu, master control "Miscellaneous" tab or note editor.

Changing Text-to-Speech Language on Miscellaneous Tab

From version 21.78, changing text-to-speech language on Master Control Miscellaneous tab changes default text-to-speech language.

Therefore, users can allow quickly change the default text-to-speech language by calling Miscellaneous tab with keyboard shortcut Ctrl+M.

Adjust speed

You can adjust speed via Master Control Miscellaneous tab.

As mentioned above, all text-to-speech engines, supported by UBA, except python gTTS package, supports speed adjustment.

Multi-line Editing

You can make use of multi-line editor in note editor and text-to-speech features together.

MP3 File Export

These feature is supported only if you use the online tts engines UBA supports.

  1. Select text

  2. Right-click > select "Save as MP3"

  1. Specify file location and file name

Micron shortcuts

Micron shortcut users can use the following key combo:

Ctrl+Shift+T - read selected text with default text-to-speech voice

Ctrl+Shift+Q - close media player, so stop playing