MaryTTS to speak Russian - Text Unicode issue?

Hi guys, got stuck with things seemed obvious ...

Known issue of Russian in MaryTTS 5.2 (no voice file in the build) , so following recommendationsI  put the necessary voice files, taken from Russian version of MaryTTS 5.1

Script looks fine.

voice="voxforge-ru-nsh"
text="я говорю"
mouth = Runtime.createAndStart("i01.mouth", "MarySpeech")
mouth.setLanguage("ru")
mouth.setVoice(voice)
mouth.speak(text)
 
But no voice out - Inmoov is silently ignoring me)

Apparently, MaryTTS server works fine, client speks all right. I looked at the logs - and found this:

python] [INFO] exec(String) 
voice="voxforge-ru-nsh"
text="я говорю"
mouth = Runtime.createAndStart("i01.mouth", "MarySpeech")
mouth.setLanguage("ru")
mouth.setVoice(voice)
mouth.speak(text)
[python.interpreter.7] [INFO] Runtime.createService i01.mouth
[python.interpreter.7] [INFO] speakInternal Blocking false Text: я говорю
[Thread-11] [INFO] Starting to speak: я говорю
[Thread-11] [INFO] Ok.. here we go.
[Thread-11] [INFO] End speaking: я говорю
 
I.e. the string is broken iside when sent to Mary API (Coding issue? UTF?)??
 
Did anyone noticed it before? Could it be due to MAC I'm running Java on??
 
Thank you beforehand!!
Konstantin's picture

Same (or connected) issue is

Same (or connected) issue is on the speach recognition.

 

[python.input] [ERROR] ------
Traceback (most recent call last):
  File "<script>", line 1, in <module>
  File "<string>", line 2, in heard
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-5: ordinal not in range(128)
 
It can not encode Russian Unicode characters through ASCII encoding somewhere in the middle
moz4r's picture

Hi Konstentin, try this

Hi Konstentin, try this :

voice : http://www.myai.cloud/mrl/mary-mrl-ru.zip

https://user-images.githubusercontent.com/18124594/27241303-88b05d14-52d8-11e7-9975-6f17c310dce8.png

 

test : https://github.com/MyRobotLab/pyrobotlab/blob/develop/home/moz4r/Test/ma...

 

Konstantin's picture

Thank you! Now I learned the

Thank you! Now I learned the "u" before string will make Unicode coding instead of ascii)

The test fails though:

[python.interpreter.11] [INFO] speakInternal Blocking true Text: привет
[python.interpreter.11] [ERROR] python error PyException - null Traceback (most recent call last):
  File "<string>", line 4, in <module>
at marytts.unitselection.data.DiphoneUnitDatabase.getCandidates(DiphoneUnitDatabase.java:84)
at marytts.unitselection.select.viterbi.Viterbi.apply(Viterbi.java:206)
at marytts.unitselection.select.UnitSelector.selectUnits(UnitSelector.java:117)
at marytts.unitselection.UnitSelectionSynthesizer.synthesize(UnitSelectionSynthesizer.java:164)
at marytts.modules.synthesis.Voice.synthesize(Voice.java:521)
at marytts.modules.Synthesis.synthesizeOneSection(Synthesis.java:252)
at marytts.modules.Synthesis.process(Synthesis.java:222)
at marytts.server.Request.processOneChunk(Request.java:547)
at marytts.server.Request.processOrLookupOneChunk(Request.java:385)
at marytts.server.Request.process(Request.java:327)
at marytts.LocalMaryInterface.process(LocalMaryInterface.java:438)
at marytts.LocalMaryInterface.generateAudio(LocalMaryInterface.java:348)
at org.myrobotlab.service.MarySpeech.speakInternal(MarySpeech.java:121)
at org.myrobotlab.service.MarySpeech.speakBlocking(MarySpeech.java:110)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
 
java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: gnu/trove/TIntHashSet
 
