2021-03-17 05:14:39

hello, So I just installed linux and whent and tried installing python-espeak via pip, However i get an error, Here's the log
Collecting python-espeak
  Using cached python-espeak-0.6.3.tar.gz (9.1 kB)
Building wheels for collected packages: python-espeak
  Building wheel for python-espeak (setup.py) ... [?25l- \ | error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-zye_kb44/python-espeak/setup.py'"'"'; __file__='"'"'/tmp/pip-install-zye_kb44/python-espeak/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-0_wp733p
       cwd: /tmp/pip-install-zye_kb44/python-espeak/
  Complete output (17 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.8
  creating build/lib.linux-x86_64-3.8/espeak
  copying espeak/__init__.py -> build/lib.linux-x86_64-3.8/espeak
  running build_ext
  building 'espeak.core' extension
  creating build/temp.linux-x86_64-3.8
  creating build/temp.linux-x86_64-3.8/espeak
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.8 -c espeak/espeakmodulecore.cpp -o build/temp.linux-x86_64-3.8/espeak/espeakmodulecore.o
  espeak/espeakmodulecore.cpp:23:10: fatal error: espeak/speak_lib.h: No such file or directory
     23 | #include <espeak/speak_lib.h>
        |          ^~~~~~~~~~~~~~~~~~~~
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for python-espeak
[?25h  Running setup.py clean for python-espeak
Failed to build python-espeak
Installing collected packages: python-espeak
    Running setup.py install for python-espeak ... [?25l- \ | error
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-zye_kb44/python-espeak/setup.py'"'"'; __file__='"'"'/tmp/pip-install-zye_kb44/python-espeak/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-5yd68ny3/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/mohamed/.local/include/python3.8/python-espeak
         cwd: /tmp/pip-install-zye_kb44/python-espeak/
    Complete output (17 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.8
    creating build/lib.linux-x86_64-3.8/espeak
    copying espeak/__init__.py -> build/lib.linux-x86_64-3.8/espeak
    running build_ext
    building 'espeak.core' extension
    creating build/temp.linux-x86_64-3.8
    creating build/temp.linux-x86_64-3.8/espeak
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.8 -c espeak/espeakmodulecore.cpp -o build/temp.linux-x86_64-3.8/espeak/espeakmodulecore.o
    espeak/espeakmodulecore.cpp:23:10: fatal error: espeak/speak_lib.h: No such file or directory
       23 | #include <espeak/speak_lib.h>
          |          ^~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    -------

2021-03-17 05:49:08

Probably apt install espeak-dev, or something to that effect depending on your distro, if I had to guess.

My Blog
Twitter: @ajhicks1992

2021-03-17 05:50:10

That said, it's worth knowing that Espeak is gpl and if you're wanting to embed it in closed-source software you can't, so this may be a moot discussion if you didn't realize.

My Blog
Twitter: @ajhicks1992

2021-03-17 09:18:47

oh damn, So is there a way to send speech to orca directly in python like NVDA?

2021-03-17 15:49:09

You talk to speech-dispatcher, I believe.  Tolk might be able to do it.  If not, someone else around here will know.

My Blog
Twitter: @ajhicks1992

2021-03-17 17:57:38

it seems that tolk can't do it, Because i tried building cytolk on it and it errors and also it uses nvda dll's anyway, So well... I guess I'll need to find someone that knows how to do it, There should be a way hopefully

2021-03-17 19:27:44

Um, no. Tolk is heavily VC++, and doesn't compile under anything aside from Windows.  It's annoying, but what can you do?

AFAIK you can script Orca like NVDA, but I don't think it has a controller. You probably wouldn't want to anyways, Orca's been broken for quite a while now. The primary developer now just keeps putting in user specific hacks that end up breaking everything else.

2021-03-18 13:04:56

yeah, you can talk to speech dispatcher directly, in fakt this is what pyttsx does, and it does it very well. I have been trying to replicate it with .net, namely .net core, with no apparent success, speech is really broken. I have to consult the documentation on the protocol I have to use to send it output through the socket. But for python, download a copy of pyttsx3, then look in the drivers folder, there you'll find sappi, some things for voice over, plane eSpeak, and finally speech dispatcher. You can take inspiration from what you have there, how it should send stuff to speech_dispatcher, etc. Btw, does someone here understand the protocol we have to use in communicating with the speechd server, because I surely don't.

2021-03-18 17:14:36 (edited by mohamed 2021-03-18 17:15:24)

woo, That... Was easier than what I expected, but now I have a problem that doesn't relate to this topic, Sound_lib doesn't want to load/play sounds for some reasons, I guess that people loves fucking up paths as useual, Well now time to find a way to let it work i guess, But still impressed about how easy is it to get speech setuped.