Page 4 of 7
Re: izSynth: make domoticz talk with many TTS engines in a easy way
Posted: Sunday 08 May 2016 13:10
by micbou
Sure Jin and thanks!
root@raspberrypi:/home/pi# echo $HOME
/root
root@raspberrypi:/home/pi# ls -al $HOME/.config/izsynth
total 16
drwxr-xr-x 3 root root 4096 May 7 14:01 .
drwx------ 4 root root 4096 May 7 13:59 ..
drwxr-xr-x 2 root root 4096 May 7 13:59 engines
-rw-r--r-- 1 root root 1196 May 7 14:01 izsynth.conf
root@raspberrypi:/home/pi# ls -al /dev/shm
total 136
drwxrwxrwt 4 root root 200 May 8 12:44 .
drwxr-xr-x 15 root root 3300 May 7 20:13 ..
-rw-r----- 1 root root 12119 May 7 20:50 Goodbye_sir.mp3
-rw-r----- 1 root root 18807 May 7 20:28 Hi___how_are_you_.mp3
-rw-r----- 1 root root 19016 May 7 20:27 Hi___how_are_you.mp3
drwxr-x--- 2 root root 60 May 7 20:27 izsynth-20160507-202712
drwxr-x--- 2 root root 60 May 7 20:49 izsynth-20160507-204905
-rw-r----- 1 root root 44720 May 8 01:20 See_you_soon.mp3
-rw-r----- 1 root root 20896 May 8 01:20 Welcome_home.mp3
root@raspberrypi:/home/pi# ls -al $HOME/domoticz/scripts
ls: cannot access /root/domoticz/scripts: No such file or directory
root@raspberrypi:/home/pi# ps aux | grep domoticz | grep -v grep
root 770 0.1 1.5 182220 14312 ? Ssl May07 1:03 /home/pi/domoti cz/domoticz -daemon -www 8080 -loglevel=1 -sslwww 443
root 3347 0.0 0.0 1912 404 ? Ss May07 0:00 /bin/sh -c /hom e/pi/domoticz/scripts/check_device_online.py 192.168.1.103 7 10 30
root 3349 0.0 1.0 13080 9600 ? S May07 0:16 /usr/bin/python /home/pi/domoticz/scripts/check_device_online.py 192.168.1.103 7 10 30
root@raspberrypi:/home/pi# uname -a
Linux raspberrypi 4.1.18-v7+ #846 SMP Thu Feb 25 14:22:53 GMT 2016 armv7l GNU/Li nux
root@raspberrypi:/home/pi#
Re: izSynth: make domoticz talk with many TTS engines in a easy way
Posted: Sunday 08 May 2016 15:45
by jin
ok, you are running domoticz as root user and the installation directory is /home/pi/domoticz/ (this should be not a problem, anyway i prefer run domoticz as pi user)
in your button on/off action, can you add the "> /tmp/izsynth.log" at the end of the command?
example:
Code: Select all
script://izsynth -t "Welcome Home" > /tmp/izsynth.log
and paste the output of:
Thankyou
Re: izSynth: make domoticz talk with many TTS engines in a easy way
Posted: Sunday 08 May 2016 21:32
by toreandre
Do you have any solution for the problem i posted on the other page?
It works on my system, but it is a 3 second delay from when i enter the command to the audio reach my speakers so i can only get the last part of the sentences.
Re: izSynth: make domoticz talk with many TTS engines in a easy way
Posted: Monday 09 May 2016 2:07
by jin
Hi,
just pushed the 4.1 version to github:
Update
Code: Select all
cd /home/pi/domoticz/scripts
wget https://raw.githubusercontent.com/ugoviti/izsynth/master/izsynth -O izsynth && chmod 755 izsynth
Changelog
Code: Select all
# 4.1 - 20160509
# - added support for auto splitting sentences longer than the supported engine chars
# each engine now have a TTS_LENGTH variable if engine usage is limited. This feature make possible to sinth very long sentences
# - speedup the synthesizing process avoiding intermediate convertion to wav format when not remizing o megamixing (this gained 500ms in 4 seconds playback)
# - more intuitive feedback when synthesizing
# - changed default engine to 'naturalreaders' and voice 'Peter' (english language)
# - restored google tts support (limited to 160 chars max)
# - added -r option for removing synthesized file after playback
# - added support for stdin as input stream, example:
# echo this is only a test | izsynth -
# - ispeech tts engine addded (http://www.ispeech.org/)
Please, test the new auto-splitting feature if works for very long input text, and report here the problems.
Kind regards
Re: izSynth: make domoticz talk with many TTS engines in a easy way
Posted: Monday 09 May 2016 20:33
by woody4165
Hi
don't know if it's related to the last update,but now the
Code: Select all
os.execute('/home/pi/domoticz/scripts/izsynth -w -r -t "'..message..'"')
that I have in a script instead of using the TTS engine and voice in the .config/izsynth.conf it uses a default english man voice.
If I run the same command from terminal, I get the right voice and engine.
izsynth is in $HOME/domoticz/scripts while the config file is in $HOME
Is it correct?
Thanks
Re: izSynth: make domoticz talk with many TTS engines in a easy way
Posted: Monday 09 May 2016 21:18
by jmleglise
Hi Jin,
Here's my feedback :
- There is still the limitation of 255cars. (File name too long). It's a shame.
-Thanks you for the -r option
- Can you check : izsynth -e fromtexttospeech -l
There is a special char that prevents the use of the 3th voice : (french, celine).
I'am looking forward the 4.2 with the 255chars limit removed

