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

wyoming_piper handler crashes when trying to synthesize any text - File not found #8

Open
mxmo0rhuhn opened this issue Dec 17, 2023 · 7 comments

Comments

@mxmo0rhuhn
Copy link

Hi all
Thanks a lot for the awesome TTS project! I really enjoy tinkering with it.
However, after several working texts yesterday. Piper suddenly stopped working within my Home Assistant installation. I restarted the add-on as well as Home Assistant but nothing seems to work

Versions:
Core: 2023.12.3
Supervisor: 2023.11.6
Operating System: 11.2
Frontend: 20231208.2
Piper Add-on version: 1.4.0

Service call:

service: tts.speak
data:
  media_player_entity_id: media_player.sonos_roam
  message: "Today is {{ now().strftime( '%B %d, %Y') }}"
target:
  entity_id: tts.piper

Output of the add-on:

DEBUG:wyoming_piper.handler:Synthesize(text='Today is December 17, 2023', voice=None)
DEBUG:wyoming_piper.handler:synthesize: raw_text=Today is December 17, 2023, text='Today is December 17, 2023.'
DEBUG:wyoming_piper.process:Starting process for: en_US-amy-medium (1/3)
DEBUG:wyoming_piper.download:Checking /data/en_US-amy-medium.onnx
DEBUG:wyoming_piper.download:Checking /data/en_US-amy-medium.onnx.json
DEBUG:wyoming_piper.process:Starting piper process: /usr/share/piper/piper args=['--model', '/data/en_US-amy-medium.onnx', '--config', '/data/en_US-amy-medium.onnx.json', '--output_dir', '/tmp/tmp74pljzel', '--json-input', '--noise-scale', '0.667', '--length-scale', '1.0', '--noise-w', '0.333']
DEBUG:wyoming_piper.handler:input: {'text': 'Today is December 17, 2023.'}
DEBUG:wyoming_piper.handler:
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-531' coro=<AsyncEventHandler.run() done, defined at /usr/local/lib/python3.11/dist-packages/wyoming/server.py:28> 

packages/wyoming/server.py:28> 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 35, in run
    if not (await self.handle_event(event)):
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/wyoming_piper/handler.py", line 98, 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: ''
@mxmo0rhuhn mxmo0rhuhn changed the title Crashes when trying to sythesize any text wyoming_piper handler crashes when trying to synthesize any text - File not found Dec 17, 2023
@1848
Copy link

1848 commented Dec 20, 2023

Same problem here.
Tried the master and the v1.4.0 branch.

@1848
Copy link

1848 commented Dec 20, 2023

Found the issue. If you print out stderr from the piper call you will find
piper: error: unrecognized arguments: --json-input

I am using the python version of piper by the way: piper-tts

EDIT:
Using the cpp version for now, works fine here.

@baudneo
Copy link

baudneo commented Jan 8, 2024

I am getting this error when using a custom built piper. Not sure how to get the piper binary logs to print to stdout.

@llluis
Copy link

llluis commented Feb 5, 2024

I am getting this error when using a custom built piper. Not sure how to get the piper binary logs to print to stdout.

Try what I described here #7 to see if solves your problem.

@llluis
Copy link

llluis commented Feb 5, 2024

Found the issue. If you print out stderr from the piper call you will find piper: error: unrecognized arguments: --json-input

I am using the python version of piper by the way: piper-tts

EDIT: Using the cpp version for now, works fine here.

Not sure what you mean by cpp and python version, but I have the --json-input and everything is working (Piper Add-on).

@llluis
Copy link

llluis commented Feb 5, 2024

Hi all Thanks a lot for the awesome TTS project! I really enjoy tinkering with it. However, after several working texts yesterday. Piper suddenly stopped working within my Home Assistant installation. I restarted the add-on as well as Home Assistant but nothing seems to work

Piper is crashing when writing the resulting audio wav file, so the instruction to open it to continue is failing.
You mention it was working. Anything changed? Missing space in disk, permissions, etc?

@mxmo0rhuhn
Copy link
Author

Anything changed? Missing space in disk, permissions, etc?

Unfortunately I did not change anything. I restarted the add-on & the HA server a few times but this did neither result in a consistent result nor a better situation

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

4 participants