Mycroft using Watson TTS

I’m trying to get Mycroft (running on Picroft) to use IBM’s Watson TTS. I’m using the following mycroft.conf:

{
   "play_wav_cmdline": "aplay -Dhw:0,0 %1",
   "play_mp3_cmdline": "mpg123 -a hw:0,0 %1",
   "enclosure": {
      "platform": "picroft"
   },
   "tts": {
      "module": "watson",
      "watson": {
        "voice":"en-US_MichaelVoice",
        "credential": {
          "json": {
            "url": "https://stream.watsonplatform.net/text-to-speech/api",
            "username": "ibm_api_username",
            "password": "ibm_api_password"
          }
        }
     }
   },
   "ipc_path": "/ramdisk/mycroft/ipc/"
}

I’ve also tried adding language setting and without url, to no avail. It’s not giving me any errors, but it’s also not working. Any idea what I’m doing wrong, and for future reference, are there any logs I could read to troubleshoot things like this?

You must edit the mycroft of /home/

The rest seems to be well placed

I can’t for the life of me get this figured out :unamused:

I’ve edited ‘/home/ubuntu02/mycroft-core/mycroft/configuration/mycroft.conf’ (moved from Picroft to install on Ubuntu 18.04 by the way), and modified the TTS part as such:

  // Text to Speech parameters
  // Override: REMOTE
  "tts": {
    "module": "watson",
    "watson": {
      "voice": "en-US_MichaelVoice",
      "credential": {
         "user": "ibm_username",
         "password": "ibm_password"
      }
    },
    "mimic": {
      "voice": "ap"
    },
    "mimic2": {
      "lang": "en-us",
      "url": "https://mimic-api.mycroft.ai/synthesize?text="
    },
    "espeak": {
      "lang": "english-us",
      "voice": "m1"
    }
  },

I’ve tried different versions based on the Mycroft Watson TTS code, but it won’t load.

What’s also weird is that I can’t find any mention about it in the logs, located at /var/log/mycroft…

Any idea? Is it being overridden or something?

Looking at the Watson TTS code I think it does not look for a “credentials” subsection but immediately looks for “username” and “password” inside the “watson” section.
Did not test it but maybe this works

   // Text to Speech parameters
  // Override: REMOTE
  "tts": {
    "module": "watson",
    "watson": {
      "voice": "en-US_MichaelVoice",
       "user": "ibm_username",
       "password": "ibm_password"
    }
  },

Thanks. Still no dice. I even commented out all the other modules in “tts” but it still only uses the default voice :frowning:

I’ve retried the settings using curl:

curl -X POST -u "ibm_username":"ibm_pass" --header "Content-Type: application/json" --header "Accept: audio/wav" --data "{\"text\": \"hello world\"}" --output hello_world.wav "https://stream.watsonplatform.net/text-to-speech/api/v1/synthesize"

… which work fine.

Perhaps something in the IBM API calls has changed. Where/how should I debug this? Any logs I’ve missed?

Looks like there was a change to authentication in October 2018:
https://cloud.ibm.com/docs/services/text-to-speech/release-notes.html#limitations

Still wonder why your curl example works…?

Think that’s because I had that account setup for a while:

Existing service instances that you created in a location before the indicated migration date continue to use the {username} and {password} from their previous Cloud Foundry service credentials for authentication until you migrate them to use IAM authentication.

When using the advanced setup page, at the bottom I can pick 'Google’as TTS. That succesfully changes the voice, however into a female variant. Where can I config which voice it uses?

Tts-option „Google“ has only this voice.

Alright, thanks. But this setting seems to be able to change the TTS voice, while changing /home/user/mycroft-core/mycroft/configuration/mycroft.conf doesn’t do anything.

Can I perhaps change the values this online setting enforces?

There are several locations for the configuration and a certain order how config is loaded, from memory these are (i might be wrong for the order of #2 and #3):

  1. /etc/mycroft/mycroft.conf

  2. /home/mycroft/.mycroft/mycroft.conf

  3. settings from home.mycroft.ai

  4. /home/[your local user, e.g. “pi”]/.mycroft/mycroft.conf

if the same parameter is present in several of the configs the latter one overwrites the preceding

Thanks again Dominik, when I get Mycroft running stable I’ll try those options :slight_smile:

Alright, this is solved. For future reference:

Edit /home/{username}/.mycroft/mycroft.conf and add the following:

"tts": {
     "module": "watson",
     "watson": {
       "voice":"en-US_MichaelVoice",
       "user": "ibm_user_name",
       "password": "ibm_password"
     }
  }

Restart Mycroft and you should hear a new voice and see the requests popping up in /var/log/mycroft/audio.log.

3 Likes

Very cool @SamKr. Is there any way you could show us a video showing it off? I’d love to see this.

I will when I get everything running nicely - atm voice rec isn’t :cold_face:

Quick update on this though: evidently the above config file gets overwritten every now and then, so for the less Linux-savvy people (like me) who want to permanently fix this:

Make sure you don’t already have the file /etc/mycroft/mycroft.conf (I didn’t, if you do, just add the config there and skip the steps below)
Create the folder: sudo mkdir /etc/mycroft
Create the file: sudo nano /etc/mycroft/mycroft.conf
Paste or type the tts config from my post above
Save (ctrl-x, ctrl-y, enter)
Give yourself ownership: sudo chown username:usergroup /etc/mycroft/mycroft.conf
If you need to find your username/group, go into your folder and type ls -l

Restart Mycroft and everything should work (and keep working).

If I’ve missed something, please let me know :slight_smile:

you should edit ~/.mycroft/mycroft.conf, not /etc/mycroft/mycroft.conf

configs are loaded and overrided by a certain order

  • the default in mycroft-core folder
  • web, this is the changes from home.mycroft.ai
  • system, at /etc/mycroft, meant for enclosure configs, for example the mark1 uses this
  • user, the one you want to edit

/etc/mycroft/mycroft.conf should be safe to edit, but updates might eventually overwrite it

2 Likes

Yeah, I’m surprised your home config file was getting overwritten. Did you get a sense of what triggered the file to get overwritten? Eg you reinstalled mycroft-core or something else?

@JarbasAl I know, but since the home config got overwritten I went to this one.
@gez-mycroft Hadn’t booted Mycroft for about a week, when I launched I saw a bunch of update messages in the debug console.

please provide logs if possible, it’s very strange that home config got changed…

if it happens to be overwritten again, it takes precedence over /etc/, which means your changes may be ignored again…

i don’t see anything that could have caused that, very strange indeed

1 Like

Don’t have the logs anymore, but I’ll move the settings back and post the logs here when/if they do get overwritten again.

2 Likes