SnipsSuperTTS, one script to rule them all

tts
wavenet
amazon
polly
google

#1

Ever wanted to use an online TTS but go back to offline in case internet goes off? Ever wanted your assistant to be able to use Amazon or Google or pico, at the same time? Well, search no further, this is now possible!


"Unknown value type" with customtts
Change voice feedback to german
#2

Amazing works dude !!!

Do you have some feedback on any delay implied by using online TTS ?
Voices are for sure faaaaar better than pico default snips, but even a few seconds delays would really hurt.


#3

Thanks!

Well, for now Google Wavenet seems to have more delay than Amazon Polly. You can count with 2 seconds delay, if the file is not yet cached

All the things you assistant says gets cached and reused for instant speaking if available.


#4

Yes I saw your caching implementation.

But my TTS is done by scripts to generates different sentences each time regarding different stuff (person seen, time, working/holidays, weather etc etc) so caching wouldn’t give me much.


#5

I have a random talk generator too, and personalization, but caching is still useful :slight_smile:


#6

Really nice! My only thoughts are that I would enable ssml by default since it doesn’t hurt anything if there are no ssml tags but allows you to use ssml if you want. The jokes are funnier if you can add some tweaks! :-). For amazon and google you can also then use to fetch and speak arbitrary audio from the interwebs

For the same reason I might add an espeak option since espeak supports most ssml tags whereas pico does not at all.


#7

ssml would rocks for sure. Playing audio files isn’t of much interest for me, but stuff like <prosody>, <emphasis>, <say‑as>, and <break> , all that with a more natural voice like wavenet, would just put snips to life :cry:


#8

Of course, but I’m sending ssml directly from snips in the text. It’s not done for wavenet because I have troubles with it. It here to evolve, gladly, I just needed it ready and working with polly for next week maker faire :slight_smile:


#9

Have you had a look at https://github.com/MycroftAI/mimic as a local TTS solution?


#10

+1 SSML (plus twenty characters to fullfill my requirements to post ;))


#11

Ok, upon checking, I have pushed the ssml version of it already… Amazon has the tags on, up to you to send your strings with ssml. The Google part hasn’t, because I always ended up with faulty string response from google. I’ll fix it asap.

Re Mycroft, no, I did not check it, but can easily add the support for it as well


#12
  • ssml support added for google and cleaned for amazon

#13

Added Mycroft support


#14

OK. I’m doing something wrong here. I’ve got it set up, and when I try to run the script from the command line it works fine and creates and saves a file (and confirmed using _snips user too). Only using mycroft at the moment

~/snipsSuperTTS/snipsSuperTTS.sh "test.wav" "mycroft" "%%LANG%%" "US" "ksp" "FEMALE" "hello there - this is working" "10"

However when I use Snips it’s using the default voice.

provider = "customtts"
customtts = { command =  ["/home/pi/snipsSuperTTS/snipsSuperTTS.sh" "%%OUTPUT_FILE%%" "mycroft" "%%LANG%%" "US" "ksp" "FEMALE" "%%TEXT%%" ""] }

My responses are called from scripts mainly, for example:

hermes.publish_end_session(current_session_id, "Turning " + myState + " " + myDeviceName)

Have I missed something fundamental here?

(For completness of info - I removed all non-mycroft code in my investigation. My current superscript is a rather basic:

mycroftPath="/home/pi/mimic"

outfile="$1"
service="$2"
lang="$3"
country="$4"
voice="$5"
gender="$6"
text="$7"
sampleRate="$8"

function mycroft() {
    text=$(sed 's/<[^>]*>//g' <<< "$text")
    ."$mycroftPath"/mimic -t "$text" -o "$outfile" -voice "$mycroftPath""/voices/cmu_us_""$voice"".flitevox"
}

mycroft

#15

You reloaded snips right? I mean, after editing snips.toml? sudo systemctl restart snips-* I’d imagine so, but I prefer to ask


#16

If you’re building Mycroft mimic on a raspberry device and run out of memory while building like I did, you should increase the swap size in /etc/dphys-swapfile. It’s only 100MB by default and easily runs out.


#17

Thanks! Added to gist!


#18

Try to follow the instructions to install mycroft, but I already stuck at

./dependencies.sh --prefix="/usr/local"

The command ends with

inflating: pcre2-10.23/libpcre2-32.pc.in
patching file src/pcre2grep.c
./dependencies.sh: 59: ./dependencies.sh: autoreconf: not found

Any hint what I am doing wrong.


#19

Requirements installed? sudo apt-get install gcc make pkg-config automake libtool libasound2-dev

I see I missed mentionning them on the gist


#20

Thank you. That did it. I got microft running.
Nevertheless, I do not find the mentioned mycroft.conf file to change the language to German.
Do you know how to proceed?

Thank you in advance and a happy new year.