Re: izSynth: make domoticz talk with many TTS engines in a easy way
Posted: Monday 09 May 2016 23:00
by jin
woody4165 wrote:Hi
don't know if it's related to the last update,but now the
Code: Select all
os.execute('/home/pi/domoticz/scripts/izsynth -w -r -t "'..message..'"')
that I have in a script instead of using the TTS engine and voice in the .config/izsynth.conf it uses a default english man voice.
If I run the same command from terminal, I get the right voice and engine.
izsynth is in $HOME/domoticz/scripts while the config file is in $HOME
Is it correct?
Thanks
I "think" it's related to $HOME path management inside domoticz.
My installation works without these problems (rebooted some times my rpi and working out of the box on every reboot).
Anyway my izsynth configuration are in /home/pi/.config/izsynth/izsynth.conf
domoticz installation is in /home/pi/domoticz and it run as pi user:
Code: Select all
pi@raspberrypi ~ $ ps aux | grep domoticz
pi 2158 0.5 2.9 191384 29432 ? Ssl mag07 14:35 /home/pi/domoticz/domoticz -daemon -www 8080 -log /tmp/domoticz.log -dbase /dev/shm/domoticz.db
I can't figure out because it works for you from terminal and not from domoticz.... can you make domoticz run as "pi" user? (remember to: chown -R pi:pi /home/pi)
Kind Regards
Re: izSynth: make domoticz talk with many TTS engines in a easy way
Posted: Monday 09 May 2016 23:26
by jin
- Can you check : izsynth -e fromtexttospeech -l
This is an upstream problem, I can't fix, I'm sorry
Code: Select all
curl -s http://www.fromtexttospeech.com | grep "voice_indexes\['" | awk -F = '{print $2}' | sed '/^$/d' | sed "s/ '//" | sed "s/';//"
- There is still the limitation of 255cars. (File name too long). It's a shame.
eheheh okokook

