Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VoiceNotFoundError ? #7

Open
ignacio82 opened this issue Dec 16, 2023 · 2 comments
Open

VoiceNotFoundError ? #7

ignacio82 opened this issue Dec 16, 2023 · 2 comments

Comments

@ignacio82
Copy link

I'm trying to add a voice to piper and encountering an error. I added to voice to the folder that is mounted in /data but when I look at the log of my container I see the following:

INFO:__main__:Ready
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-9' coro=<AsyncEventHandler.run() done, defined at /usr/local/lib/python3.9/dist-packages/wyoming/server.py:28> exception=VoiceNotFoundError('ignacio')>
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/wyoming/server.py", line 35, in run
    if not (await self.handle_event(event)):
  File "/usr/local/lib/python3.9/dist-packages/wyoming_piper/handler.py", line 73, in handle_event
    piper_proc = await self.process_manager.get_process(voice_name=voice_name)
  File "/usr/local/lib/python3.9/dist-packages/wyoming_piper/process.py", line 114, in get_process
    ensure_voice_exists(
  File "/usr/local/lib/python3.9/dist-packages/wyoming_piper/download.py", line 77, in ensure_voice_exists
    find_voice(name, data_dirs)
  File "/usr/local/lib/python3.9/dist-packages/wyoming_piper/download.py", line 183, in find_voice
    raise VoiceNotFoundError(name)
wyoming_piper.download.VoiceNotFoundError: ignacio
INFO:wyoming_piper.download:Downloaded /data/en_US-hfc_male-medium.onnx.json (https://huggingface.co/rhasspy/piper-voices/resolve/v1.0.0/en/en_US/hfc_male/medium/en_US-hfc_male-medium.onnx.json)
INFO:wyoming_piper.download:Downloaded /data/en_US-hfc_male-medium.onnx (https://huggingface.co/rhasspy/piper-voices/resolve/v1.0.0/en/en_US/hfc_male/medium/en_US-hfc_male-medium.onnx)
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-23' coro=<AsyncEventHandler.run() done, defined at /usr/local/lib/python3.9/dist-packages/wyoming/server.py:28> exception=VoiceNotFoundError('ignacio')>
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/wyoming/server.py", line 35, in run
    if not (await self.handle_event(event)):
  File "/usr/local/lib/python3.9/dist-packages/wyoming_piper/handler.py", line 73, in handle_event
    piper_proc = await self.process_manager.get_process(voice_name=voice_name)
  File "/usr/local/lib/python3.9/dist-packages/wyoming_piper/process.py", line 114, in get_process
    ensure_voice_exists(
  File "/usr/local/lib/python3.9/dist-packages/wyoming_piper/download.py", line 77, in ensure_voice_exists
    find_voice(name, data_dirs)
  File "/usr/local/lib/python3.9/dist-packages/wyoming_piper/download.py", line 183, in find_voice
    raise VoiceNotFoundError(name)
wyoming_piper.download.VoiceNotFoundError: ignacio
INFO:__main__:Ready
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-6' coro=<AsyncEventHandler.run() done, defined at /usr/local/lib/python3.9/dist-packages/wyoming/server.py:28> exception=VoiceNotFoundError('ignacio')>
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/wyoming/server.py", line 35, in run
    if not (await self.handle_event(event)):
  File "/usr/local/lib/python3.9/dist-packages/wyoming_piper/handler.py", line 73, in handle_event
    piper_proc = await self.process_manager.get_process(voice_name=voice_name)
  File "/usr/local/lib/python3.9/dist-packages/wyoming_piper/process.py", line 114, in get_process
    ensure_voice_exists(
  File "/usr/local/lib/python3.9/dist-packages/wyoming_piper/download.py", line 77, in ensure_voice_exists
    find_voice(name, data_dirs)
  File "/usr/local/lib/python3.9/dist-packages/wyoming_piper/download.py", line 183, in find_voice
    raise VoiceNotFoundError(name)
wyoming_piper.download.VoiceNotFoundError: ignacio
INFO:__main__:Ready

Could you point me in the right direction?

@llluis
Copy link

llluis commented Feb 5, 2024

I troubleshoot this today and found a solution.

You have to put the onnx and json files in the /share/piper directory in your Home Assistant, as per the documentation.
The name of the file / voice can be as you want, however, the json must have the same name (including the .onnx) but with the suffix json:

- llluis.onnx
- llluis.onnx.json

(you can replace llluis by whatever you want)

Then, you must make sure that the tag dataset inside the json must have the same name. In my example:

    "dataset": "llluis",

(I didn't pay much attention when training my model as I was just testing the whole thing. I had the value piper in this which must be some config I didn't set during training)

Also, make sure the language tag is as follow:

    "language": {
        "code": "pt_BR"
    },

(with whatever is the code for the language you want)

Remember to restart the Piper Add-On and the Wyoming integration.
After that, the VoiceNotFound error shall disapear and you can use the new voice.

Using the tts.speak service, you just have to pass the voice as an option:

service: tts.speak
target:
  entity_id: tts.piper
data:
  cache: true
  media_player_entity_id: media_player.nabu1
  message: Test
  options:
    voice: llluis

image

@isirour
Copy link

isirour commented Sep 11, 2024

Hi all,

I am having the same issue. Running the docker in Synology DSM with command parameters "--voice en_US-lessac-medium", i get an error stating it is unable to download the voice and thus terminates.

Any idea why may this be happening?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants