GithubHelp home page GithubHelp logo

gooofy / py-espeak-ng Goto Github PK

View Code? Open in Web Editor NEW
37.0 5.0 6.0 19 KB

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

Makefile 4.07% Python 95.93%
espeak-ng python tts-engines tts tts-api espeak

py-espeak-ng's People

Contributors

gooofy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

py-espeak-ng's Issues

brew install on Mac installs espeak binary instead of espeak-ng

cmd = ['espeak-ng',

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:

  1. Traverse to the code where cmd is hard coded to espeak-ng
$ 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 *
  1. Edit it to espeak

  2. Brew installed espeak

$ which espeak 
/usr/local/bin/espeak

Please distribute tests and license on pypi archive

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.

esng.g2p -> voice does not exist

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',

No Speech

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"
}
}

Add tags to github repo

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.

Something wrong with non-en languages on win 10

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?

OSError: [Errno 2] No such file or directory

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.

a bytes-like object is required, not 'str'

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'

ImportError: cannot import name 'ESpeakNG' from 'espeakng'

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.