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

use espeak cmd instead of espeak-ng on macOS #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hyansuper
Copy link

I made 3 changes in Line#35, Line#48 and Line#110~#126.
other changes are white space auto trimmed by my sublime-text, please ignore

speed = 175, # approx. words per minute
voice = 'english-us'):
speed = 175, # approx. words per minute
voice = 'en'):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's no voice named 'english-us' by espeak-ng default installation, you can set it to 'en' or 'en-us'

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not change indentation. If voice names have changed, I guess we need to update tests as well.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are no indentations changed, only some white space trimmed at line end


def _espeak_exe(self, args, sync=False):
cmd = ['espeak-ng',
cmd = ['espeak' if platform.system()=='Darwin' else 'espeak-ng',
Copy link
Author

@hyansuper hyansuper Jan 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I searched in https://brew.sh/ and found espeak, but no espeak-ng, I guess you can only brew install espeak.
They seem to have some problems unresolved with espeak-ng on mac espeak-ng/espeak-ng#12.
I hope this will solve #1 , but I don't have a mac to confirm . I tested it on Ubuntu18 and Win10
I have a little robot project, it's tts function depends on py-espeak-ng. I hope it support all platforms

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a hack to me. We could look into auto-detecting the availability of first espeak-ng and, as a fallback espeak on a system and use the best available option.

@@ -102,11 +103,11 @@ def say(self, txt, sync=False):

return self._espeak_exe(args, sync=sync)

def synth_wav(self, txt, fmt='txt'):
def synth_wav(self, txt, file=None, fmt='txt'):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a option to save to a non-temp file

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lacks implementation, doesn't it?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

implemented in line#110

@hyansuper
Copy link
Author

hyansuper commented Jan 30, 2021

Thanks for your review, I realize it's not the best solution to switch from espeak-ng to espeak on mac, since espeak is no longer developed on. but you get my point.
Feel free to close this PR if you don't like it. I hacked it for my project, since it's only one init.py file

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

Successfully merging this pull request may close these issues.

None yet

2 participants