Piper custom voice model not working

I’m trying to get the Glados voice model working through piper in HAOS.
I’m using the piper addon.
I placed the onnx and onnx.json file in /share/piper/ (had to create that folder first), as suggested in the documentation page of the piper addon.
While I can’t see the new voice model in the configuration page of the piper addon, I can select it when configuring my voice assist pipeline.
However when I try to play test sample I get an error:

This is the log of the Piper Addon.

DEBUG:wyoming_piper.handler:Synthesize(text='Hello. This is a test', voice=SynthesizeVoice(name='glados', language=None, speaker=None))
DEBUG:wyoming_piper.handler:synthesize: raw_text=Hello. This is a test, text='Hello. This is a test.'
DEBUG:wyoming_piper.process:Starting process for: glados (2/2)
DEBUG:wyoming_piper.process:Starting piper process: /usr/share/piper/piper args=['--model', '/share/piper/glados.onnx', '--config', '/share/piper/glados.onnx.json', '--output_dir', '/tmp/tmp_nnyeiwz', '--json-input', '--noise-scale', '0.667', '--length-scale', '1.0', '--noise-w', '0.333']
DEBUG:wyoming_piper.handler:input: {'text': 'Hello. This is a test.'}
DEBUG:wyoming_piper.handler:
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='wyoming event handler' coro=<AsyncEventHandler.run() done, defined at /usr/local/lib/python3.11/dist-packages/wyoming/server.py:31> exception=FileNotFoundError(2, 'No such file or directory')>
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/dist-packages/wyoming/server.py", line 41, in run
    if not (await self.handle_event(event)):
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/wyoming_piper/handler.py", line 53, in handle_event
    raise err
  File "/usr/local/lib/python3.11/dist-packages/wyoming_piper/handler.py", line 48, in handle_event
    return await self._handle_event(event)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/wyoming_piper/handler.py", line 108, in _handle_event
    wav_file: wave.Wave_read = wave.open(output_path, "rb")
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/wave.py", line 630, in open
    return Wave_read(f)
           ^^^^^^^^^^^^
  File "/usr/lib/python3.11/wave.py", line 280, in __init__
    f = builtins.open(f, 'rb')
        ^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: ''

Am I missing some documentation? Am I doing something wrong? I’m a noob, so any help is appreciated!

Hi nikscha,

Where did you create this?

You will likely need to use something like the samba addon to open the /share folder, and create a /piper folder under that for the onnx files…

Custom Voices
Add custom voice files to the /share/piper directory. Each custom voice must include a model file (<voice>.onnx) and config file (<voice>.onnx.json).

Don’t forget to restart the Piper add-on after this so it reads the new file.

I used the terminal add-on, then wget the onnx files into /share/piper/

I did restart Piper after this, and when it didn’t work I also rebooted the pi, but still no luck.

That sounds good and looks right to me but I’m no expert. I was just thinking it was an easy thing to get wrong if you are not used to 'nix stuff.

Damn I’m stupid. Turns out when you do wget https://github.com/dnhkng/GlaDOS/blob/99fbf5e182ed2c60e075bd1241d67f68f6833b8e/models/glados.onnx, it downloads the html file, not the intended file. It’s so obvious in hindsight… :face_with_open_eyes_and_hand_over_mouth:
I ended up using the samba addon, thank you for the suggestion. Everything works now!

1 Like

Hello all! Great information.

I have used the GLaDOSTTS repo which shows up just fine when I choose to select GLaDOSTTS for the text-to-voice. However, after adding the onnx files to /share/piper and rebooting I still am not presented with any voice choices.

I have verified the onnx files are valid and I have enabled debug on piper. But I see no warnings, errors or any attempts to read these files.

Any suggestions on what to check?

Seems like it’s working under Piper now. But the only choices I have for voice to select is “GLaDOS (llama)”. I’ve not lost all the other voices that were there before.

Seems like good documentation would be very helpful there. :wink:

I have the same did you find a fix?

I’m having the exact same issue. I can get GLaDOS’s voice to work as a response to Voice Assist, but since I can’t select that voice in the Piper Addon configuration, other tools (Such as ChimeTTS) that call Piper directly won’t use the new voice.