ugoviti / izsynth

TTS/Text To Speech synthesizer, background music overlay assembler and audio file converter for PBX and Home Automation Systems
GNU Lesser General Public License v3.0
17 stars 7 forks source link

Generic error with voicerss and naturalreaders, playback error with google #3

Closed odelma closed 5 years ago

odelma commented 5 years ago

Hi,

first of all, thank you for this script. It has worked flawlessly for years(?) as a companion to Domoticz, but noticed that lately there's been some issues that I cannot fully troubleshoot. I used voicerss and when trying to run it manually, I got an unspecified error. I noticed the file was basically empty and thus unplayable. I tried to login to voicerss which claimed it does not recognize my email so I ended up creating a new account with new api key. While at it, I also updated the izsynth to latest beta (had not updated for a long long time), created a new conf file and run the prerequisites installation again hoping that everything would be set. However, I still end up getting same error with voicerss and when I tried with naturalreaders it was the same. With google, however, it went further but still was not able to play the file. The error message is: sox FAIL remix: too few input channels I tried searching for this error message but it did not yield results that would have guided me to right direction. Also, I wonder why using google seems to do all kinds of stuff in between fetching the file and playing it. When I used voicerss, it just downloaded an .mp3 to /dev/shm/ and played it. Now google is downloading it to a separate directory in /dev/shm/, gives it a funny ending (e.g. myfile-d-3132342173.mp3), then converts it to 44khz wav (log shows actions: converting -> normalizing -> remixing) and tries finally to play "myfile-d-3132342173.44khz.wav" but getting the mentioned error. Can I somehow skip these "extra" steps?

I can play a file that izsynth created earlier with the same player (omxplayer but I also tried with mplayer and others) izsynth is using so basically everything should be in order.

Thanks for any troubleshooting tips...:smile:

ugoviti commented 5 years ago

Hi odelma,

naturalreaders changed some time ago the web api, so I must reverse engineer again their code to make that engine works again.

about VoiceRSS, I tested right now the registration and the synth of test message and worked without troubles.

I made a typo into description of VoiceRSS activation guide:

[jin@jlt ~]$ izsynth -e voicerss -v en-us -t "testing google synth" 
== [1/1] - izsynth Name:[testing_google_synth-2518208749] ======================
Synthesizing - input:[/dev/shm/izsynth-20190213-091911/testing_google_synth-2518208749.txt] engine:[voicerss] voice:[en-us] output:[/dev/shm/testing_google_synth-2518208749.mp3] 
ERROR: Wrong or missing izsynth user config file.

Step 1: Create this file: /home/jin/.config/izsynth/izsynth.conf (use the command /home/jin/.local/bin/izsynth -C)
Step 2: Put into all variables you want override from the main script
Step 3: voicerss engine specific config and variables:

Get the VoiceRSS API KEY from: http://www.voicerss.org/personel
and put the following variable info '/home/jin/.config/izsynth/izsynth.conf' config file:

TTS_ENGINE_ISPEECH_TTS_ENGINE_VOICERSS_APIKEY="1234567890abcdefghilmnopqtwxyz"

Just updated git repo with the right name: TTS_ENGINE_VOICERSS_APIKEY

Tested google voice also, and worked

Can you print your sox version?

sox --version
sox:      SoX v14.4.2

With kind regards

odelma commented 5 years ago

Thanks for the quick reply. I noticed the voicerss api "name" inconsistency in the guide so I was able to change that already in the beginning when started testing with the new version of izsynth. Sox version is v14.4.1 which my Raspberry running Jessie is claiming to be the latest version available through apt-get. I tested the url for voicerss manually and it worked fine so api key is active and working. However, when I run izsynth I just get:

pi@RPi2:~$/home/pi/scripts/izsynth -e voicerss -v fi-fi -r -m /home/pi/scripts/
silence.wav -p 1 -P 1 -F 0 -k omxplayer -K "-o hdmi" -t "Ovikello soi etuovella"
 -d ""                                                                          
== [1/1] - izsynth Name:[Ovikello_soi_etuovella-1007747011] ====================
Synthesizing - input:[/dev/shm/izsynth-20190213-104056/Ovikello_soi_etuovella-10
07747011.txt] engine:[voicerss] voice:[fi-fi] output:[/dev/shm/izsynth-20190213-
104056/Ovikello_soi_etuovella-1007747011.mp3] size:[4.0K] type:[text/plain] resu
lt:[ERROR]                                                                      
pi@RPi2:~$         

edit: same with google:

pi@RPi2:~$ /home/pi/scripts/izsynth -e google -v fi -r -m /home/pi/scripts/silen
ce.wav -p 1 -P 1 -F 0 -k omxplayer -K "-o hdmi" -t "Ovikello soi etuovella" -d "
"                                                                               
== [1/1] - izsynth Name:[Ovikello_soi_etuovella-1515952579] ====================
Synthesizing - input:[/dev/shm/izsynth-20190213-104826/Ovikello_soi_etuovella-15
15952579.txt] engine:[google] voice:[fi] output:[/dev/shm/izsynth-20190213-10482
6/Ovikello_soi_etuovella-1515952579.mp3] size:[12K] type:[audio/mpeg] result:[SU
CCESS]                                                                          
Converting   - input:[/dev/shm/izsynth-20190213-104826/Ovikello_soi_etuovella-15
15952579.mp3] input_size:[12K] output:[/dev/shm/izsynth-20190213-104826/Ovikello
_soi_etuovella-1515952579.44khz.wav] output_size:[104K]                         
Normalizing  - input:[/dev/shm/izsynth-20190213-104826/Ovikello_soi_etuovella-15
15952579.44khz.wav] input_size:[104K] input_rate:[24000] output_size:[188K] outp
ut_rate:[44100]                                                                 
Remixing     - input:[/dev/shm/izsynth-20190213-104826/Ovikello_soi_etuovella-15
15952579.44khz.wav] music:[/home/pi/scripts/silence.wav] music_volume:[] tts_vol
ume:[] output:[/dev/shm/izsynth-20190213-104826/Ovikello_soi_etuovella-151595257
9.remixed.44khz.wav] sox FAIL remix: too few input channels                     
size:[] duration:[4] result:[ERROR]
ugoviti commented 5 years ago

released 5.0 with restored naturalreaders support, can you try?

Thanks

odelma commented 5 years ago

Thanks! With further tests I was able to get all reading services to work. The culprit seemed to be the extra options I had in the original script. This is still giving the same error: /home/pi/scripts/izsynth -e voicerss -v fi-fi -r -m /home/pi/scripts/ silence.wav -p 1 -P 1 -F 0 -k omxplayer -K "-o hdmi" -t "Ovikello soi etuovella"

this works fine: /home/pi/scripts/izsynth -e voicerss -v fi-fi -r "Ovikello soi etuovella"

I remember I had problems in getting sound through my old receiver and finally when it worked with omxplayer, there was a cut of 1-2 seconds in the beginning. Therefore I added the silent background music which took care of the audio cut at the beginning. Now with my new receiver it seems it is not needed anymore in any case so I'm happy with the current situation :smiley: