SnipsSuperTTS, one script to rule them all

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

  • ssml support added for google and cleaned for amazon

Added Mycroft support

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

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

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.

1 Like

Thanks! Added to gist!

1 Like

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.

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

I see I missed mentionning them on the gist

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.

You’re welcome! About the language change, sorry, but I never tried

Hi,

I have try on two satellites:
I did the installation of mycroft ONLY (offline feature).
on the sh script, i change :

useMycroft=true
mycroftPath="/home/boss/mimic"

I have modified my toml like this:

[snips-tts]
provider = "customtts"
customtts = { command = ["/home/boss/snipsSuperTTS/snipsSuperTTS.sh", "%%OUTPUT_FILE%%", "mycroft", "%%LANG%%", "FR", "slt", "FEMALE", "%%TEXT%%", "22050"] }

After restarting snips service, when i try to say using jeedom+snips plugin some sentences, i heard the original snips voice…
If i comment the two lines, again. If i made a mistake (volontary) in the toml tts i have no sound…

Why i don’t heard mycroft voice ?

I have installed snips-tts on my satellite. Do i need to make the installation again on the snips server ?

It’s not to be installed on satellites, but on the main unit only

Argh… lol.
So i need to remove tts on the satellite and installed only on the main server VM.
I will keep you in touch if it is okay.

Thank you Psycho !

That’s how snips works, the audio is always streamed from the main unit :smirk:

It is not depending of A or B configuration.

I have made the change. When i reload my Jeedom plugin, it reports:

The toml file in the server:

What are you talking about conf a or b? This is again something about satellites. I have no idea about jeedom thingy. The toml file looks ok

I saw configuration satellite on the snips website.
Even if the error is present in Jeedom when i try to use TTS from this script it is reported an error on sam watch:

[13:38:49] [Nlu] detected intent benj29:TurnOnJeedom with probability 0.519 for input "allume la télé de notre chambre"
              Slots ->
                 device_name -> tv (confidence: 1.000)
                  house_room -> chambre parentale (confidence: 1.000)
[13:38:49] [Dialogue] New intent detected benj29:TurnOnJeedom with probability 0.519
              Slots ->
                 device_name -> tv (confidence: 1.000)
                  house_room -> chambre parentale (confidence: 1.000)
[13:38:49] [Dialogue] was ask to end session with id e9f7cdcd-ce8c-421d-90d5-52c901f97324 by saying 'Désolé je ne trouve pas les actions '
[13:38:49] [Tts] was asked to say "Désolé je ne trouve pas les actions"
[13:38:49] [AudioServer] was asked to play a wav of 61.1 kB with id '5495ad0a-32cc-48c5-9a3b-01173d975f4c' on site SATPI-SNIPS2
[13:38:49] [AudioServer] finished playing wav with id '5495ad0a-32cc-48c5-9a3b-01173d975f4c'
[13:38:49] [Dialogue] session with id 'e9f7cdcd-ce8c-421d-90d5-52c901f97324' was ended on site SATPI-SNIPS2. The session was ended because an error happened: Receives error from component Tts: { error: Error while trying to say 'SayMessage { text: "Désolé je ne trouve pas les actions", lang: Some("fr"), id: Some("6f060c33-4513-4a6c-9e7d-dd22e37f9a39"), site_id: "SATPI-SNIPS2", session_id: Some("e9f7cdcd-ce8c-421d-90d5-52c901f97324") }': Can't execute `/home/boss/snipsSuperTTS/snipsSuperTTS.sh`
 -> caused by: Permission denied (os error 13)
, context:  }

So, i change to 777 and u+x the script…

I have not now the error but i have NO SOUND…

13:41:29] [AudioServer] finished playing wav with id '9c7844e5-977e-4504-8062-217245f2e9ea'
[13:41:29] [Nlu] was asked to parse input "allume la télé dans notre chambre"
[13:41:29] [Nlu] detected intent benj29:TurnOnJeedom with probability 0.657 for input "allume la télé dans notre chambre"
              Slots ->
                 device_name -> tv (confidence: 1.000)
                  house_room -> chambre parentale (confidence: 1.000)
[13:41:29] [Dialogue] New intent detected benj29:TurnOnJeedom with probability 0.657
              Slots ->
                 device_name -> tv (confidence: 1.000)
                  house_room -> chambre parentale (confidence: 1.000)
[13:41:29] [Dialogue] was ask to end session with id 6173e33c-df74-463c-9382-5e8b45441ce7 by saying 'Désolé  je n'ai pas compris '
[13:41:29] [Tts] was asked to say "Désolé  je n'ai pas compris"
[13:41:29] [AudioServer] was asked to play a wav of 0.0 kB with id '58aff9eb-d665-40bb-814e-0a3fb6d2c9d5' on site SATPI-SNIPS2
[13:41:45] [Dialogue] session with id '6173e33c-df74-463c-9382-5e8b45441ce7' was ended on site SATPI-SNIPS2. The session was ended because one of the component didn't respond in a timely manner
[13:41:45] [Asr] was asked to stop listening on site SATPI-SNIPS2
[13:41:45] [Hotword] was asked to toggle itself 'on' on site SATPI-SNIPS2

[13:38:49] [Asr] was asked to stop listening on site SATPI-SNIPS2
[13:38:49] [Hotword] was asked to toggle itself 'on' on site SATPI-SNIPS2

How i can test just if mycroft is okay or the TTS ?

If i ask from jeedom to play some TTS (using SAY) i have no sound on my satellites… again !

If a remove customTTS linesi it is working using snips original voice.

Any idea ?

I just added some thoughts on the gist :


maybe that can help to debug.

For next users, you need to install mpg123 when you want to use this script (for google tts). You need to install snips-asr-google too.
For french users, don’t spent time to use mimic because it is in english only.
Now, it is working !
@psycho, maybe you need to update the documentation. Thanks for your work !