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

OC_BuiltinPythonArray length: unrecognized selector sent to instance #55

Open
SimasJan opened this issue Jun 10, 2019 · 4 comments
Open

Comments

@SimasJan
Copy link

SimasJan commented Jun 10, 2019

I run pyttsx3 library on Python 3.6.7, Mac OS Mojave. Had no problem whatsoever with the library thus far until today. I had a list array with 3 string values in it, and passed it to a function which performs a standard engine.say() and engine.runAndWait() commands, however it returns a following error:

2019-06-10 16:59:26.960 Python[53190:3191407] -[OC_BuiltinPythonArray length]: unrecognized selector sent to instance 0x7fdcb0dd89d0

the function that perform the text-to-speech:
def speakThisOut(text_to_say): engine.say(text_to_say) return engine.runAndWait()

An array that has been passed as argument to the function for the engine to speak:
options = ['Employed', 'Student', 'Self Employed']

Calling the function:
speakThisOut(options)

Apologies, if I missed somewhere on the documentation where it states that lists (i.e. arrays) are not supported. Has anyone faced the same/similar problem? Any ideas how to address it? Thank you.

@arundhiman86
Copy link

arundhiman86 commented Jun 14, 2020

I am facing similar kind of issue not sure what is the problem.

2020-06-14 22:25:46.311 python[43458:872575] -[OC_BuiltinPythonNumber length]: unrecognized selector sent to instance 0x7fa4c015b900

I am using pyttsx3 library on Python 3.7.6, Mac OS Mojave.

I am passing an integer for the engine to speak:

def speak(text):
engine.say(text)
engine.runAndWait()

year = int(datetime.datetime.now().year)
speak(year)

@SimasJan, are you able to get find the answer to it?

@arundhiman86
Copy link

My bad, I was passing integer to the speak function. Ideally I should have converted into string and pass to it. That's how it worked.

Solution:-

def speak(text):
engine.say(text)
engine.runAndWait()

year = str(datetime.datetime.now().year)
speak(year)

@coling-git
Copy link

I am facing the same issue.

Using pyttsx3 library with python 3.8.5 on MacOS Big Sur. Here is my error and code.

2021-08-30 14:51:47.400 python[28231:1938050] -[OC_BuiltinPythonNumber _fastCStringContents:]: unrecognized selector sent to instance 0x7fb4da5eb9e0

engine = pyttsx3.init() 
engine.setProperty('rate', 100)
engine.say(str(self.Message))
engine.runAndWait()

@PabloIrobot
Copy link

year = str(datetime.datetime.now().year)
month = str(datetime.datetime.now().month)
date = str(datetime.datetime.now().day)

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

4 participants