How to install a custom voice on a Home Assistant Blue

Can someone please help me with instructions on how to install a custom voice on a Home Assistant Blue device please?

I’m using:

  • Home Assistant 2024.6.4
  • OS 12.4
  • Piper addon 1.5.0

I’ve enabled the samba addon and created a “piper” directory inside “/share”, copied the files over, restarted everything and nothing, the new voice doesn’t show up in the voice list (either in the piper addon or in the Voice Assistants setup area).

I took a look at the docker settings for the arm64-addon-piper container container and it appeared to be mounting “/mnt/data/supervisor/share” from the host to “/share” internally. My “/mnt” directory was empty, so I created the whole path, copied over the onnx and json files, restarted everything and… nope.

Does anyone know how this is supposed to be done?

And yes, I’ve tested my voice with the piper colab notebook, PiperUI and the piper command line, it works fine.

So I’ve gotten a little bit further, It seems that the JSON file produced by the colab notebook may not be 100% correct. So far I’ve had to:

  1. Change the “audio” > “quality” value from the name of the dataset to (in my case) “high”
  2. Added a complete “language” block found from an appropriate voice found here.
  3. Change the “dataset” tag to lowercase and move to the end of the json
  4. Rename the files to use the lower case dataset name
  5. Copy the files to the /share/piper directory I created previously via samba
  6. Reboot the host (not just restart the addon and HA, use the “Reboot System” option.)

Not sure how much of those steps are actually required, but at that point the voicw shows up in the Home Assistant Voice Assistants area, but not in the piper addon.

Still looking for suggestions please.

And one more. Renaming the files to <dataset>.onnx and <dataset>.onnx.json lets the voice work for Voice Assistant. It still doesn’t show up under the piper addon settings, and I need to set it there for automations to use it.

Edit: sometimes it works, it seems… unreliable

Edit 2: OK, seems “high” quality is a little too much for the Blue, the stock ones have issues too. Looks like I’ll be doing some retraining.

Further findings:

If I screw up the JSON file (typo’d the json in the Medium quality update) piper refuses to start, so it is reading the JSON on startup.

If I specify the voice name in YAML, piper will use it. e.g.

          - service: tts.speak
            metadata: {}
            data:
              cache: true
              media_player_entity_id: "{{ prev_speaker }}"
              message: "{{ state_attr(prev_speaker, 'friendly_name') + ' ' +  tts_text }}"
              options:
                voice: mycustomvoice
            target:
              entity_id: "{{ tts_service }}"

Where tts_service is a parameter (this is hacked together in a blueprint) that is set to Piper.

If I try to set the piper config in YAML with either the “<dataset>” language name or “en_US-dataset-medium” name I get an error with a list of languages I can specify which doesn’t include my custom file.

So, I can use the language in Voice Assistant, I can use it in YAML if I specify it, but I can’t select it as the default voice for piper because I can’t make it appear in the acceptable language list.

Can anyone help me with this? I’'m sure I’m not the only person having this issue.