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

All kinds of 'OS' scripts

Moderator: leecollings

Post Reply
jin
Posts: 62
Joined: Thursday 18 September 2014 20:28
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by jin »

Hi,

I'm writing this post just for inform I published a new software to make domoticz talk using various TTS (Text-to-Speech) engines in an easy way:

http://www.domoticz.com/wiki/IzSynth

Two commands quick and dirty install and test guide: :) (taken from domoticz wiki)

Code: Select all

cd /home/pi/domoticz/scripts
wget https://raw.githubusercontent.com/ugoviti/izsynth/master/izsynth && chmod 755 izsynth
./izsynth -e naturalreaders -v Peter -t "Welcome home, mr Stark" -w
If you like it and want enhance izsynth, fork it and make patches using the official github repository:

https://github.com/ugoviti/izsynth

Kind regards
Last edited by jin on Wednesday 04 May 2016 23:49, edited 2 times in total.
Derik
Posts: 1601
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

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

Post by Derik »

mmm looks very simple...
Are there different languages?
And is there perhaps a youtube movie to see the options?

What hardware do i need?
Is there option to use more mics in different rooms?
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
woody4165
Posts: 476
Joined: Monday 14 March 2016 13:55
Target OS: Linux
Domoticz version: beta
Location: Rome, Italy
Contact:

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

Post by woody4165 »

Very nice!!!
Thanks for sharing.
Which TTS does support now?
Cubietruck - Linux cubietruck 4.13.16 (Debian GNU/Linux 8 (jessie)) + Domoticz + RFLink, Xiaomi Gateway, Owl USB, Yeelight Color and B/W, ESP8266, Broadlink RM2, Netatmo Thermostat
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 »

woody4165 wrote:Very nice!!!
Thanks for sharing.
Which TTS does support now?

Code: Select all

[jin@jlt ~]$ izsynth -L
Engine            Version     Type    Provider          APIKEY  Technology  HomePage
----------------  ----------  ------  ----------------  ------  ----------  --------
espeak            2015-12-19  Local   eSpeak            NO      OpenSource  http://espeak.sourceforge.net
festival          2015-12-19  Local   Festival          NO      OpenSource  http://www.cstr.ed.ac.uk/projects/festival
fromtexttospeech  2015-12-19  Remote  FromtextToSpeech  NO      IVONA       http://www.fromtexttospeech.com
naturalreaders    2015-12-19  Remote  NaturalReader     YES     Custom      http://www.naturalreaders.com
sapi5             2015-12-19  Local   SAPI5             NO      Microsoft   http://www.microsoft.com/en-us/download/details.aspx?id=10121
voicerss          2016-04-18  Remote  VoiceRSS          YES     Custom      http://www.voicerss.org
Last edited by jin on Wednesday 27 April 2016 12:01, edited 2 times in total.
jmleglise
Posts: 192
Joined: Monday 12 January 2015 23:27
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: FRANCE
Contact:

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

Post by jmleglise »

Hi,

That works great ! thank you !

1/ Check your wiki. You have some error in the command line of the "Install OS Dependencies" part.

2/ it's a shame that you can't change the volume for a text already synthetised. Isn't it possible to adjust the volume only in the playback ?

3/ I am on raspberryPi. I have failed to install wine. Did you succeed ? can you direct me to an howto ? (I think, windows sapi is the best autonomous TTS)
My script : https://github.com/jmleglise
RFXTRX433E: Blind Somfy RTS, Portal Somfy Evolvia, chacon IO, Oregon, PIR sensor PT2262
My Last project : Location de maison de vacances a Ouistreham vue mer
KMTronic USB relay
Chinese Z-WAVE: Neo CoolCam
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 »

jmleglise wrote:Hi,

That works great ! thank you !

1/ Check your wiki. You have some error in the command line of the "Install OS Dependencies" part.

2/ it's a shame that you can't change the volume for a text already synthetised. Isn't it possible to adjust the volume only in the playback ?

3/ I am on raspberryPi. I have failed to install wine. Did you succeed ? can you direct me to an howto ? (I think, windows sapi is the best autonomous TTS)
1) Thank you, fixed the domoticz wiki page:

Code: Select all

sudo apt-get update
sudo apt-get install -y sox lame mplayer curl espeak wget
2) you can change the hardware soundcard output volume using the -W switch
example:

