simonw / ospeak

CLI tool for running text through OpenAI Text to speech
Apache License 2.0
162 stars 10 forks source link

Terminates with SIGSEGV #4

Open jsmits opened 12 months ago

jsmits commented 12 months ago

Just tried it using ffmpeg. It does speak, but then it terminates with a SIGSEGV. I use fish, but got the same thing with bash.

$ ospeak "Hello"
fish: Job 1, 'ospeak "Hello"' terminated by signal SIGSEGV (Address boundary error)

M1 Macbook Pro | macOS Sonoma 14.1 pipx | ffmpeg (both installed with homebrew)

tspng commented 12 months ago

I had a similar issue, but on my system the command terminated in a segfault.

$ ospeak -v echo 'Hello'
zsh: segmentation fault  ospeak -v echo 'Hello'

This is on a M1 Pro SOC running Sonoma 14.1. I installed ospeak with pipx using Python 3.12.0.

Saving to a file works without a segfault, only speaking is affected. ffmpeg and pydub's speak by themselves work fine.

I could workaround my segfault issue by installing ospeak with pipx and Python 3.11.6.

[EDIT]: SIGSEGV is the segfault signal obviously ;)

jsmits commented 12 months ago

Indeed. Tried it with Python 3.11.4. Then my SIGSEGV error is gone as well.

tspng commented 12 months ago

I ran it with faulthandler enabled to get the traceback and it looks like pysimpleaudio, a dependency of pydub, is the problem.

It says that this project is archived and not maintained anymore. So I guess, there is not much to fix but maybe a note in the Readme.

Traceback

Fatal Python error: Segmentation fault

Thread 0x00000001e3425ec0 (most recent call first):
  File "/Users/tspng/code/3rd-party/ospeak/venv/lib/python3.12/site-packages/simpleaudio/shiny.py", line 50 in wait_done
  File "/Users/tspng/code/3rd-party/ospeak/venv/lib/python3.12/site-packages/pydub/playback.py", line 55 in play
  File "/Users/tspng/code/3rd-party/ospeak/ospeak/cli.py", line 26 in stream_and_play
  File "/Users/tspng/code/3rd-party/ospeak/ospeak/cli.py", line 84 in cli
  File "/Users/tspng/code/3rd-party/ospeak/venv/lib/python3.12/site-packages/click/core.py", line 783 in invoke
  File "/Users/tspng/code/3rd-party/ospeak/venv/lib/python3.12/site-packages/click/core.py", line 1434 in invoke
  File "/Users/tspng/code/3rd-party/ospeak/venv/lib/python3.12/site-packages/click/core.py", line 1078 in main
  File "/Users/tspng/code/3rd-party/ospeak/venv/lib/python3.12/site-packages/click/core.py", line 1157 in __call__
  File "/Users/tspng/code/3rd-party/ospeak/ospeak/__main__.py", line 4 in <module>
  File "<frozen runpy>", line 88 in _run_code
  File "<frozen runpy>", line 198 in _run_module_as_main

Extension modules: simpleaudio._simpleaudio (total: 1)
zsh: segmentation fault  python -X faulthandler -m ospeak 'Hello'
doomuch commented 12 months ago

just run into the same issue! thank you for the solution @tspng

i deleted the package with pipx uninstall and reinstalled for python 3.11 with pipx install --python /path/to/python ospeak

now it works