at org.python.core.Py.JavaError(Py.java:546)
at org.python.core.Py.JavaError(Py.java:537)
at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:188)
at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:204)
at org.python.core.PyObject.__call__(PyObject.java:478)
at org.python.core.PyObject.__call__(PyObject.java:482)
at org.python.core.PyMethod.__call__(PyMethod.java:141)
at org.python.pycode._pyx18.f$0(<string>:4)
at org.python.pycode._pyx18.call_function(<string>)
at org.python.core.PyTableCode.call(PyTableCode.java:167)
at org.python.core.PyCode.call(PyCode.java:18)
at org.python.core.Py.runCode(Py.java:1386)
at org.python.core.Py.exec(Py.java:1430)
at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:267)
at org.myrobotlab.service.Python$PIThread.run(Python.java:161)
Caused by: java.lang.NoClassDefFoundError: gnu/trove/TIntHashSet
at marytts.unitselection.data.DiphoneUnitDatabase.getCandidates(DiphoneUnitDatabase.java:84)
at marytts.unitselection.select.viterbi.Viterbi.apply(Viterbi.java:206)
at marytts.unitselection.select.UnitSelector.selectUnits(UnitSelector.java:117)
at marytts.unitselection.UnitSelectionSynthesizer.synthesize(UnitSelectionSynthesizer.java:164)
at marytts.modules.synthesis.Voice.synthesize(Voice.java:521)
at marytts.modules.Synthesis.synthesizeOneSection(Synthesis.java:252)
at marytts.modules.Synthesis.process(Synthesis.java:222)
at marytts.server.Request.processOneChunk(Request.java:547)
at marytts.server.Request.processOrLookupOneChunk(Request.java:385)
at marytts.server.Request.process(Request.java:327)
at marytts.LocalMaryInterface.process(LocalMaryInterface.java:438)
at marytts.LocalMaryInterface.generateAudio(LocalMaryInterface.java:348)
at org.myrobotlab.service.MarySpeech.speakInternal(MarySpeech.java:121)
at org.myrobotlab.service.MarySpeech.speakBlocking(MarySpeech.java:110)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:186)
... 12 more
 
moz4r's picture

Can you try a fresh install

Can you try a fresh install with the last build http://34.201.4.170/deploy/develop/myrobotlab.jar

And ac-nsh voice ( not the 5.1 ) : mouth.setVoice("ac-nsh")

Konstantin's picture

Thnks a lot. It works, voice

Thnks a lot.

It works, voice is OK. The new build is quite heavy though. Works so slowly. 

The new release with MaryTTS 5.2 integrated should be ok.

Thank you anyway!

 

 

Konstantin's picture

Mary TTS Russian speech quality

Dear moz4r et all,  have to say, it eventually speaks Russian. I.e. the fresh installation and set up recommended is worky.
However, the synthesis quality is very poor. Generally wrong prononciation, no smooth phrases... 
BTW, It does not say digits - at all.

I saw somewhere in net Mary was planning to improve/finalize the Russian support. However, no timeline or something.
May be you can advise using other engine of those supported by MRL? WindowsLocalTTS, POLLY? I've tried configuring them - no immediatte results, so will investigate further.
Will appreciate your advise! 

moz4r's picture

Hi Konstantin ! there is a

Hi Konstantin ! there is a little improvement of localSpeech service.

If your windows can speak russian with the help of embeded sapi engine from control panel, so mrl can speak russian too. Maybe you can unlock hidden voices :

http://myrobotlab.org/service/LocalSpeech?branch=develop

Konstantin's picture

Polly is awesome

Hi Anthony, 

I ended up with Amazon Polly TTS.

Voice Maxim sounds perfect in Russian! The guy sounds very famous - he had made dubbing of few shows and series here, so my kids are starring at Robot asking for more)))

So will stay with Polly - for 12 mths of free tier at least))

Tnx for wiki - great help))