Code: Select all

script://izsynth -W 90 -t "Can you hear me now?"
If you found the correct audio volume, I suggest to modify the config file, so you don't need to specify the -W switch every time:
PLAYBACK_VOLUME="90"

3) I used wine with SAPI5 only on x86 platforms, never tested Wine on ARM.... on RPi I suggest to use an online service (it's slow, depending of service engine and connection speed, only on first synth... the next playback is realtime because izsynth reuse the already synthesized audio file)

With kind regards
jmleglise
Posts: 192
Joined: Monday 12 January 2015 23:27
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: FRANCE
Contact:

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

Post by jmleglise »

Hi,

Another feedback : I would appreciate in a future version an option to don't keep the audio file after the playback. Indeed, some sentences will never come again. (like reading news).
(for saving some disk space)
My script : https://github.com/jmleglise
RFXTRX433E: Blind Somfy RTS, Portal Somfy Evolvia, chacon IO, Oregon, PIR sensor PT2262
My Last project : Location de maison de vacances a Ouistreham vue mer
KMTronic USB relay
Chinese Z-WAVE: Neo CoolCam
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 »

jmleglise wrote:Hi,

Another feedback : I would appreciate in a future version an option to don't keep the audio file after the playback. Indeed, some sentences will never come again. (like reading news).
(for saving some disk space)

Code: Select all

jin@jlt:~$ izsynth -h | grep keep
  -w                         Overwrite the synthesized file, otherwise keep it (current: no)
otherwise you can change the default behavior via izsynth.conf file:

set:

Code: Select all

PLAYBACK_RESYNTH="yes"
Read the domoticz wiki page to discover:

http://www.domoticz.com/wiki/IzSynth

With kind regards
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 »

Is it possible to add https://www.ivona.com/ ? A very nice (even better than google) TTS with support for many languages and also free to use
Synology NAS, slave PI3, ZWave (Fibaro), Xiaomi zigbee devices, BTLE plant sensor, DzVents, Dashticz on tablet, Logitech Media Server
User avatar
blackdog65
Posts: 311
Joined: Tuesday 17 June 2014 18:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Norfolk, UK
Contact:

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

Post by blackdog65 »

Hi Jin,

Great idea!
I've installed this and when tested with voicerss it works but not when trying to fire a script from a button.

Any Ideas

Sean
CubieTruck Master
RasPi slaves
Aeon Labs Z-Stick, multi sensor
Fibaro Dimmers, relays, Universal sensors
EQ3 MAX!
TKB Sockets
RFXCOM
LightwaveRF sockets, switches, relays, doorbell
MySensors
ESPEasy ESP8266-12E
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 »

pvm wrote:Is it possible to add https://www.ivona.com/ ? A very nice (even better than google) TTS with support for many languages and also free to use
use the fromtexttospeech engine for IVONA voices...

example:

Code: Select all

izsynth -e fromtexttospeech -v Brian22 -t "Can you hear my bright voice now?" -w
with kind regards
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 »

blackdog65 wrote:Hi Jin,

Great idea!
I've installed this and when tested with voicerss it works but not when trying to fire a script from a button.

Any Ideas

Sean
Have you read carefully the wiki page? what syntax do you use in your buttons?
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 »

I cant get this to work.

Every engine i try i get error.
osmc@osmcsoverom:~$ $HOME/domoticz/scripts/izsynth -e voicerss -v en-us -t "I love Domoticz Home Automation System"
== [1/1] - izsynth Name:[I_love_Domoticz_Home_Automation_System] ===============
/home/osmc/domoticz/scripts/izsynth: line 99: column: command not found
/home/osmc/domoticz/scripts/izsynth: line 99: column: command not found
ERROR: the TTS Engine 'voicerss' doesn't exist, or is not supported by the izsynth
osmc@osmcsoverom:~$ $HOME/domoticz/scripts/izsynth -e voicers -v en-us -t "I love Domoticz Home Automation System"
== [1/1] - izsynth Name:[I_love_Domoticz_Home_Automation_System] ===============
/home/osmc/domoticz/scripts/izsynth: line 99: column: command not found
/home/osmc/domoticz/scripts/izsynth: line 99: column: command not found
ERROR: the TTS Engine 'voicers' doesn't exist, or is not supported by the izsynth
osmc@osmcsoverom:~$ $HOME/domoticz/scripts/izsynth -e sapi5 -v en-us -t "I love Domoticz Home Automation System"
== [1/1] - izsynth Name:[I_love_Domoticz_Home_Automation_System] ===============
/home/osmc/domoticz/scripts/izsynth: line 99: column: command not found
/home/osmc/domoticz/scripts/izsynth: line 99: column: command not found
ERROR: the TTS Engine 'sapi5' doesn't exist, or is not supported by the izsynth
osmc@osmcsoverom:~$ $HOME/domoticz/scripts/izsynth -e espeak -v en-us -t "I love Domoticz Home Automation System"
== [1/1] - izsynth Name:[I_love_Domoticz_Home_Automation_System] ===============
/home/osmc/domoticz/scripts/izsynth: line 99: column: command not found
/home/osmc/domoticz/scripts/izsynth: line 99: column: command not found
ERROR: the TTS Engine 'espeak' doesn't exist, or is not supported by the izsynth
osmc@osmcsoverom:~$ $HOME/domoticz/scripts/izsynth -e espeak -v en-us -t "I love Domoticz Home Automation System"
User avatar
blackdog65
Posts: 311
Joined: Tuesday 17 June 2014 18:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Norfolk, UK
Contact:

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

Post by blackdog65 »

got it,
I needed the extra / and the full path i.e.

Code: Select all

script:///home/USER/domoticz/scripts/izsynth -t "say something clever"
CubieTruck Master
RasPi slaves
Aeon Labs Z-Stick, multi sensor
Fibaro Dimmers, relays, Universal sensors
EQ3 MAX!
TKB Sockets
RFXCOM
LightwaveRF sockets, switches, relays, doorbell
MySensors
ESPEasy ESP8266-12E
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 »

toreandre wrote:I cant get this to work.

Every engine i try i get error.
osmc@osmcsoverom:~$ $HOME/domoticz/scripts/izsynth -e voicerss -v en-us -t "I love Domoticz Home Automation System"
== [1/1] - izsynth Name:[I_love_Domoticz_Home_Automation_System] ===============
/home/osmc/domoticz/scripts/izsynth: line 99: column: command not found
/home/osmc/domoticz/scripts/izsynth: line 99: column: command not found
ERROR: the TTS Engine 'voicerss' doesn't exist, or is not supported by the izsynth
osmc@osmcsoverom:~$ $HOME/domoticz/scripts/izsynth -e voicers -v en-us -t "I love Domoticz Home Automation System"
== [1/1] - izsynth Name:[I_love_Domoticz_Home_Automation_System] ===============
/home/osmc/domoticz/scripts/izsynth: line 99: column: command not found
/home/osmc/domoticz/scripts/izsynth: line 99: column: command not found
ERROR: the TTS Engine 'voicers' doesn't exist, or is not supported by the izsynth
osmc@osmcsoverom:~$ $HOME/domoticz/scripts/izsynth -e sapi5 -v en-us -t "I love Domoticz Home Automation System"
== [1/1] - izsynth Name:[I_love_Domoticz_Home_Automation_System] ===============
/home/osmc/domoticz/scripts/izsynth: line 99: column: command not found
/home/osmc/domoticz/scripts/izsynth: line 99: column: command not found
ERROR: the TTS Engine 'sapi5' doesn't exist, or is not supported by the izsynth
osmc@osmcsoverom:~$ $HOME/domoticz/scripts/izsynth -e espeak -v en-us -t "I love Domoticz Home Automation System"
== [1/1] - izsynth Name:[I_love_Domoticz_Home_Automation_System] ===============
/home/osmc/domoticz/scripts/izsynth: line 99: column: command not found
/home/osmc/domoticz/scripts/izsynth: line 99: column: command not found
ERROR: the TTS Engine 'espeak' doesn't exist, or is not supported by the izsynth
osmc@osmcsoverom:~$ $HOME/domoticz/scripts/izsynth -e espeak -v en-us -t "I love Domoticz Home Automation System"

mmmm... interessting:

Code: Select all

pi@raspberrypi ~ $ dpkg -S /usr/bin/column
bsdmainutils: /usr/bin/column
what distro are you running?

If it's debian based, can you execute this command?

Code: Select all

sudo apt-get install bsdmainutils
Let's me know.. mean while I'll update the wiki with this package (I use the column command a lot).

Kind regards
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 »

blackdog65 wrote:got it,
I needed the extra / and the full path i.e.

Code: Select all

script:///home/USER/domoticz/scripts/izsynth -t "say something clever"
this is strange... what version of domoticz are you using?

since 3.x release, we can use the relative path, like

Code: Select all

script://izsynth
domoticz will search the command inside DOMOTICZ_HOME/scripts

any way the full path can be a solution (I don't like because the command become very long)

Thank you for sharing
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 »

jin wrote:

mmmm... interessting:

Code: Select all

pi@raspberrypi ~ $ dpkg -S /usr/bin/column
bsdmainutils: /usr/bin/column
what distro are you running?

If it's debian based, can you execute this command?

Code: Select all

sudo apt-get install bsdmainutils
Let's me know.. mean while I'll update the wiki with this package (I use the column command a lot).

Kind regards
Sorry, i forgot to mention my setup. Im using RPi2, domoticz 3.5051 and OSMC (debian jessie).

I keep forgetting that OSMC is a "light" version of debian so many standard packages is missing, the apt-get command solved the problem.

Thank you for your fast reply :)

Code: Select all

sudo apt-get install bsdmainutils
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 i stumbled on another error, any idea of what this could be? i dont have a texteditor that shows the line numbers so its difficult to locate the command that gives the error.

Code: Select all

osmc@osmcsoverom:~$ $HOME/domoticz/scripts/izsynth -e voicerss -v nb-no -t "I love Domoticz Home Automation System"
== [1/1] - izsynth Name:[I_love_Domoticz_Home_Automation_System] ===============
/home/osmc/domoticz/scripts/izsynth: line 491: file: command not found
/home/osmc/domoticz/scripts/izsynth: line 487: file: command not found
Synthetizing - input:[/dev/shm/izsynth-20160428-204101/I_love_Domoticz_Home_Automation_System.txt] engine:[voicerss] voice:[nb-no] output:[/dev/shm/izsynth-20160428-204101/I_love_Domoticz_Home_Automation_System.mp3] size:[28K] type:[] result:[ERROR]
User avatar
blackdog65
Posts: 311
Joined: Tuesday 17 June 2014 18:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Norfolk, UK
Contact:

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

Post by blackdog65 »

jin wrote:this is strange... what version of domoticz are you using?

since 3.x release, we can use the relative path
My installation often has minor quirks that a put down to being on a cubietruck, however, I'm currently using v3.5065 which seems to have a mind of its own i.e. it will not allow itself to be upgraded viewtopic.php?f=6&t=11737 :shock: :?
CubieTruck Master
RasPi slaves
Aeon Labs Z-Stick, multi sensor
Fibaro Dimmers, relays, Universal sensors
EQ3 MAX!
TKB Sockets
RFXCOM
LightwaveRF sockets, switches, relays, doorbell
MySensors
ESPEasy ESP8266-12E
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 »

toreandre wrote:So i stumbled on another error, any idea of what this could be? i dont have a texteditor that shows the line numbers so its difficult to locate the command that gives the error.

Code: Select all

osmc@osmcsoverom:~$ $HOME/domoticz/scripts/izsynth -e voicerss -v nb-no -t "I love Domoticz Home Automation System"
== [1/1] - izsynth Name:[I_love_Domoticz_Home_Automation_System] ===============
/home/osmc/domoticz/scripts/izsynth: line 491: file: command not found
/home/osmc/domoticz/scripts/izsynth: line 487: file: command not found
Synthetizing - input:[/dev/shm/izsynth-20160428-204101/I_love_Domoticz_Home_Automation_System.txt] engine:[voicerss] voice:[nb-no] output:[/dev/shm/izsynth-20160428-204101/I_love_Domoticz_Home_Automation_System.mp3] size:[28K] type:[] result:[ERROR]
mmmm... interesting :)

Code: Select all

pi@raspberrypi ~ $ which file
/usr/bin/file
pi@raspberrypi ~ $ dpkg -S /usr/bin/file
file: /usr/bin/file
can you run:

Code: Select all

sudo apt-get install file
izsynth is a bash script and it use many system commands to do the job, so these commands must be installed :)

just updated wiki, thanks!

let's me know is something is still missing.

kind regards
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests