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

Segfault on Ubuntu 10.10, 11.04 #3

Closed
mrmekon opened this issue May 5, 2011 · 9 comments
Closed

Segfault on Ubuntu 10.10, 11.04 #3

mrmekon opened this issue May 5, 2011 · 9 comments

Comments

@mrmekon
Copy link

mrmekon commented May 5, 2011

Situation:

import pyttsx
pyttsx.init()
Segmentation fault

Cause:
In pyttsx/drivers/espeak.py, in init(), self.getProperty('voice') results in a call to GetCurrentVoice() in _espeak.py, which calls espeak_GetCurrentVoice() in libespeak.so.1. libespeak is returning a valid result with an empty name. EspeakDriver._defaultVoice gets set to None. A subsequent call to self.setProperty() references the None value, and causes a segmentation fault.

Possible solution:
I know nothing of espeak or its API. Mine works, but does not return a 'current voice'. This solved the problem on my machine:

Replace line 37 of espeak.py:

EspeakDriver._defaultVoice = self.getProperty('voice')

With this block:

EspeakDriver._defaultVoice = self.getProperty('voice')
if EspeakDriver._defaultVoice == None:
    EspeakDriver._defaultVoice = "en"

This just defaults to english if espeak doesn't return a voice. Text-to-speech works as expected after this modification.

Version information:
Ubuntu Server 10.10
Python 2.7
pyttsx-1.0
libespeak1 version 1.44.05~really-1.44.04-0ubuntu1

@rodrigob
Copy link

Same problem in Ubuntu 11.04. Would be nice the have this patched and feed into pypi

@parente
Copy link
Collaborator

parente commented May 20, 2011

Forgot this was open. Will merge fix soon.

@rodrigob
Copy link

the posted fix did not work on my Ubuntu 11.04

@parente
Copy link
Collaborator

parente commented May 21, 2011

@rodrigob the fix I just committed seems to get pyttsx working for me on Natty. Let me know if it works for you.

I do get a large batch of ALSA/Jack errors when espeak initializes, but it happens whether I'm using pyttsx or the espeak command line program directly. I think it's a consequence of running in VMWare Fusion.

@rodrigob
Copy link

rodrigob commented Jun 3, 2011

the test now runs fine on my Natty machine. Thanks for the fix !

pyttsx_git/tests/manual$ python run.py

@brousch
Copy link

brousch commented Jun 14, 2012

Can you upload this fixed version to PyPi?

@juanantoniofm
Copy link

Same problem on debian 6.
espeak = version 1.46

@parente
Copy link
Collaborator

parente commented Dec 30, 2012

v1.1 with this fix pushed to pypi (finally).

@marcobaturan
Copy link

marcobaturan commented Sep 1, 2016

Hi!
I try use a module Chatterbot mixed with Pyttsx for do it speak the chaterbot, but the loop While cut de pronunciation of word chains, example: chatbot write: hello, computer only say "he". The example block code is:

# chatbot empiieza' while True: speak = raw_input('- ') response = chatbot.get_response(speak) # dice la respuesta print response engine.say(response) # mantiene el TTS enn marcha engine.runAndWait()`

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

No branches or pull requests

6 participants