-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsaySnips
executable file
·42 lines (39 loc) · 944 Bytes
/
saySnips
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
# !/bin/bash -xv
#
# interface to TTS services: say a sentence with Snips
# usage:
#
# $ say filename language text as many words as necessary
#
# to make Snips use the script, change the tts-section of the
# file /etc/snips.toml:
# uncomment line # customtts
# command = ["saySnips", "%%OUTPUT_FILE%%", "%%LANG%%", "%%TEXT%%"]
#
# languages: any language, such as de, en, etc.
# for de-DE and en-GB the voices "de-DE-Wavenet-C" and
# "en-GB-Wavenet-A" are pre-selected.
#
# The resulting wav is stored played and stored as "filename" in the
# work dir.
#
# (c) Andreas Dominik
# THM University of Applied Sciences
# Gießen, DE
#
# License: GPL3
#
AUDIO_NAME=$1
shift
LANGUAGE=$1
shift
TEXT="$@"
# get installation dir:
#
LOCAL_SCRIPT="$(readlink -f "$0")"
export GOOGLE_TTS_DIR="$(dirname $LOCAL_SCRIPT)"
# get wav from Google and play:
#
cd /tmp
${GOOGLE_TTS_DIR}/src/ttsWcache.sh $AUDIO_NAME $LANGUAGE $TEXT
# eof.