lokesh v  sanjit
lokesh v sanjit

Reputation: 11

speech recognition in PyCharm on Mac missing PyAudio

#raise AttributeError("Could not find PyAudio; check installation")

# AttributeError: Could not find PyAudio; check installation

# I have tried every type of pip or sudo type of commands but its # not working it just says PyAudio is missing

import speech_recognition as sr

# get audio from the microphone
r = sr.Recognizer()
with sr.Microphone() as source:
    print("Speak:")
    audio = r.listen(source)

try:
    print("You said " + r.recognize_google(audio))
except sr.UnknownValueError:
    print("Could not understand audio")
except sr.RequestError as e:
    print("Could not request results; {0}".format(e))

Upvotes: 0

Views: 2015

Answers (2)

Suyash Agarwal
Suyash Agarwal

Reputation: 1

You can directly install the PyAudio Wheel from here

For more info on using speech recognition with python you can check out this

Upvotes: 0

Nv7
Nv7

Reputation: 426

You may need to get some additional packages, based off of operating system.

Debian Linux

If you don't have Homebrew (brew), download the it here.

$ brew install portaudio
$ pip install pyaudio

MacOS

If you don't have Homebrew (brew), download the it here.

$ brew install portaudio
$ pip install pyaudio

Windows

$ pip install pyaudio

I found this answer here.

Upvotes: 3

Related Questions