fixed now upstream! (now I don't make file longer than 64 chars)
Code: Select all
jin@jlt:/tmp$ cat lorem.txt
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Code: Select all
jin@jlt:/tmp$ cat lorem.txt | izsynth -e fromtexttospeech -v Brian22 -
== [1/1] - izsynth Name:[Lorem_ipsum_dolor_sit_amet__consectetur_adipiscing_elit__sed_do_]
Synthetizing - input:[/dev/shm/izsynth-20160509-232235/Lorem_ipsum_dolor_sit_amet__consectetur_adipiscing_elit__sed_do_.txt] engine:[fromtexttospeech] voice:[Brian22] output:[/dev/shm/Lorem_ipsum_dolor_sit_amet__consectetur_adipiscing_elit__sed_do_.mp3] size:[164K] type:[audio/mpeg] result:[SUCCESS]
Playing - input:[/dev/shm/Lorem_ipsum_dolor_sit_amet__consectetur_adipiscing_elit__sed_do_.mp3]
-- [1/1] -----------------------------------------------------------------------
Thank you for the feedback!
Kind regards
Re: izSynth: make domoticz talk with many TTS engines in a easy way
Posted: Monday 09 May 2016 23:30
by jin
jin wrote:- Can you check : izsynth -e fromtexttospeech -l
This is an upstream problem, I can't fix, I'm sorry
Code: Select all
curl -s http://www.fromtexttospeech.com | grep "voice_indexes\['" | awk -F = '{print $2}' | sed '/^$/d' | sed "s/ '//" | sed "s/';//"
- There is still the limitation of 255cars. (File name too long). It's a shame.
eheheh okokook

fixed now upstream! (now I don't make file longer than 64 chars)
Code: Select all
jin@jlt:/tmp$ cat lorem.txt
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Code: Select all
jin@jlt:/tmp$ cat lorem.txt | izsynth -e fromtexttospeech -v Brian22 -
== [1/1] - izsynth Name:[Lorem_ipsum_dolor_sit_amet__consectetur_adipiscing_elit__sed_do_]
Synthetizing - input:[/dev/shm/izsynth-20160509-232235/Lorem_ipsum_dolor_sit_amet__consectetur_adipiscing_elit__sed_do_.txt] engine:[fromtexttospeech] voice:[Brian22] output:[/dev/shm/Lorem_ipsum_dolor_sit_amet__consectetur_adipiscing_elit__sed_do_.mp3] size:[164K] type:[audio/mpeg] result:[SUCCESS]
Playing - input:[/dev/shm/Lorem_ipsum_dolor_sit_amet__consectetur_adipiscing_elit__sed_do_.mp3]
-- [1/1] -----------------------------------------------------------------------
works good with google voice too

(using the megamix feature)
Code: Select all
jin@jlt:/tmp$ cat lorem.txt | izsynth -e google -v en -
== [1/3] - izsynth Name:[Lorem_ipsum_dolor_sit_amet__consectetur_adipiscing_elit__sed_do_-1] == MEGAMIX
Synthetizing - input:[/dev/shm/izsynth-20160509-232849/Lorem_ipsum_dolor_sit_amet__consectetur_adipiscing_elit__sed_do_-1.txt] engine:[google] voice:[en] output:[/dev/shm/izsynth-20160509-232849/Lorem_ipsum_dolor_sit_amet__consectetur_adipiscing_elit__sed_do_-1.mp3] size:[48K] type:[audio/mpeg] result:[SUCCESS]
Converting - input:[/dev/shm/izsynth-20160509-232849/Lorem_ipsum_dolor_sit_amet__consectetur_adipiscing_elit__sed_do_-1.mp3] input_size:[48K] output:[/dev/shm/izsynth-20160509-232849/Lorem_ipsum_dolor_sit_amet__consectetur_adipiscing_elit__sed_do_-1.wav] output_size:[572K]
Normalizing - input:[/dev/shm/izsynth-20160509-232849/Lorem_ipsum_dolor_sit_amet__consectetur_adipiscing_elit__sed_do_-1.wav] input_size:[572K] input_rate:[24000] output_size:[1,1M] output_rate:[44100]
-- [1/3] -----------------------------------------------------------------------
== [2/3] - izsynth Name:[Lorem_ipsum_dolor_sit_amet__consectetur_adipiscing_elit__sed_do_-2] == MEGAMIX
Synthetizing - input:[/dev/shm/izsynth-20160509-232849/Lorem_ipsum_dolor_sit_amet__consectetur_adipiscing_elit__sed_do_-2.txt] engine:[google] voice:[en] output:[/dev/shm/izsynth-20160509-232849/Lorem_ipsum_dolor_sit_amet__consectetur_adipiscing_elit__sed_do_-2.mp3] size:[48K] type:[audio/mpeg] result:[SUCCESS]
Converting - input:[/dev/shm/izsynth-20160509-232849/Lorem_ipsum_dolor_sit_amet__consectetur_adipiscing_elit__sed_do_-2.mp3] input_size:[48K] output:[/dev/shm/izsynth-20160509-232849/Lorem_ipsum_dolor_sit_amet__consectetur_adipiscing_elit__sed_do_-2.wav] output_size:[564K]
Normalizing - input:[/dev/shm/izsynth-20160509-232849/Lorem_ipsum_dolor_sit_amet__consectetur_adipiscing_elit__sed_do_-2.wav] input_size:[564K] input_rate:[24000] output_size:[1,1M] output_rate:[44100]
-- [2/3] -----------------------------------------------------------------------
== [3/3] - izsynth Name:[Lorem_ipsum_dolor_sit_amet__consectetur_adipiscing_elit__sed_do_-3] == MEGAMIX
Synthetizing - input:[/dev/shm/izsynth-20160509-232849/Lorem_ipsum_dolor_sit_amet__consectetur_adipiscing_elit__sed_do_-3.txt] engine:[google] voice:[en] output:[/dev/shm/izsynth-20160509-232849/Lorem_ipsum_dolor_sit_amet__consectetur_adipiscing_elit__sed_do_-3.mp3] size:[48K] type:[audio/mpeg] result:[SUCCESS]
Converting - input:[/dev/shm/izsynth-20160509-232849/Lorem_ipsum_dolor_sit_amet__consectetur_adipiscing_elit__sed_do_-3.mp3] input_size:[48K] output:[/dev/shm/izsynth-20160509-232849/Lorem_ipsum_dolor_sit_amet__consectetur_adipiscing_elit__sed_do_-3.wav] output_size:[564K]
Normalizing - input:[/dev/shm/izsynth-20160509-232849/Lorem_ipsum_dolor_sit_amet__consectetur_adipiscing_elit__sed_do_-3.wav] input_size:[564K] input_rate:[24000] output_size:[1,1M] output_rate:[44100]
-- [3/3] -----------------------------------------------------------------------
Megamixing - input:[/dev/shm/izsynth-20160509-232849/Lorem_ipsum_dolor_sit_amet__consectetur_adipiscing_elit__sed_do_-1.wav /dev/shm/izsynth-20160509-232849/Lorem_ipsum_dolor_sit_amet__consectetur_adipiscing_elit__sed_do_-2.wav /dev/shm/izsynth-20160509-232849/Lorem_ipsum_dolor_sit_amet__consectetur_adipiscing_elit__sed_do_-3.wav] output:[/dev/shm/izsynth-20160509-232849/Lorem_ipsum_dolor_sit_amet__consectetur_adipiscing_elit__sed_do_-3.megamixed.wav] size:[3,1M]
Remixing - input:[/dev/shm/izsynth-20160509-232849/Lorem_ipsum_dolor_sit_amet__consectetur_adipiscing_elit__sed_do_-3.megamixed.wav] tts_volume:[] output:[/dev/shm/izsynth-20160509-232849/Lorem_ipsum_dolor_sit_amet__consectetur_adipiscing_elit__sed_do_-3.remixed.wav] size:[3,1M]
Saving - input:[/dev/shm/izsynth-20160509-232849/Lorem_ipsum_dolor_sit_amet__consectetur_adipiscing_elit__sed_do_-3.remixed.wav] size:[3,1M] output:[/dev/shm/Lorem_ipsum_dolor_sit_amet__consectetur_adipiscing_elit__sed_do_-1.wav]
-- [3/3] -----------------------------------------------------------------------
Playing - input:[/dev/shm/Lorem_ipsum_dolor_sit_amet__consectetur_adipiscing_elit__sed_do_-1.wav]
Thank you for the feedback!
Kind regards
Re: izSynth: make domoticz talk with many TTS engines in a easy way
Posted: Tuesday 10 May 2016 21:13
by jmleglise
Bravo !
With the v4.2 , your script is perfect now. You made a great great work !
Thank you,
Re: izSynth: make domoticz talk with many TTS engines in a easy way
Posted: Tuesday 10 May 2016 23:04
by jin
jmleglise wrote:Bravo !
With the v4.2 , your script is perfect now. You made a great great work !
Thank you,
Thank you!

Re: izSynth: make domoticz talk with many TTS engines in a easy way
Posted: Sunday 22 May 2016 20:17
by micbou
Jin, any idea how to stream the audio to a bluetooth speaker?
Re: izSynth: make domoticz talk with many TTS engines in a easy way
Posted: Sunday 22 May 2016 21:03
by korniza
micbou wrote:Jin, any idea how to stream the audio to a bluetooth speaker?
+1
I like to choose where I like to stream the izsynth on every prompt. Of course default will be the local speaker output.

Re: izSynth: make domoticz talk with many TTS engines in a easy way
Posted: Monday 23 May 2016 0:18
by Skippiemanz
Have read the topic and Looks rally nice. Would be great if it could be streamed to logitech media server or Sonos!
Verstuurd vanaf mijn SM-G925F met Tapatalk
Re: izSynth: make domoticz talk with many TTS engines in a easy way
Posted: Thursday 26 May 2016 1:20
by jin
Hi all,
just released a github update with these new features, updates izsynth as usual.
by default izsynth play TTS audio files using mplayer, so you can force mplayer to use a specific alsa audio sink in the following ways:
via configuration file: (
$HOME/.config/izsynth/izsynth.conf)
Code: Select all
# default playback device
PLAYBACK_DEVICE="alsa"
or:
Code: Select all
# default playback device
PLAYBACK_DEVICE="alsa:device=bluetooth"
or via command
-d option, example:
Code: Select all
izsynth -e naturalreaders -v Peter -t "Welcome home, mr Stark." -w -d alsa:device=hw=0.0
or
Code: Select all
izsynth -e naturalreaders -v Peter -t "Welcome home, mr Stark." -w -d alsa:device=bluetooth
to list all alsa devices, you can run:
so you can choose every time from domoticz where output your TTS messages
for bluetooth audio devices setup you can follow that domoticz wiki page:
http://www.domoticz.com/wiki/BTAudio
please debug the new features and let me know
kind regards
Re: izSynth: make domoticz talk with many TTS engines in a easy way
Posted: Thursday 26 May 2016 2:19
by korniza
excellent news! Thanks jin! I'll try it next days for feedback
Re: izSynth: make domoticz talk with many TTS engines in a easy way
Posted: Friday 27 May 2016 20:41
by paulD
Hi,
I discover your script and I plan to use it for audio messages
I will report here !
Re: izSynth: make domoticz talk with many TTS engines in a easy way
Posted: Sunday 05 June 2016 11:53
by Zycker
Hi,
First thank you for your script Jin, great work.
I've just installed it on my ubuntu server with Domoticz v3.4846, the script works fine in the shell but not from Domoticz (same problem as micbou.
Here are some info :
Code: Select all
echo $HOME
/home/serveur
ls -al $HOME/.config/izsynth
total 12
drwxrwxr-x 3 serveur serveur 4096 juin 5 10:36 .
drwx------ 28 serveur serveur 4096 juin 5 10:36 ..
drwxrwxr-x 2 serveur serveur 4096 juin 5 10:36 engines
cat $HOME/.config/izsynth/izsynth.conf
cat: /home/serveur/.config/izsynth/izsynth.conf: Aucun fichier ou dossier de ce type (No such file or directory)
ls -al /dev/shm
total 268
drwxr-xr-x 15 serveur serveur 660 juin 5 11:42 .
drwxr-xr-x 20 root root 4360 juin 5 09:54 ..
-rw-r----- 1 root root 8424 juin 5 11:42 allumage.mp3
-rw-r----- 1 serveur serveur 9936 juin 5 10:56 Bonjour_Monsieur_Bond.mp3
-rw-rw-r-- 1 serveur serveur 14934 juin 5 11:06 Can_you_hear_my_bright_voice_now_.mp3
-rw-rw-r-- 1 serveur serveur 14904 juin 5 10:52 Ceci_est_un_test_de_diction_mâle.mp3
-rw-rw-r-- 1 serveur serveur 13392 juin 5 10:52 Ceci_est_un_test_de_diction.mp3
-rw-rw-r-- 1 serveur serveur 14256 juin 5 10:57 Ceci_est_un_test_de_dictiontop.mp3
-rw-rw-r-- 1 serveur serveur 15120 juin 5 11:41 c_est_presque_est_un_test_de_diction.mp3
-rw-r----- 1 serveur serveur 18389 juin 5 11:12 device_desactivated.mp3
-rw-rw-r-- 1 serveur serveur 25703 juin 5 10:36 I_love_Domoticz_Home_Automation_System.mp3
drwxrwxr-x 2 serveur serveur 60 juin 5 10:49 izsynth-20160605-104906
drwxrwxr-x 2 serveur serveur 60 juin 5 11:00 izsynth-20160605-110029
drwxrwxr-x 2 serveur serveur 60 juin 5 11:00 izsynth-20160605-110039
drwxrwxr-x 2 serveur serveur 60 juin 5 11:01 izsynth-20160605-110110
ps aux | grep domoticz | grep -v grep
root 1048 0.1 0.6 1268680 27520 ? Ssl 09:54 0:09 /home/serveur/domoticz/domoticz -daemon -www 8080 -sslwww 443
uname -a
Linux serveur-ZBOX-BI320 4.4.0-22-generic #40-Ubuntu SMP Thu May 12 22:03:46 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
I've also tried this command line (doesn't work in Domoticz)
Code: Select all
./izsynth -t "Welcome Home" > /tmp/izsynth.log
Had to run it as root otherwise no permission.
Code: Select all
cat /tmp/izsynth.log
== [1/1] - izsynth Name:[Welcome_Home] =========================================
File exist - input:[/dev/shm/Welcome_Home.mp3]
Playing - input:[/dev/shm/Welcome_Home.mp3] command:[mplayer] options:[-quiet -nolirc -noconsolecontrols -ao alsa]
-- [1/1] -----------------------------------------------------------------------
I think it's user related but I can't figure out what's wrong.
Re: izSynth: make domoticz talk with many TTS engines in a easy way
Posted: Friday 10 June 2016 11:32
by Nautilus
Hi, I have a weird issue with izsynth and other tts related scripts that I've tried. There is no audio output via HDMI although I can play other files just fine. More info:
viewtopic.php?f=23&t=10923&start=40#p88351
Any ideas where the issue might be?
Re: izSynth: make domoticz talk with many TTS engines in a easy way
Posted: Tuesday 14 June 2016 1:10
by jin
Nautilus wrote:Hi, I have a weird issue with izsynth and other tts related scripts that I've tried. There is no audio output via HDMI although I can play other files just fine. More info:
viewtopic.php?f=23&t=10923&start=40#p88351
Any ideas where the issue might be?
Hi,
can you run izsynth with:
and change the output device for the izsynth.
for example this is my raspberry configuration:
Code: Select all
pi@raspberrypi ~/domoticz/scripts $ izsynth -D
alsa:device=hw=0.0 bcm2835 ALSA
alsa:device=hw=0.1 bcm2835 IEC958/HDMI
alsa:device=hw=1.0 USB Audio
alsa:device=bluetooth01
alsa:device=bluetooth02
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
To playback to external USB Audio device:
Code: Select all
pi@raspberrypi ~/domoticz/scripts $ izsynth -e naturalreaders -v Peter -t "Welcome home, mr Stark" -d alsa:device=hw=1.0
To playback on external bluetooth audio speaker:
Code: Select all
pi@raspberrypi ~/domoticz/scripts $ izsynth -e naturalreaders -v Peter -t "Welcome home, mr Stark" -d alsa:device=bluetooth01
with kind regards