Skip to content

Instantly share code, notes, and snippets.

@bubenkoff
Last active January 24, 2022 09:28
Show Gist options
  • Save bubenkoff/9f5a00b50a1f08424b448b873fba64e6 to your computer and use it in GitHub Desktop.
Save bubenkoff/9f5a00b50a1f08424b448b873fba64e6 to your computer and use it in GitHub Desktop.
Loto game speaker / Диктор для гри Лото / Диктор для игры Лото

Loto game speaker / Диктор для гри Лото / Диктор для игры Лото

Prerequisites

  • npm install tts-cli -g

  • Install and configure awscli or gcloud (via brew or pip)

  • Install mpg123 (brew or package manager)

Usage

./Loto.sh [optional additional tts arguments]

Read more about supported tts arguments here.

for AWS Polly, please check the supported voices.

Example:

./Loto.sh

./Loto.sh --language=nl-NL --voice=Lotte

./Loto.sh --language=ru-RU --voice=Tatyana
set -x
text=`python3 -c 'import random; any(map(lambda item: print("{0}<break time=\"4s\"/>".format(item)), random.sample(range(1,91), 90)))'`
echo "${text}"
echo "<speak>${text}</speak>" | tts --type ssml $@ loto.mp3
mpg123 loto.mp3
rm loto.mp3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment