izSynth: make domoticz talk with many TTS engines in a easy way

All kinds of 'OS' scripts

Moderator: leecollings

Nautilus
Posts: 722
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Finland
Contact:

Re: izSynth: make domoticz talk with many TTS engines in a easy way

Post by Nautilus »

jin wrote: can you run izsynth with:

Code: Select all

izsynth -D
and change the output device for the izsynth.
To playback to HDMI output:

Code: Select all

pi@raspberrypi ~/domoticz/scripts $ izsynth -e naturalreaders -v Peter -t "Welcome home, mr Stark" -d alsa:device=hw=0.1
Actually I had tried also these, but for some reason it did not seem to work with my initial testings. After some further digging I got also the hdmi to work but I'm really unsure what was the key there :) One thing at least was that my test sentences were quite short and the digital connection to receiver took some syncing time and thus cut about 2 second before any audio could be heard. Maybe my testing phrases were too short. I think I've now overcome that issue by adding

Code: Select all

force_hdmi_open=1
to /boot/config.txt

At least everything is working well for the time being :D Thanks a lot for your help!
toreandre
Posts: 91
Joined: Tuesday 19 January 2016 12:51
Target OS: -
Domoticz version:
Contact:

Re: izSynth: make domoticz talk with many TTS engines in a easy way

Post by toreandre »

Nautilus wrote:
jin wrote: can you run izsynth with:

Code: Select all

izsynth -D
and change the output device for the izsynth.
To playback to HDMI output:

Code: Select all

pi@raspberrypi ~/domoticz/scripts $ izsynth -e naturalreaders -v Peter -t "Welcome home, mr Stark" -d alsa:device=hw=0.1
Actually I had tried also these, but for some reason it did not seem to work with my initial testings. After some further digging I got also the hdmi to work but I'm really unsure what was the key there :) One thing at least was that my test sentences were quite short and the digital connection to receiver took some syncing time and thus cut about 2 second before any audio could be heard. Maybe my testing phrases were too short. I think I've now overcome that issue by adding

Code: Select all

force_hdmi_open=1
to /boot/config.txt

At least everything is working well for the time being :D Thanks a lot for your help!
I have the exact same problem, the first 2 seconds of every sentence is cut (other people is have the same problem). I will try your solution.
Nautilus
Posts: 722
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Finland
Contact:

Re: izSynth: make domoticz talk with many TTS engines in a easy way

Post by Nautilus »

toreandre wrote:
Nautilus wrote:
jin wrote:
At least everything is working well for the time being :D Thanks a lot for your help!
I have the exact same problem, the first 2 seconds of every sentence is cut (other people is have the same problem). I will try your solution.
Well, I spoke a bit too soon. It seems that the sentence is not cut if the receiver is powered and playing already something when the announcement is made (earlier it was cut also in this case). But if it is off, then it still cuts about 2 secs of each sentence, at least with hdmi. I'll test 3.5mm again...

edit: 3.5mm does not help in this situation
toreandre
Posts: 91
Joined: Tuesday 19 January 2016 12:51
Target OS: -
Domoticz version:
Contact:

Re: izSynth: make domoticz talk with many TTS engines in a easy way

Post by toreandre »

So if we were able to delay the speech for a few seconds it might work?

I have noticed that if i try this in commandline, i get the 2 second cutoff, but if i execute the same command when izsynth is already speaking i can hear the whole sentence (as you mentioned).

So there is something that is delaying the output when izsynth is sending the audio to the speaker.
Nautilus
Posts: 722
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Finland
Contact:

Re: izSynth: make domoticz talk with many TTS engines in a easy way

Post by Nautilus »

I think the delay is caused because the receiver needing to sync the bit stream or something like that. Therefore I assumed the analog 3.5mm would solve it but apparently not. I also noticed that the audio quality of the voicerss service which I'm using has gotten worse for some reason. There is some clipping / distortion in the middle parts of a longer output as well. Didn't notice the same with e.g. natural readers. Maybe some quality issue of the received audio file can also be the cause?
Nautilus
Posts: 722
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Finland
Contact:

Re: izSynth: make domoticz talk with many TTS engines in a easy way

Post by Nautilus »

Well, now I updated the script (just replaced with wget) and for some reason it only plays the first word of the synthesised string. Any ideas what that could be coming from? Can I somehow go back to the previous version?

edit: downloaded the previous version and the same thing -> rebooted the RPi and everything works again the way it did, also with the new version :D
jin
Posts: 62
Joined: Thursday 18 September 2014 20:28
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: izSynth: make domoticz talk with many TTS engines in a easy way

Post by jin »

Nautilus wrote:Well, now I updated the script (just replaced with wget) and for some reason it only plays the first word of the synthesised string. Any ideas what that could be coming from? Can I somehow go back to the previous version?

edit: downloaded the previous version and the same thing -> rebooted the RPi and everything works again the way it did, also with the new version :D
are you running izsynth with or without option -w ?
Nautilus
Posts: 722
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Finland
Contact:

Re: izSynth: make domoticz talk with many TTS engines in a easy way

Post by Nautilus »

Hi,

not using the -w option but as I mainly use it for weather announcements I have always the -r option so it does not try to play the same file again as it gets removed.

Btw, is there some default delay in place or is it just used if there is background music (-p option)? Seems there is some delay but not sure if it is this or the fact it just takes time to produce the output. Also, I was thinking the background music might be the way to solve the cutting issues if it could be started a set number of seconds before the synthesised audio?
Nautilus
Posts: 722
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Finland
Contact:

Re: izSynth: make domoticz talk with many TTS engines in a easy way

Post by Nautilus »

Well, same thing happened again - no output and when checking with ps aux the process looks to be running but nothing happens. Reboot solves the issue, strange?
jin
Posts: 62
Joined: Thursday 18 September 2014 20:28
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: izSynth: make domoticz talk with many TTS engines in a easy way

Post by jin »

Nautilus wrote:Well, same thing happened again - no output and when checking with ps aux the process looks to be running but nothing happens. Reboot solves the issue, strange?
yes pretty strange... anyway the synth speedup depends on engine type (some engines are more fast) and your internet connection speed..

about the initial time before speak, you can automatically put background music with a starting pad (you can use a silence wav file as workaround), for example try (google engine is pretty fast):

Code: Select all

script://izsynth -e google -v en -m /your/path/music.wav -p 3 -P 1 -F 0 -t "Welcome home, mr Stark"
NB. you can use mp3 file as background, but wav is more fast, because izsynth every time convert from mp3 to wav

with kind regards
Nautilus
Posts: 722
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Finland
Contact:

Re: izSynth: make domoticz talk with many TTS engines in a easy way

Post by Nautilus »

Sorry, have been on holiday and haven't had a chance yet to test the above - and would be a bit hard now as well when the family is already asleep :) But I confirmed the "plays only the first word" ( = a second or so) issue is related somehow to mplayer. Once I changed to omxplayer - for which I'm using:

Code: Select all

 -k omxplayer -K "-o hdmi" -d ""
it plays the whole sentence without problems. The issue is present with mplayer also if I just execute it like "mplayer /path/to/file.mp3" so must be something in my setup. It throws these errors:

Code: Select all

AO: [pulse] Init failed: Connection refused Failed to initialize audio driver 'pulse'
 libavformat version 53.21.1 (external) Mismatching header version 53.19.0
Anyhow, probably nothing to worry from the izsynth script's perspective :) And a reboot mysteriously fixes it :D

I'll try to check tomorrow whether the silent background music would help in case the receiver is powered on...
Nautilus
Posts: 722
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Finland
Contact:

Re: izSynth: make domoticz talk with many TTS engines in a easy way

Post by Nautilus »

Based on initial testing it works! When "padding" a silent .wav to play as background music the way you suggested, it plays from the beginning of the sentence even when powering on the receiver. Thanks! :D
Zycker
Posts: 24
Joined: Monday 29 December 2014 8:04
Target OS: Linux
Domoticz version:
Contact:

Re: izSynth: make domoticz talk with many TTS engines in a easy way

Post by Zycker »

Hi,
I'm coming back here as I can't solve my problem : Izsynth works perfectly when I use it through SSH but it stay mute via Domoticz.
I've followed the wiki, created my izsynth.conf, etc.

This command for exemple :

Code: Select all

izsynth -t "Il est $(date +%H:%M) minute" -r
Works fine via SSH, I've created a dummy switch for testing purpose

Code: Select all

Action ON script:///home/serveur/domoticz/scripts/test.sh

Code: Select all

Action OFF script://izsynth -t "Il est $(date +%H:%M) minute" -r
The content of test.sh :

Code: Select all

 #!/bin/bash
/home/serveur/domoticz/scripts/izsynth -t "Il est $(date +%H:%M) minute" -r
Executing test.sh via SSH result as speaking but absolutly nothing via the command of the switch although I've a lot of switch using bash scripts working fine.

In the log :
Executing script: /home/serveur/domoticz/scripts/test.sh
Any ideas ?
Zycker
Posts: 24
Joined: Monday 29 December 2014 8:04
Target OS: Linux
Domoticz version:
Contact:

Re: izSynth: make domoticz talk with many TTS engines in a easy way

Post by Zycker »

Hi, I'm back.
I figured out my original problem, as domoticz run as root and I had no soundcard configured by default for the root user, I couldn't have sounds.
Now it's working, I have personnalized my izsynth.conf for the root user by I have another problem, I've made myself a bash script with different things to say, it works fine but not when executed by domoticz.
- executingscript:///home/serveur/domoticz/scripts/izsynth -t "Welcome Home" OK (french voice, lower volume)
- executing my script from shell (as user or as root) OK (french voice, lower volume)
- executing script:///home/serveur/domoticz/scripts/annonces.sh date NOK (english voice, standard volume)

It's driving me mad, it takes me some time to build this script but it won't run well in domoticz :?
markk
Posts: 267
Joined: Tuesday 14 January 2014 14:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: izSynth: make domoticz talk with many TTS engines in a easy way

Post by markk »

Hi

I'm falling over on the very first post of this. following the instructions and just getting this! Please help.
izsynth.png
izsynth.png (46.26 KiB) Viewed 5391 times

EDIT: I'm still not able to get past this point :(
Is there a way I can install this manually?

EDIT EDIT: It appears that my ISP (VM) was blocking the SSL connection. A google search showed this to have happened to others too. I have now moved providers (not just because of this issue) tried again and izSynth installed easily.
Last edited by markk on Monday 03 October 2016 14:26, edited 1 time in total.
Running Domoticz on Pi3 with RFXtrx433e. LWRF power sockets and dimmer switches. Integrated my existing wirefree alarm PIRs and door contacts with domoticz. Geofencing with Pilot. Harmony Hub. Tado for Heating. Now playing with mysensors.
jin
Posts: 62
Joined: Thursday 18 September 2014 20:28
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: izSynth: make domoticz talk with many TTS engines in a easy way

Post by jin »

Hi,

With wget, try eg. --secure-protocol=tlsv1 or --secure-protocol=sslv3

try searching google:

https://www.google.it/?gws_rd=ssl#safe= ... connection
markk
Posts: 267
Joined: Tuesday 14 January 2014 14:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: izSynth: make domoticz talk with many TTS engines in a easy way

Post by markk »

jin wrote:Hi,

With wget, try eg. --secure-protocol=tlsv1 or --secure-protocol=sslv3

try searching google:

https://www.google.it/?gws_rd=ssl#safe= ... connection
Thanks for your reply. On Monday evening I was following the suggestions in the link you provided when my internet connection bombed out (I hope that was only coincidence!) so couldn't carry on trying. Now waiting for a Virgin Media engineer visit tomorrow!!

Seriously though, could the internet have gone down because of something I did whilst doing wget --secure-protocol=tlsv1 and --secure-protocol=sslv3??
Running Domoticz on Pi3 with RFXtrx433e. LWRF power sockets and dimmer switches. Integrated my existing wirefree alarm PIRs and door contacts with domoticz. Geofencing with Pilot. Harmony Hub. Tado for Heating. Now playing with mysensors.
andyvercammen
Posts: 2
Joined: Thursday 05 November 2015 9:45
Target OS: Windows
Domoticz version:
Contact:

Re: izSynth: make domoticz talk with many TTS engines in a easy way

Post by andyvercammen »

is there a way to also run this on Windows?
I tried with downloading the windows version of mplayer, sox, iconv, lame, grep, bash, file

When I run the test i get a directory error. Guess not all the references can be fixed by downloading the linux tools for windows :)

c:\test>"c:\Program Files\Git\bin\sh.exe" izsynth -e naturalreaders -v Peter -t "Welcome home, mr Stark" -w
ERROR: '' invalid input file/directory - abort.

If this can't be run under windows, is there a windows alternative to run a script like this with domoticz? Or maybe I am missing some other linux programs in the list above?
pvm
Posts: 550
Joined: Tuesday 17 June 2014 22:14
Target OS: NAS (Synology & others)
Domoticz version: 4.10538
Location: NL
Contact:

Re: izSynth: make domoticz talk with many TTS engines in a easy way

Post by pvm »

There's a separate thread on Bluetooth (as well as wiki). Might help
Synology NAS, slave PI3, ZWave (Fibaro), Xiaomi zigbee devices, BTLE plant sensor, DzVents, Dashticz on tablet, Logitech Media Server
Zycker
Posts: 24
Joined: Monday 29 December 2014 8:04
Target OS: Linux
Domoticz version:
Contact:

Re: izSynth: make domoticz talk with many TTS engines in a easy way

Post by Zycker »

Yes, I've edited izsynth.sh so it match the config I initialy did (soundcard, language, voice), that did the job.

Envoyé de mon SM-T810 en utilisant Tapatalk
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest