There are three ways to install Jasper on your Raspberry Pi.
The quickest way to get up and running with Jasper is to download the pre-compiled disk image available here for Model B. There is also an unofficial image for the B+ available here. After imaging your SD card, clone the repository and install the Python dependencies as described in Install Jasper. Then, skip to Configuration.
If you want to understand how all of the supporting libraries are compiled on the Raspberry Pi, Method 3 may be to your liking (or, at the very least, helpful for debugging).
Unfortunately, there are currently no packages available for Debian or Raspbian. Please use Method 3.
If you’re using ArchLinux, there are packages available in the Arch User Repository. To install them:
You’ll also need a Text-to-Speech (TTS) and a Speech-to-Text (STT) engine. Check out the configuration section to learn what STT/TTS engines are and what you need to do to use them.
After you’ve done that, you can start Jasper as a systemd service:
If the systemd service keeps failing, your audio device might already be in use by MPD, Pulseaudio, your Desktop Environment or some other process. In this case, start Jasper as your current user:
Follow these instructions only if you wish to compile your Jasper software from scratch. These steps are unnecessary if you follow the recommended “Quick Start” instructions above.
We’ll first clear the SD card using GParted on Ubuntu, but you can use an equivalent utility or operating system. In GParted: right-click on each partition of the SD card, then select ‘Unmount’ and ‘Delete’. Apply the changes with Edit > Apply All Operations.
Download Raspbian Wheezy from http://downloads.raspberrypi.org/raspbian_latest. While we’ve tested Jasper on the 2014-01-07 release, newer releases may also work.
We’ll use dd to burn the image to the disk. Obtain the address of the SD card with:
Our address was ‘/dev/mmcblk0’, so the following command burns the image to the disk:
When it’s done, remove your SD card, insert it into your Raspberry Pi and connect it to your computer via ethernet.
We’re now going to do some basic housekeeping and install some of the required libraries. You should SSH into your Pi with a command similar to the following. The IP address usually falls in the 192.168.2.3-192.168.2.10 range.
Run the following, select to ‘Expand Filesystem’ and restart your Pi:
Run the following commands to update Pi and install some useful tools.
Plug in your USB microphone. Let’s create an ALSA configuration file:
Add the following lines:
Back in the shell, restart your Pi:
Next, test that recording works (you may need to restart your Pi) by recording some audio with the following command:
Make sure you have speakers or headphones connected to the audio jack of your Pi. You can play back the recorded file:
Add the following line to the end of ~/.bash_profile (you may need to run touch ~/.bash_profile
if the file doesn’t exist already):
And this to your ~/.bashrc or ~/.bash_profile:
With that, we’re ready to install Jasper.
In the home directory of your Pi, clone the Jasper source code:
Jasper requires various Python libraries that we can install in one line with:
Sometimes it might be neccessary to make jasper.py executable:
You’ve now installed the Jasper core software. If you’re following Method I (Quick Start), continue with Configuration. Otherwise, continue with the dependency installation below.
To be able to understand what you say, Jasper still needs a Speech-to-Text (STT) engine. Jasper also needs a Text-to-Speech (TTS) engine to answer to your commands. Jasper aims to be modular and thus gives you the choice which STT/TTS engine you want to use. Depending on your choice, it may be required to install additional software.
Head over to the Configuration section. During configuration, you’ll learn what STT/TTS engines are and chose your flavour. You can then come back here and install the required dependencies for the STT/TTS engine of your choice (if neccessary).
Note: Installing pocketsphinx will take quite some time because you need to compile some stuff from source.
Jasper can use PocketSphinx for voice recognition. If you want to use Pocketsphinx as STT Engine, you’ll have to install:
If you’re using ArchLinux, you’re lucky: Just install the according AUR package and you’re done:
Everyone else needs to install the above tools manually:
First, you need to install Pocketsphinx. If you’re using Debian Sid (unstable) or Jessie (testing), you can just do:
If you’re not using Debian Sid/Jessie, you need to compile and install them from source:
Begin by installing some dependencies:
Next, move into your home (or Jasper) directory to check out and install CMUCLMTK:
Then, when you’ve left the CMUCLTK directory, download the following libraries:
To use the Pocketsphinx STT engine, you also need to install MIT Language Modeling Toolkit, m2m-aligner and Phonetisaurus (and thus OpenFST).
On Debian, you can install these from the experimental
repository:
If you’re not using Debian, perform these steps:
Untar the downloads:
Build OpenFST:
Build M2M:
Build MITLMT:
Build Phonetisaurus:
Move some of the compiled files:
Build Phonetisaurus model:
Finally, rename the following folder for convenience:
Once the installations are complete, restart your Pi.
At this point, we’ve installed Jasper and all the necessary software to run it. Before we start playing around, though, we need to configure Jasper and provide it with some basic information.
On Arch Linux, install julius
from the [community]
repo:
If you’re not using ArchLinux, you need to compile Julius manually.
Then, download the Julius source tarball and extract it to ~/julius
.
Please note that you also need an acoustic model and a lexicon..
On Arch Linux, install jasper-tts-espeak
from the AUR:
On Debian, install the espeak
package:
On Arch Linux, install jasper-tts-festival
from the AUR:
On Debian, install festival
and festvox-don
:
On Arch Linux, install jasper-tts-flite
from the AUR:
On Debian, install flite
:
On Arch Linux, install jasper-tts-pico
from the AUR:
On Debian, you need to install libttspico-utils
:
On Arch Linux, install jasper-tts-google
from the AUR:
On Debian, you need to install python-pymad
via APT and gTTS
via PIP:
On Arch Linux, install jasper-tts-ivona
from the AUR:
On Debian, you need to install python-pymad
via APT and pyvona
via PIP:
Theme based on BlackTie.co. Icons from Noun Project.