<p>In this episode I walk you through the process of getting the <a href="https://gitlab.com/jezra/blather">Blather</a> GNU/Linux speech recognition program running for the first time. </p>

<p><strong>Arch</strong>: On Arch Linux this is really easy. Jezra made a <a href="https://aur.archlinux.org/packages/blather-git/">package build for the AUR</a> so you can just install it that way.</p>

<p><strong>Debian</strong>: I wrote an <a href="https://hackerpublicradio.org/eps/hpr2039/debian_blather_install_script">installation script</a> for Debian-based systems that installs the dependencies to build <a href="https://cmusphinx.sourceforge.net/">pocketsphinx</a>, plus a few extra packages that I use continually when I'm running blather (xvkbd, xdotool, espeak, wmctrl, elinks, xclip, curl). It builds/installs the Sphinx stuff, pulls the blather source code, and puts some configuration files and a startup script in place for you. This should take care of pretty much all of the heavy lifting.</p>

<p>I refer frequently to Jezra's usage notes on the <a href="https://gitlab.com/jezra/blather">Blather source code page at gitlab</a>, so if you're trying to install this as I talk, you might want to follow along over there.</p>

<p>The trickiest bit in the initial run is the creation and placement of the language files. I normally use a bash script for this, but on this first episode of the series I'm going to use the <a href="https://www.speech.cs.cmu.edu/tools/lmtool-new.html">web-based lmtool</a> to create the language files, just the way Jezra says to do on his usage page. He also includes my automated language updater script in the blather source code, though, so going forward I will be talking about how to use that script instead of the web-based tool.</p>

<h2>Blather Launch Script</h2>

<p>I use a bash script to launch Blather because I want to set several environmental variables: location of the pocketsphinx gstreamer libraries, default browser, default text-to-speech engine, and so forth. Having these environmental variables set means that I can use easy-to-remember shortcuts in my blather commands config file. Here is my launch script:</p>

<pre>#!/bin/bash

# tell it where the Gstreamer libraries are
export GST_PLUGIN_PATH=/usr/local/lib/gstreamer-0.10

# set some shortcuts to use in the commands file

#export VOICE="/usr/bin/festival --tts"
export VOICE="/usr/bin/espeak"
export CONFIGDIR="/home/$(whoami)/.config/blather"
export KEYPRESS="xvkbd -xsendevent -secure -text"
export BROWSER="chromium-browser"

# add blather script directory to the user's PATH
export PATH="$HOME/bin:/home/$(whoami)/.config/blather/scripts:$PATH"

# start blather in continuous mode with the GTK GUI 
# and a history of 20 recent commands

python2 /home/$(whoami)/code/blather/Blather.py -c -i g -H 20
</pre>

<h2>Links</h2>

<ul>
<li><a href="https://gitlab.com/jezra/blather.git" target="_blank">Blather source code</a></li>
<li>Blather <a href="https://hackerpublicradio.org/eps/hpr2039/debian_blather_install_script">Installation Script for Debian</a></li>
<li><a href="https://www.jezra.net/" target="_blank">Jezra's website</a></li>
<li><a href="https://cmusphinx.sourceforge.net/" target="_blank">Sphinx Speech Recognition Library</a></li>
<li>Sphinx <a href="https://www.speech.cs.cmu.edu/tools/lmtool-new.html" target="_blank">knowledge base tool</a></li>
<li>Learn about the $2 Microphone that I use for blather: <a href="https://hackerpublicradio.org/eps.php?id=1812">HPR Episode 1812</a></li>
</ul>

<h2>Credits</h2>

<ul>
	<li>Music bumpers are from Kimiko Ishizaka's <em>The Open Goldberg Variations</em>: <a href="https://www.opengoldbergvariations.org/">https://www.opengoldbergvariations.org/</a>, used by permission of their <a href="https://creativecommons.org/publicdomain/zero/1.0/">CC0 1.0 Universal (CC0 1.0) Public Domain Dedication license</a>.</li>
</ul>
