Guide to add a new language

Where I’m supposed to set this? I’ve set up on /etc/mycroft/mycroft.conf but after restarting the device didn’t answer and the eyes on the screen were a light spinning incessantly

i will update the guide to make it clearer

you may be getting your settings overrided by the remote config in mycroft.ai, the spinning eyes may be a different problem, i think it was a know bug a while back?

Removing the lang line from mycroft.conf eyes turned normal again, but now doesn’t understands me… mycroft-speech-client.log says

14:08:19.515 - mycroft.client.speech.listener:transcribe:146 - ERROR - Could not request Speech Recognition recognition request failed: Forbidden

and mycroft-messagebus.log says

14:11:20.932 - mycroft.messagebus.service.ws:on_message:41 - DEBUG - {"data": {}, "type": "recognizer_loop:record_begin", "context": null}
14:11:20.995 - mycroft.messagebus.service.ws:on_message:41 - DEBUG - {"data": {}, "type": "Command: mouth.listen", "context": null}
14:11:23.143 - mycroft.messagebus.service.ws:on_message:41 - DEBUG - {"data": {}, "type": "recognizer_loop:record_end", "context": null}
14:11:23.574 - mycroft.messagebus.service.ws:on_message:41 - DEBUG - {"data": {"session": "08c503be-68b9-42fb-851d-007965a75131", "utterance": "hey mycroft"}, "type": "recognizer_loop:wakeword", "context": null}
14:11:23.624 - mycroft.messagebus.service.ws:on_message:41 - DEBUG - {"data": {}, "type": "Command: mouth.reset", "context": null}

But I guess this is another problem :expressionless:

Make sure when you add the line you add a comma before so that it looks exactly like this:

{
  "enclosure": {
    "platform": "mycroft_mark_1",
    "platform_build": 7,
    "port": "/dev/ttyAMA0",
    "rate": 9600,
    "timeout": 5,
    "update": true,
    "test": false
  },
  "VolumeSkill": {
    "default_level": 6,
    "min_volume": 0,
    "max_volume": 83
  },
  "lang": "pt-pt"
}

I’m not quite sure about the other error.

Regarding the last issue, I did as I’d readed somewhere else and deleted the /home/mycroft/.mycroft/identity/identity2.json and readded the mycroft via home.mycroft.ai, and Mycroft started to work again. Just in case, I did wipe it and began the entire process.

On the main subject… thank you it was the comma… :man_facepalming:

Anyway, despite now mycroft listen what I say in spanish, it continues saying “sorry, I didn’t catch that”. Seeing at the logs, I can see how it can “understand what I’m saying”

19:10:44.115 - mycroft.client.speech.main:handle_wakeword:50 - INFO - Wakeword Detected: hey mycroft
19:10:44.184 - requests.packages.urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai
19:10:45.044 - mycroft.client.speech.mic:listen:492 - DEBUG - Waiting for wake word…
19:10:45.135 - requests.packages.urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “POST /v1/stt?lang=es-ES&limit=1 HTTP/1.1” 200 None
19:10:45.756 - mycroft.client.speech.listener:transcribe:144 - DEBUG - STT: qué distancia hay de la tierra a la luna
19:10:45.760 - mycroft.client.speech.main:handle_utterance:55 - INFO - Utterance: [u’qu\xe9 distancia hay de la tierra a la luna’]
19:10:45.810 - mycroft.client.speech.main:handle_complete_intent_failure:67 - INFO - Failed to find intent.

But no answer, I guess is the “intent” problem.

How should I continue now?

the skills are not translated, you must also translate those

there is a “en-us” folder, just clone it to “es-es” and translate

dialog/en-us/speak.dialog
vocab/en-us/sentence.intent
vocab/en-us/keyword.voc
regex/en-us/regex.rx

Great!

I’ve translated the skill skill-date-time into spanish and now Mycroft can understand that command! :ok_man:

Now the last step should be mycroft speaking spanish, I mean, he telling the time in spanish or the typical messages “sorry, I didn’t catch that” and so… how can I accomplish that?

(this is exciting! :smile: )

some skilsl use .dialog files, these are easy to translate

others, for example jokes skill, generate speech at runtime, the jokes skills has no way to be translated

for some skills you may need to edit the code of the skill

translate all bits of the kind self.speak(“something im speaking”), ideally skill makers should always use self.speak_dialog for this reason, but not all skills do

skill-time-dialgog has the .dialog files which I’ve translated, but it continues spealing in english, and not in the translated version.

I guess I didn’t configure at all the TTS engine and its still using the defaults. Well, I didn’t configured neither STT nor TTS at all, to be honest, I’ve only set the “lang” parameter on mycroft.con since I didn’t understand how to configure any module explained on your guide.

My mycroft.con now is just this:

{
“enclosure”: {
“platform”: “mycroft_mark_1”,
“platform_build”: 10,
“port”: “/dev/ttyAMA0”,
“rate”: 9600,
“timeout”: 5.0,
“update”: true,
“test”: false
},
“VolumeSkill”: {
“default_level”: 6,
“min_volume”: 0,
“max_volume”: 83
},
“ipc_path”: “/ramdisk/mycroft/ipc/”,
“lang”: “es-es”
}

I would like espeak as engine, that’s the problem, I do not know how to add it to the configuration without break anything. Could you please specify how can I get it?

I use the espeak example in my guide…

Mycroft as several possible configuration files, you can change the
configuration at home.mycroft.ai

If you do not wish to use the mycroft.ai endpoint change your config located at “~/.mycroft/mycroft.conf”

Change your config file to use TTS and STT engine of choice

    "lang": "pt-pt",
    ...
    "tts": {
      "module": "espeak",
      ...
      "espeak": {
        "lang": "pt-pt",
        "voice": "m1"
      }
    "stt": {
      "module": "ibm",
      ...
      "ibm":{
        "credential" : {
            "username": "xxxxxxxxxxxxxxx",
            "password": "xxx"
            }
      }

If remote configuration is enabled it will override your changes, disable it

    "server": {
     ...
     "update": false,
     ...
    },

Identation matters like in yaml or python? Sometimes I see two spaces, sometimes one and sometimes three blank spaces.
I fear to break it again (it seems pretty fragile and I had to reimage mark1 twice, because rolling back changes let mycroft unusable and with the spinning eyes)

by the way, those changes must be done on ~/.mycroft/mycroft.conf or /etc/mycroft/mycroft.conf?
What’s the difference between the two of them? Whenever I modified the ~/.mycroft/mycroft.conf, the system has become unstable (spinnig eyes thing)

On thing more, on Mark1 there is a pi user, a mycroft user and root.
when I speak of ~/.mycroft/mycroft.conf I mean /home/mycroft/.mycroft/mycroft.conf, but perhaps I should create a /root/.mycroft/mycrof.conf or /home/pi/.mycroft/mycroft.conf, both non-existent.
That’s why before the doubt, I have been using /etc/mycroft/mycroft.conf, editing it as root, thinking that perhaps it would be global…
That’s right?

configs are loaded by this order, each override the previous

DEFAULT_CONFIG = 'mycroft-core/mycroft/configuration/mycroft.conf’
SYSTEM_CONFIG = '/etc/mycroft/mycroft.conf’
USER_CONFIG = ‘~/.mycroft/mycroft.conf’)
REMOTE_CONFIG = “mycroft.ai”

No way, if I put something else more than the “lang” parametert, then mark1 stops working (the damn spinning eyes… :cry:
I guess I’m doing something wrong, but I cannot see what is…

Could you please provide a working example (in pt-pt if just fine) for me to try to adapt it to spanish? Perhaps starting from a non-english working settings I can accomplish and see what I’m doing wrong faster than this… :bowing_man:

@malevolent

Hello

I’m working on the french translation for mycroft-core and mycroft-skill.

Before working in mark1, the more easy is to working on Linux on your computer by compiling mycroft-core source code because adding a new language for mycroft is not easy.
I will update the wiki page GitHub - MycroftAI/mycroft-core: Mycroft Core, the Mycroft Artificial Intelligence platform. with steps by steps tasks when I will find a STT (Speech to text) software that works in local with french.
My goal is to have my mycroft mark 1 in french for christmas 2017.
And it will be not easy …

i have no idea what is happening with the rollign eyes (dont have mark1)

you must either share logs for us to hunt the error or your config so we can help, there’s not much else i can show you… you probably are using invalid syntax in the config i assume, some missing , or using single quotes ’ instead of "

Well, I finally got it working. :smile:

I did a search on the entire filesystem and found the default config in /usr/local/lib/python2.7/site-packages/mycroft_core-0.9.7-py2.7.egg/mycroft/configuration/mycroft.conf. As it din’t applied the modifications (lang and so) I copied all modifications to /etc/mycroft/mycroft.conf, rebooted and voilà, know Mycroft understand my translated skill-date-time in spanish and also answers in spanish, after the installation of the espeak packge (mimic dind’t worked in spanish)

Several years ago I played with espeak and I did found mbrola voices more “human” than the defaults on espeak. Can we use mbrola voices? If affirmative, how can be configured? Firtsly I must get mbrola and mbrola-es2 installed, apt refuses to install mbrola-es because depends on mbrola and mbrola has no candidate. :confused:

Oh, by the way… how can I change the default’s “Sorry I didn’t catch that, please rephrase your request” sentence… hearing it in “spanglish” is quite hilarious but I would like Mycroft to speak entirely in spanish :stuck_out_tongue:

EDITED: I did found it on/usr/local/lib/python2.7/site-packages/mycroft_core-0.9.7-py2.7.egg/mycroft/client/speech/main.py

but translating there doesn’t seems to work.

This will soon be handled by the new fallback-unknown. To activate it right now (since we haven’t added it as a default skill), you can say install fallback unknown.

Let me know it this helps,
Matthew