
www.adeept.com
61
*Now you may wonder about the difference between apt-get install and pip install, here is
the answer:
pip3
is used to download and install packages directly from PyPI (Python Package Index),
hosted by Python Software Foundation. It is a specialized package manager that only
deals with python packages.
Note:
There are two versions of Python in Raspberry Pi by default, for our Python
programs are written with Python 3.x(3.7), you need to use
pip3
instead of
pip
, which is
used to install software in Python 2.x.
apt-get
is used to download and install packages from Ubuntu repositories which are
hosted by Canonical.
7.Install Software for Speech Recognition
First, you need to update the tools for installing:
sudo pip3 pip setuptools wheel
Setuptools is a package development process library designed to facilitate packaging
Python projects by enhancing the Python standard library distutils (distribution utilities).
Homepage:
https://github.com/pypa/setuptools
Python Wheel Package. WHL file is a Python Wheel Package. Python is a dynamicobject
-oriented programming language. Wheel is a built-package format for Python.
A wheel is a ZIP-format archive with a specially formatted filename and the
.whl
extension.
Homepage:
Then you need to install PyAudio because we use microphone input, otherwise it will raise
an AttributeError when the programs attempting to instantiate a microphone object.
sudo apt-get install portaudio19-dev python3-all-dev python3-pyaudio
sudo pip3 install pyaudio
sudo apt-get install flac
Portaudio19-dev and python-all-dev are the packages that pyaudio requires.
Be sure to install the portaudio library development package (portaudio19-dev) and the
python development package (python3-all-dev) before pyaudio.
PyAudio can input sound from microphone and then you need flac to convert the sound to
a
.flac
file for PocketSphinx speech recognition.
Now you can install Speech Recognition library for performing speech recognition, which
with support for several engines and APIs, online and offline.
Install the latest version of sphinxbase and pocketsphinx
You can find the downloads here: