gooofy / py-espeak-ng Goto Github PK
View Code? Open in Web Editor NEWSome simple wrappers around eSpeak NG intended to make using this excellent TTS for waveform and IPA generation as convenient as possible.
License: Apache License 2.0
Some simple wrappers around eSpeak NG intended to make using this excellent TTS for waveform and IPA generation as convenient as possible.
License: Apache License 2.0
py-espeak-ng/espeakng/__init__.py
Line 47 in 394826f
Earlier:
$ python talk2.py
Traceback (most recent call last):
File "talk2.py", line 4, in <module>
esng.say('Hello World!')
File "/Users/miyurz/.pyenv/versions/anaconda3-5.2.0/lib/python3.6/site-packages/espeakng/__init__.py", line 103, in say
self._espeak_exe(args, sync=sync)
File "/Users/miyurz/.pyenv/versions/anaconda3-5.2.0/lib/python3.6/site-packages/espeakng/__init__.py", line 68, in _espeak_exe
stderr=subprocess.STDOUT)
File "/Users/miyurz/.pyenv/versions/anaconda3-5.2.0/lib/python3.6/subprocess.py", line 709, in __init__
restore_signals, start_new_session)
File "/Users/miyurz/.pyenv/versions/anaconda3-5.2.0/lib/python3.6/subprocess.py", line 1344, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
__init__.py:47: cmd = ['espeak-ng',
FileNotFoundError: [Errno 2] No such file or directory: 'espeak-ng': 'espeak-ng'
Fix:
$ cd /Users/miyurz/.pyenv/versions/anaconda3-5.2.0/lib/python3.6/site-packages/espeakng/
✔ ~/.pyenv/versions/anaconda3-5.2.0/lib/python3.6/site-packages/espeakng
14:07 $ grep -nr espeak-ng *
Edit it to espeak
Brew installed espeak
$ which espeak
/usr/local/bin/espeak
Pypi package does not contain license which is bit required by the apache license.
Also if you could distribute tests we could validate version shipped in distributions (in this case openSUSE) because otherwise we have no easy way how to do sanity checking of python packages.
Simple MANIFEST.in file should do the trick.
I'm getting "The specified espeak-ng voice does not exist." on the IPA generation example.
$ espeak-ng --version
eSpeak NG text-to-speech: 1.50 Data at: /usr/lib/x86_64-linux-gnu/espeak-ng-data
In [63]: esng.voices
Out[63]:
[{'pty': '5',
'language': 'af',
'age': '--',
'gender': 'M',
'voice_name': 'Afrikaans',
'file': 'gmw/af'},
{'pty': '5',
'language': 'am',
'age': '--',
'gender': 'M',
'voice_name': 'Amharic',
'file': 'sem/am'},
{'pty': '5',
'language': 'an',
'age': '--',
'gender': 'M',
'voice_name': 'Aragonese',
'file': 'roa/an'},
{'pty': '5',
'language': 'ar',
'age': '--',
'gender': 'M',
'voice_name': 'Arabic',
'file': 'sem/ar'},
{'pty': '5',
'language': 'as',
I'm on Raspberry pi with 2020-05-27-raspios-buster-lite-armhf.img.
I'm trying to get speech to come through Bluealsa.
If I run 'espeak-ng "hello"' in terminal, I hear the speech on my bluetooth speaker.
If I play audio through pyaudio on Python, I also hear it on my bluetooth speaker.
However, if I run 'esng.say("Hello World!")', I hear no speech.
Instead, I get <callable_iterator object at 0xb649b650>.
Here's ~/.asound.
pcm.!default {
type plug
slave.pcm {
type bluealsa
device "11:aa:22:bb:33:cc"
profile "a2dp"
}
}
Line 8 in 0ebd527
This can be easily fixed by changing the line to README.adoc
, but I'm not sure if it's set this way for a reason? Is there some auto-generator script that converts the docs?
If there would be tags one could download the release archive from github and won't have to use pypi archive that is missing files wrt issue #3 .
Also it could ease you git blame/etc.
Hello,
Setup:
Windows 10
espeak-ng --version
eSpeak NG text-to-speech: 1.52-dev Data at: C:\Program Files\eSpeak NG/espeak-ng-data
espeak-ng --voices
...
5 ru --/M Russian zle\ru
2 ru-lv --/M Russian_(Latvia) zle\ru-LV
...
py-espeak-ng 0.1.8
https://pypi.org/project/py-espeak-ng/
Released: Mar 19, 2019
Issues:
First issue with espeak-ng:
espeak-ng -v ru 'привет' -x
(en)i:d'i:koU(ru)
But from file is Ok:
espeak-ng -v ru -f 'text.txt' -x
p@-r;iv;'et
The second trouble with py-espeak-ng in Python:
esng = ESpeakNG()
esng.voice = 'ru'
esng.say('Привет')
ipa = esng.g2p('Привет')
print("1--------------------> ipa: ", ipa)
with open('text.txt', 'r', encoding='UTF-8') as f:
t=f.readline()
esng.say(t)
ipa = esng.g2p(t)
print("2--------------------> text: ", t)
print("2--------------------> ipa: ", ipa)
esng.say('Privet')
ipa = esng.g2p('Privet')
print("3--------------------> ipa: ", ipa)
The result is:
1--------------------> ipa:
2--------------------> text: Привет
2--------------------> ipa:
3--------------------> ipa: (en)pr'IvI2t(ru)
And in 1 and 2 just no any sound.
Do you have any idea?
So i know this is the same as another issue, but the person that closed it and fixed the issue didnt explain in full how to fix the problem. What exactly do I have to do to fix it? (The person that previously had this problem mentioned something about installing another package?) Can someone please let me know as i cannot fix this.
How do I debug what's the error? Function just return and nothing is done.
every time I do esng.say() i get the error a bytes-like object is required, not 'str'.
I haven´t changed anything after i installied it via pip and just tried your hello World test.
Espeak-NG ist installed and working.
>>> esng.say('Hello World!')
Traceback (most recent call last):
File "<pyshell#8>", line 1, in <module>
esng.say('Hello World!')
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\espeakng\__init__.py", line 103, in say
return self._espeak_exe(args, sync=sync)
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\espeakng\__init__.py", line 68, in _espeak_exe
stderr=subprocess.STDOUT)
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\subprocess.py", line 709, in __init__
restore_signals, start_new_session)
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\subprocess.py", line 971, in _execute_child
args = list2cmdline(args)
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\subprocess.py", line 461, in list2cmdline
needquote = (" " in arg) or ("\t" in arg) or not arg
TypeError: a bytes-like object is required, not 'str'
When I try to run the basic demo code:
from espeakng import ESpeakNG
esng = ESpeakNG()
esng.say('Hello World!')
I get this error:
Traceback (most recent call last):
File "xxxxxxx.py", line 1, in <module>
from espeakng import ESpeakNG
ImportError: cannot import name 'ESpeakNG' from 'espeakng' (C:\Users\XXXXXX\AppData\Roaming\Python\Python37\site-packages\espeakng\__init__.py)
Any suggestions? If it matters, I'm on Windows 10, and I can access espeak-ng.exe from the regular command line, so it must be in PATH already. Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.