Files

263 lines
13 KiB
Plaintext
Raw Permalink Normal View History

Episode: 2039
Title: HPR2039: Blather Configuration Part 0: Initial Setup
Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr2039/hpr2039.mp3
Transcribed: 2025-10-18 13:36:17
---
This is HPR Episode 2039 entitled Blanner Configuration Part Neuro, Initial Setup, and in part
on the series Accessibility.
It is hosted by John Culp and in about 19 minutes long.
The summary is in this episode I walk you through the process of getting Blanner running
for the first time.
This episode of HPR is brought to you by AnanasThost.com.
At 15% discount on all shared hosting with the offer code HPR15.
That's HPR15.
Better web hosting that's honest and fair at AnanasThost.com.
Hey everybody this is John Culp and Lafayette Louisiana.
I'm not sure exactly when this podcast might get to air.
I don't get to the HPR feed but I thought I would take the opportunity to record an episode
on how to install Blanner because if you've listened to my episodes in the past
you've heard me talk about Blanner which is the speech recognition program
written by our friend Jezra that I use to do just like anything on my laptop.
I programmed it to have I think some like 800 different commands but it's a highly
configurable speech recognition program where you configure every single command.
It can be a little bit tricky to get up and running and I'm faced right now
with the task of getting it working on a laptop that I've just kind of inherited at work.
One of my faculty got a new laptop and she asked if I wanted to take the old one
and I said sure and it's not I mean I think she said it's about 10 years old
but it looks like it's in good condition.
It's a Dell Latitude D830 and it's got an Intel Core 2 Duo 4GB RAM 80GB hard drive.
I mean it's not a powerhouse or anything but I've installed Debian on it and not Debian
but Ubuntu and it seems to work very well and it seemed like a good opportunity for me
to try to walk you through the process of getting Blatter up and running.
So the first thing that I've done is I probably should have started recording this first
but I have an installation script for this that will install all the dependencies needed
to build the Sphinx speed recognition engine upon which this is based.
So Blatter is a Python script that's a wrapper around Sphinx.
That Jezre wrote the wrapper and Sphinx is the actual engine.
And so I wrote a script that will grab all the dependencies to build Sphinx
then grab the source code for Sphinx and build it and put everything in the right place
and then it grabs the Blatter source code and puts some stuff in the right place.
It's a configuration file ready and sticks it where it needs to go.
And I will make sure that the installation script is somewhere in the HDR show notes.
I have it right now on my paste bin site but that's the kind of site that could disappear in the future.
So I'll make sure that the script gets somewhere where it'll be more permanent
but anyway, so what I did was went to my paste bin site and grabbed the script
and then saved it as a text file in the home slash home slash John slash bin folder.
Anyway, so my personal binary directory and then made it executable by doing
Chimad, CHMOD, space plus X space and then the file name.
And so now the next step is to run it and watch while it does all of those things that it's supposed to do.
So I'm going to type the command here.
I called it Debian Blather Install and I'm going to hit Enter and see if it does its thing.
Oh, it asked me for my password because I have a pseudo command there and off it goes.
So the first thing it does is get the build dependencies from the regular Ubuntu archives
or if you're on Debian it'll do it from whatever your repository is.
Oh boy, there's a bunch of them.
168 packages to install.
I could take a little while, I'm not really sure how long it's going to take.
So it's possible that I will come back here in a little while after they're all installed.
Looking through the line up of packages, it's a lot of libraries, Python modules, stuff like that.
So if it's boring watching stuff be downloaded.
How much more boring is it to listen to someone watching things be downloaded?
That's the question I guess.
And I think the answer is pretty darn boring.
So I'm going to stop the audio right now and then pick it back up again after these packages are all installed.
All right, I'm back.
So now the packages have all been installed and it has downloaded the Sphinx source code and is building it.
It looks like it's doing okay.
It keeps running, make, make, make.
What is that?
Okay, now it's downloading another PocketSphinx.
There's a couple of different Sphinx things that have to be built.
I don't remember exactly what they are, but the script is supposed to do all of them.
It's comforting to see that the location for the source code is still accurate because it's been a long time since I've run this script.
And sometimes the address for files will change.
It looks like it's grabbing a PocketSphinx 0.8.tar.gz is being downloaded now.
ETA 7 seconds, 6, 5, 4, 3, 2, 1, there it goes.
It's unpacking and running a live, tool-ize, auto-make, configure, checking for.
It's doing its sanity checks now.
It's created the config files and now it's building.
Ooh, this is exciting.
I should have made a screencast while I was doing this.
We got the GCC screensaver going here.
And it's going, it's going.
So after it's done with this, the next thing would be...
I think the next thing is the actual Blather code,
which Jezor had to move. I think he had it on Gatorius before, but I didn't really follow that whole thing,
but I get the idea that Gatorius went away and now it's on GitLab.
It doesn't look like it did it.
Seems to have exited without...
Seems exited without doing...
Oh, no, it did, it did.
It said cloning into Blather.
Where? Okay, there's Blather.
Yeah, okay, it got the Blather. Good.
So Jezor has on his Blather source code page.
I'm going to go there real quick so I can talk us through this.
So it's at GitLab.com slash Jezra slash Blather. Git.
On the main page there, he's got instructions.
He says what the requirements are.
The requirements are very simple if you're on Arch Linux.
When he says requirements are G-streamer, Pi GTK, and so forth.
On Debian, you need a whole lot more than just typing and apt-get install G-stream.
You need the development libraries and all that stuff as well.
So under usage, he says to move the commands.timp to config slash Blather commands.conf.
I wonder if that has already happened here.
config is Blather. Oh, yes, I see Blather.
I'm seeding into .conf slash, no.
So in my home directory, moving into .conf, slash Blather,
and I see the file commands.conf.
Good.
And if I do less commands.conf,
it's got one command in there right now.
Hello World, colon, echo, hello world.
However, I don't know that that echo command is going to do a whole lot.
Because when you run a Blather command, unless you're in a terminal,
you won't see the terminal output for the echo command.
I'm going to do vim commands.conf.
I'm going to make a new command there.
Instead of saying echo, hello world, I'm going to change that to say eSpeak, hello world.
One of the packages I install with my Blather installation script is eSpeak,
because I use it quite a lot.
All right, so I have saved the commands.conf file.
And the new command is hello world, colon, eSpeak, open quote, hello world, close quote.
Okay, so he says to move the commands there,
and then run Blather.py.
This will generate the sentences.corpus based on, okay, let's try that.
Oops, where is the Blather thing on here?
So I think I'll have to go back into the Blather source code.
Yeah, okay, so I'm going to do Blather.py.
YAML is not supported. YAML will not function.
This will generate quit Blather.
There's a good chance it will just seg fault values.
Okay, it says I may need to install GStreamer 0.10-pocketsfinks.
No element here. Okay, I actually did a blog post on how to fix that problem.
So what's happening here is when I try to run Blather.py,
it cannot find the Pocketsfinks GStreamer library.
And that's when you get the error message that says no element Vader.
That's what the problem is.
So what I have to do is go back to my blog where I blog this because I knew I would have to use it again one day.
JonathanCulp.org.
And I'm going to look at the blog page.
Enabling Pocketsfinks GStreamer plugin.
Let's see.
After building Pocketsfinks, go in the source tree and find these files.
And you put them somewhere like this.
And then do that. Okay.
I need to put them user local live GStreamer.
Let's see.
I'm going to see what's in the user local live folder.
Okay, those things are in there.
And so now it looks like what I need to do is just tell Blather where they are.
And the way I do that is I create a Blather launch script.
And in the launch script, I export the GST plugin path.
And so do I have, where do I have this?
Did I put the, you know, let me look in my home bin directory.
It seems like part of my installation script is also to create a Blather.
Yeah, there it goes. Okay.
Blather.
Excellent. Okay.
So part of my installation script creates a Blather launch script,
which is a bash script that sets a number of environment variables,
including the GStreamer plugin path so that it will know where to find these things.
So now what I'm going to do, instead of going into the Blather source code
and running Blather.py, I'm going to run my Blather.sh.
Command. And I don't think my home bin is in my path yet on this laptop.
So I'm just going to see you right into the bin folder and run Blather.sh.
Let's see what happens. Oh my gosh, there it is.
So the Blather GTK thing is running.
Let's see if it, oh, it just, it's seg faulted.
And that is because it did not find the language dictionary.
And Jesra mentioned that this might happen.
So let's go back and see what he says to do next.
So right now I'm on, on his usage thing, it says,
I just finished command number two or instruction number two,
which is to run Blather. Number three is quit Blather.
There's a good chance it will just seg fault, and that's what it did.
So what he says to do next is to run the LM tool
by going to speech.cs.cmu.edu slash tools slash LM tool.html
upload the sentences corpus file.
And I think I'm going, well, I guess let's just follow his instructions.
I have another script that does this.
Use the LM tool. I have another script that uses a curl
and does this from the command line.
And I actually have a, a Blather command that says,
update BladderConfig, and it will run this stuff in the background.
So if you follow the link on Jesra's page to the Sphinx knowledge base tool,
there's a place for you to upload a sentence corpus file.
So I'm going to browse, click the browse button,
and then go find this.
It will be in my home directory in the .config file.
And then inside Bladder, it's called sentences.corpus.
And then click compile knowledge base.
And then it generates several files.
So I'm going to, I just need the .dic and the .lm file,
I think. Let's look back.
Oops, history.
Just for Bladder GitLab.
I have to go back and find Jesra's GitLab page.
Let's see what he says to do.
Download the resulting LM file to language directory.
Okay.
Oops.
So I'm going to right-click and save link as
and then navigate to .config.bladder.language
and rename it to the LM.
And then do the same thing with the other one.
Okay. And then download the .dic file to the language directory
and rename it to .dic.
Okay.
Do the same thing there.
This is so exciting.
It's been a long time since I went through this process here.
It's way better when you can automate these things.
But for the sake of everyone who's never used this before,
I'm going to go by Jesra's book here.
Alright, so I've put the language files in place.
And now, do I run it again?
Run Bladder, okay.
So now I'm going to use my little Bladder launch script again
and run it.
It's listening.
Okay.
So here goes.
Let's listen.
Did you hear that?
Okay, I'm going to turn up the volume.
And then when I speak the command, it should respond.
Hello, world.
Hello, world.
Hello, world.
How about that?
It's working, y'all.
Of course, it has a very limited vocabulary right now.
It's just got two words in it.
But that at least will get us through the installation
and basic setup.
And in future episodes, I'm going to start showing how you can
add more and more commands to this and really make Bladder useful.
Let's do this one more time.
Hello, world.
Hello, world.
Thanks, y'all.
This has been John Culp in Lafayette, Louisiana,
helping you get started with Bladder.
Bye.
You've been listening to Heckapublic Radio at HeckapublicRadio.org.
We are a community podcast network that releases shows every weekday
Monday through Friday.
Today's show, like all our shows, was contributed by an HPR listener
like yourself.
If you ever thought of recording a podcast, then click on our
contributing to find out how easy it really is.
Heckapublic Radio was founded by the digital dog pound
and the Infonomicon Computer Club, and is part of the
binary revolution at binrev.com.
If you have comments on today's show, please email the host
directly, leave a comment on the website or record a
follow-up episode yourself.
Unless otherwise stated, today's show is released on the
creative comments, attribution, share a light, 3.0 license.
Thank you.