Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Components
Raspberry pi (At least model B)
SD Card (4GB at least)
USB Wall Charger Adapter(2A recomended)
USB-micro USB cable
USB wifi adapter
USB External Sound Card
Microphone (jack3.5)
Self Powered Speakers
Software
THE PROGRAM ITSELF IT'S
PUBLISHED HERE
Instalation
If you are running it on a raspberry pi, you need to install raspbian
First of all you must have python 2.7 installed on your computer. To check this
type python --version in the terminal. If it is not installed just google how to
install it on your linux distro.
Python tools
sudo apt-get install python-dev
sudo apt-get install python-setuptools
sudo apt-get install python-pip
sudo pip install --upgrade pip
Required modules
To prevent errors, we're installing all the modules manually instead of using pip.
PyAudio to use the microphone
Wolframalpha API
sudo pip install wolframalpha
running install
running bdist_egg
running egg_info
creating tweepy.egg-info
writing requirements to tweepy.egg-info/requires.txt
writing tweepy.egg-info/PKG-INFO
writing top-level names to tweepy.egg-info/top_level.txt
writing dependency_links to tweepy.egg-info/dependency_links.txt
writing manifest file 'tweepy.egg-info/SOURCES.txt'
reading manifest file 'tweepy.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'tweepy.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/examples
copying examples/__init__.py -> build/lib.linux-x86_64-2.7/examples
TTS
Google TTS (Online) For google tts we use a bash script, and we mpg123 and
mplayer.
sudo apt-get install mpg123
sudo apt-get install mplayer
Festival (Offline)
sudo apt-get install festival festvox-don
STT
SpeechRecognition as stt (speech to text)
git clone https://github.com/Uberi/speech_recognition.git
cd speech_recognition
sudo python setup.py install
GPIO
RPi.GPIO for using the Button to stop/play music
wget https://pypi.python.org/packages/source/R/RPi.GPIO/RPi.GPIO-0.5.11.tar.gz
tar -xzvf RPi.GPIO-0.5.11.tar.gz
cd RPi.GPIO-0.5.11
sudo python setup.py install
Configuration
USB Sound Card
If youre using a raspberry youll need to set up usb sound card: Connect it to
the USB port, and check if its recognized:
lsusb
If you see a Audio Adapter or something like this, its fine. Now we need to set
this as the main soundcard, so we open alsa-base.conf
sudo nano /etc/modprobe.d/alsa-base.conf
To this:
options snd-usb-audio index=0
options snd_bcm2835 index=1
Reboot the raspberry sudo reboot After this, we need to adjust the volume, so
open alsamixer:
alsamixer
Adjust the speaker and mic volume with left/right and up/down keys, press esc,
and to save it:
sudo alsactl store
Once that this works, we can download and setup the program itself.
Name
The name you want it to have, for automatic recognition
TTS
You can choose between FESTIVAL, GOOGLE or PYTTSX (You have to write them
like this)
Language
Actually it just works on Spanish as you have to translate the modules and the
brain. I've given up with this project, but you can fork it and translate it.
wolfram_api
You'll have to get your own API at http://products.wolframalpha.com/api/
Music
For listening to your music you have to put all your mp3 files at a folder called
"music"
You have to choose a slightly higher value than the one returned by the script.