I have installed python3.9.
I try to build a python script for speechRecognition.
I installed
pip install SpeechRecognition
brew install audioport
pip3 install pyaudio
Then copy an paste from a copple of examples: I.G.
#!/usr/bin/env python3
NOTE: this example requires PyAudio because it uses the Microphone class
import speech_recognition as sr
obtain audio from the microphone
r = sr.Recognizer()
with sr.Microphone() as source:
print("Say something!")
audio = r.listen(source)
and so on.
What i get all time is an error. Most like:
||PaMacCore (AUHAL)|| Error on line 1277: err='-66748', msg=Unknown ErrorTraceback (most recent call last): File "/Users/horst/VisualStudioCodeWork/Python_Projects/Amelie_03/SpeechRecognition.py", line 9, in module with sr.Microphone() as source: File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/speech_recognition/__init__.py", line 87, in __enter__ self.stream = self.audio.open( File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pyaudio.py", line 750, in open stream = Stream(self, *args, kwargs) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pyaudio.py", line 441, in __init__ self._stream = pa.open(arguments)OSError: [Errno -9986] Internal PortAudio error
I have googled so many time. Reinstall, and install. Follow all tips. Finally i have no idea more.
Is there anybody can help?
Thanks in advanced.
P.S. On Linux all works fine. Why not on mac?
Topic:
App & System Services
SubTopic:
Core OS
Tags: