In this part we will be setting up the development for python. I’ll be setting up the environment for a Mac os-x. The given instructions can also be applied to Linux systems. Later as I will test in a window environment I will update the article and add windows specific instructions.
I suppose that python 2.xx is installed.
Please verify your python version:
This should result in version 2.xx in my case:
For code editing you can use any text editor that you are comfortable with. for my side I’ll prefer to use an IDE. I opted for Pycharm. There is a free community edition available here.
Installing voice recognition tools
the first step in this project is to install a speech to text system on the computer. I was expecting this step to be easy, as easy as running some kind of pip install instruction. But the reality is that this is far more complicated than it should be. The process outlined here could not work for everyone. that really depends on the actual version and on what else is installed in your PC.
There exist a package called speechRecognition that implement this functionality in Python. This package encapsulate this functionality form PortAudio.
PortAudio is a free, cross-platform, open-surce, audio I/O library written in ‘C’. PortAudio provides a simple API for recording and/or playing sounds. In the download section . It contains the complete code for all supported platforms, eg. Windows, Linux, Mac OS X, etc.
Here is my process on Mac:
- Install Xcode – Command Line tools. See instructions here.
- Install brew.
- instal PortAudio usingbrew install portaudio
- Install pyAudio:sudopip install pyaudio. depending on your system you may still get errors at this points if this happens the following :
pip install –global-option=’build_ext’ –global-option=’-I/usr/local/include’ –global-option=’-L/usr/local/lib’ pyaudio
- Install speechRecognition package: sudopip install SpeechRecognition
- Test your installation: python -m speech_recognition.