Forums

Pyaudio

I'm trying to install pyaudio and it fails with the following error:

Failed building wheel for pyaudio Failed to build pyaudio Installing collected packages: pyaudio Running setup.py install for pyaudio Complete output from command /home/mykl/.virtualenvs/django18/bin/python2.7 -c "import setuptools, tokenize;file='/tmp/pip-build-_usnn9/p yaudio/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/p ip-FYraIB-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/mykl/.virtualenvs/django18/include/site /python2.7/pyaudio: running install running build running build_py running build_ext building '_portaudio' extension x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c src/_p ortaudiomodule.c -o build/temp.linux-x86_64-2.7/src/_portaudiomodule.o src/_portaudiomodule.c:29:23: fatal error: portaudio.h: No such file or directory #include "portaudio.h" ^ compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

I tried installing portaudio, but pip can't find it. Any ideas?

I can't really see any point to installing pyaudio on PythonAnywhere. There is not audio hardware on PythonAnywhere, so I think the library would be useless.

I think pyaudio is for using a local microphone not server

Then you should install it locally, not on PythonAnywhere.

That makes no sense. pyaudio needs to be installed on the server to use the local microphone to accept input to the website.

Probably an installation issue within PythonAnywhere, the site server might not have given the installation the correct privileges to create a folder with some the files you are missing currently. Just hazarding a guess.

Portaudio is not a python package. Looking at its docs, you can try to compile it yourself before pip installing pyaudio.

While we allow you to pip install python packages, you won't have the permissions to apt-get install libasound-dev, which is optional for the portaudio install.

Thanks for the input. I'm trying to use the Python Speech Recognition app https://pypi.python.org/pypi/SpeechRecognition/ to allow voice input through the Microphone. The install instructions to use the microphone are:

PyAudio (for microphone users)

If you want to use audio input from microphones, PyAudio is also necessary. If not installed, the library will still work, but Microphone will not be defined.

On Windows, install PyAudio using Pip: pip install pyaudio. On Debian and Debian-based Linux distributions like Ubuntu, install PyAudio using APT: execute sudo apt-get install python-pyaudio python3-pyaudio in a terminal, which will install PyAudio for both Python 2 and Python 3. On OS X, install PortAudio using Homebrew: brew install portaudio. Then, install PyAudio using Pip: pip install pyaudio. On other POSIX-based systems, install the portaudio19-dev and python-all-dev using a package manager of your choice, and then install PyAudio using Pip: pip install pyaudio.

Does anyone know how to install pyaudio?

If I switch to paid account, will I be able to install apt-get install libasound-dev?

No. You can't install libasound-dev, whether you have a paying account, or not.

It doesn't make sense to install pyaudio on PAW. You can't record sound on a server (unless you have a very long microphone cord).

What you want to try is recording the sound locally and then streaming it to a server. You can still use whatever software to analyse that sound on the server, and then send the response back.

The other thing to understand is that the Python Speech Recognition app does not actually do speech recognition. It just streams the data to IBM, Google, or AT&T, as the case may be.

You are probably better off deciding on the service you want to use and just using it directly from your local app. That saves the step of going thru PAW, which won't gain you anything but extra overhead.

The purpose isn't for me to use my microphone, it's for people accessing my site to use their microphones to voice input data. Which will be transcribed via Python Speech Recognition. That's the reason for using I wanted to use pyaudio.

mykl: you're doing this the wrong way.

Upload the wav file to PythonAnywhere, and then send it to the Google speech recognition engine. (Which is free)

You then get back beautifully trascribed text.

This can be done on a server, as I have done it on Amazon Workspaces. Python Anywhere would have to install the virtual audio devices, as well as upgrade the web client to handle audio from a client's microphone.

An, admittedly brief, look at virtual audio devices suggests that it's probably not something we're going to be able to do effectively on PythonAnywhere.

Please!! I need help about how install pyaudio in pythonanywhere or in console bash

Thank you..

See the rest of this thread about why that does not work and would be pointless if it did.