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

playbin.props.uri ... AttributeError: 'NoneType' object has no attribute 'props' #2074

Closed
charltonh opened this issue Apr 17, 2023 · 7 comments
Labels
bug Something isn't working Stale

Comments

@charltonh
Copy link

Using the --speak flag breaks the script even with all the requirements.
Not sure if this is a bug on linux or perhaps a simple python setup issue,
but after some time I haven't been able to fix it.
Anyone have any ideas?
(note the "Response content: b'{"detail":"Not Found"}' " in the beginning too)

(Auto-GPT) oberon /home/charlton/Auto-GPT [84]>run.sh --debug --speak
All packages are installed.
Debug Mode:  ENABLED
Speak Mode:  ENABLED
Welcome back!  Would you like Request failed with status code: 404
Response content: b'{"detail":"Not Found"}'
me to return to being PostmanAI?
Continue with the last settings?
Name:  PostmanAI
Role:  An AI designed to improve my linux mail server setup and filter spam more efficiently.
Goals: ['Engineer a spam-filtering solution that works with postfix and procmail, using AI or other modern tools available on linux.', 'Provide a configuration for my mutt mail client to be able to train spam vs ham messages']
Continue (y/n): Exception in thread Thread-1 (speak):
Traceback (most recent call last):
  File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "/home/charlton/Auto-GPT/autogpt/speech/say.py", line 36, in speak
    DEFAULT_VOICE_ENGINE.say(text)
  File "/home/charlton/Auto-GPT/autogpt/speech/base.py", line 33, in say
    return self._speech(text, voice_index)
  File "/home/charlton/Auto-GPT/autogpt/speech/gtts.py", line 19, in _speech
    playsound("speech.mp3", True)
  File "/home/charlton/Auto-GPT/lib/python3.10/site-packages/playsound.py", line 101, in _playsoundNix
    playbin.props.uri = 'file://' + pathname2url(os.path.abspath(sound))
AttributeError: 'NoneType' object has no attribute 'props'

@charltonh
Copy link
Author

This seems to be a common problem on linux with the python playsound.py module.
I was able to get around this by rewriting autogpt/speech/eleven_labs.py to this:

            # playsound("speech.mpeg", True)
            os.system('mpg123 -q speech.mpeg')

@taaha
Copy link

taaha commented Apr 17, 2023

Did what you did
image

It gave this error
sh: 1: mpg123: not found

@charltonh
Copy link
Author

charltonh commented Apr 17, 2023

Do a pip install mpg123 or otherwise install it on your system.

@taaha
Copy link

taaha commented Apr 17, 2023

My fault. Did following command

sudo apt-get install mpg123

It started working. Thanks

@ntindle ntindle added the bug Something isn't working label Apr 21, 2023
@frozen905
Copy link

I am having the dreaded NoneType 'props' problem here as well, I found this thread after posting about it here: TaylorSMarks/playsound#142

However I am not looking for alternative solutions just yet, is this not fixable in playsound itself? I have scripts already relying on it's function and it would be nice to have this working since many others use it as well

@github-actions
Copy link
Contributor

github-actions bot commented Sep 6, 2023

This issue has automatically been marked as stale because it has not had any activity in the last 50 days. You can unstale it by commenting or removing the label. Otherwise, this issue will be closed in 10 days.

@github-actions github-actions bot added the Stale label Sep 6, 2023
@github-actions
Copy link
Contributor

This issue was closed automatically because it has been stale for 10 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale
Projects
None yet
Development

No branches or pull requests

4 participants