Blog

enabling pocketsphinx gstreamer plugin

2013-06-02

I’m doing a little blog post because I keep forgetting how I do this. When installing the Blather speech recognition program on my crunchbang systems, I always run up against the ‘vader’ not found error when trying to launch the program.

glib.GError: no element "vader"

The problem is that its not finding the pocketsphinx Gstreamer plugin. It really ought to be installed when running the pocketsphinx “make install” command, but for some reason it doesn’t necessarily. Normally the libraries will have been built, though, so you can put them in place yourself. After building pocketsphinx, go into the source tree and find these files:

pocketsphinx-0.8/src/gst-plugin/.libs/libgstpocketsphinx.a
pocketsphinx-0.8/src/gst-plugin/.libs/libgstpocketsphinx.so
pocketsphinx-0.8/src/gst-plugin/.libs/libgstpocketsphinx.la
You need to put these somewhere like
/usr/local/lib/gstreamer0.10/
and then when you launch your pocketsphinx application you have to tell it where the libraries are by doing:
export GST_PLUGIN_PATH=/usr/local/lib/gstreamer0.10/
I just put this command in a launch script for blather instead of setting it as a global env variable.

Introducing Blather: speech recognition for the Linux desktop

2013-05-27

My pal Jezra recently wrote a little program called Blather that has changed my life. It’s a Python front end for the Sphinx speech recognition toolkit. This has finally enabled speech recognition on my Linux desktop. Speech recognition is one of the last things that has kept me from abandoning Windows altogether. Blather is not a replacement for the Windows and Mac dictation program Dragon Naturally Speaking, but it is a huge step in the right direction. In many ways it’s even better, though, because it is so highly customizable, and because it does not bring my desktop to a grinding halt the way DNS sometimes does on Windows. With blather I’m not confined to the commands that are built into the program, either. It’s been really fun configuring this and writing scripts to make it do the things I want it to do. Here are a couple of videos I made demonstrating it.

Twister Bash Script

2013-04-21 19:45:23

So I don’t have to spin that dial over and over when kids play Twister. Randomly chooses color, limb, and right or left, pipes results to espeak.


#!/bin/bash - 
#===========================================================================
#          FILE: twister.sh
#         USAGE: ./twister.sh 
#   DESCRIPTION: spin the (virtual) dial for twister, speak result
#  REQUIREMENTS: espeak or festival
#        AUTHOR: Jonathan Kulp ()
#       CREATED: 04/21/2013 01:37:00 PM CDT
#===========================================================================

colorfile=/tmp/color.txt
limb=/tmp/limb.txt
direction=/tmp/rl.txt

shuf -n1 > $colorfile <<EOFcolors
  red
  green
  yellow
  blue
EOFcolors

shuf -n1 > $limb <<EOFlimbs
  hand
  foot
EOFlimbs

shuf -n1 > $direction <<EOFrl
  left
  right
EOFrl

command=$(echo "$(cat $direction) $(cat $limb) on $(cat $colorfile)")

echo $command | espeak #festival --tts

rm $colorfile $limb $direction


How to run Finale on Linux via Wine

2012-09-03 08:28:46

Sadly, Finale is the de facto standard for music notation software. Finale is a good program, but long ago I got fed up with their abominable treatment of customers (exorbitant prices on annual updates that lack backwards compatibility) and switched to the open source, cross-platform alternative Lilypond. However, most of my students and colleagues still use Finale, so sometimes I need to be able to open up and play Finale files. I always have the Finale trial version (can open, edit, & play files but not print or save) installed on my Windows partition, but I spend most of my time in a Linux environment and don’t like to boot into Windows unless I really have to. I have attempted several times in the past five years or so to run Finale on Linux using the Wine emulation layer, and while I have always succeeded in installing the program, I have never gotten playback to work properly. Today I finally got it. Here’s how.

First off, I’m running 64-bit Arch Linux, so some stuff may be different for other distros and you may not need to install the extra 32-bit libraries if you’re already on a 32-bit system. This took some trial-and-error, debugging by reading stacktraces, and I don’t even know what all of these packages do, but Finale did not run until I installed all of them. Well, the wine_gecko package may have been required for something else, I can’t remember now.

Anyway here are the Linux packages to install (again, package names may differ on other linux distributions):

wine wine_gecko winetricks lib32-lcms lib32-mpg123 lib32-v4l-utils

At this point there is enough in place to do the Finale installation. Download Finale Demo version from https://www.finalemusic.com/ and install by double-clicking the installer .exe file. Click through the installation process and when it is finished you can try to launch Finale by double-clicking Finale.exe inside the installation directory in wine’s c_drive. If it crashes, like it did for me, you may need to install one more thing, the vcrun2010 Windows package. This is easy to do with winetricks.

Open up a terminal and run the command winetricks. It will open a graphical interface and present you with several options. Choose this series of options:

select the default wine prefix > Install a Windows DLL or component > vcrun2010

Once it is finished installing vcrun2010, try again to launch Finale. Hopefully it works this time.

The last step is to get playback working. Accept the system defaults for MIDI setup when it prompts you on first startup, then open a Finale file. Under the MIDI setup menu, choose playback through VST. Press the play button to see if it works. It did for me. :)


My most significant tech purchase of the last five years

2012-05-17 19:59:49

With a title like that, you might think I’m about to talk about some expensive fancy gadget or high-powered laptop or something. That would be wrong. No, the device I’m talking about has turned out to be worth a great deal to me, but it hardly cost me anything to purchase.

I like thrift stores. I’ve haunted them for about 25 years, from the time I was a teenager, all the way through graduate school, and even now 10 years into a career as a professor. I just can’t help popping into Goodwill or Salvation Army to see what bargains there might be.

Almost a year ago, I found an old desktop computer at the Goodwill in Scott, Louisiana.
read more…


Linux command to remove all Mac OSX shadow files at once

2012-03-03 21:56:51

For reasons unknown to me, Mac OSX creates shadow files of every file under certain circumstances, I think having to do with FAT-formatted usb drives or something. Anyway I had thousands of them scattered around my system after copying files back and forth for a few years. They are mostly things like “._01 Some musicfile.mp3” for example. After much experimentation and a little searching I found the command to remove all of them at once.

    find . -type f -name "._*" -exec rm -f {} \;
    

It’s a good idea to run this without the “-exec rm -f {} \;” command first so you can see what it’s finding and make sure it’s the stuff you want to delete.


How to run heybuddy on Windows

2012-02-21 14:38:17

Install Deps:

  1. python
    • Be sure to install as admin
    • You’ll probably need to adjust the environment variable “PATH” to include python. If you are not sure how to do that, it may help towatch this video
  2. pygtk: choose the all-in-one installer for python 2.6.6, Which has Cairo and the other dependency that I can’t remember.

Heybuddy

Get the heybuddy code, unpack it and put the heybuddy directory wherever it suits you.

Go into the heybuddy source directory and rename “heybuddy.py” to “heybuddy.pyw” so that it will run without a windows command prompt. Double-click to launch.

If you want to get cheeky with it like I do it, you can open up the heybuddy.py file in a text editor and change the variable “app_name” to “heybuddy on Winderz” and this is the client people will see in your timeline.


Debian: Enable Tap-clicking on Synaptics Touchpad on old Toshiba Satellite

2012-01-18 23:07:34

In case I ever forget how I did this, I’m posting about it here. The “tap-click” feature wasn’t working on the touchpad of my son’s Toshiba Satellite laptop after installing Crunchbang Linux and I’m still not sure why. My own (newer) Satellite has never had this problem. Anyway I fixed it by running these commands:

$ synclient TapButton1=1
$ synclient TapButton2=2
$ synclient TapButton3=3

Once I confirmed it was working again, I added those three commands to the ~/.config/openbox/autostart.sh script so that it would be enabled every time he logged in.


Every once in a while one of my jokes is funny

2011-10-18 21:53:03

I teach a class on Broadway and American musical theater, and today we were studying The Sound of Music. At the beginning of class one of the students asked whether we might be able to leave a little bit early on account of thunderstorms being in the forecast. First I told them that there would be no thunderstorms because I had brought my rain suit to work that day, and that the only way there would be thunderstorms would be if I had not brought my rain suit (I ride my bike to work every day, and forgetting the rain suit is a guarantee that I will get wet on the way home). Then I told them that if by any chance there were a thunderstorm before the end of class I would be happy to gather them all up on stage and sing “My Favorite Things” to them to calm their fears. This got the biggest laugh of the whole semester.


Mobile theme

2011-09-25 15:25:32

Having used an android phone for about three weeks now, I’m really starting to appreciate sites that detect mobile browsers and switch themes accordingly. In the past couple of days I have installed mobile themes on this website and also on my Moodle test site, and I love how these things work. We’re hoping to get a mobile Moodle theme going at school when we upgrade to Moodle 2.0 next year and it’s nice to see a preview of what it’s going to be like. It’s certainly much easier to navigate Moodle with a proper mobile theme activated. So now if you view this site on your phone you should automatically see a version optimized for the small screen.


A little more room in the shed

2011-09-22 11:29:22

Yesterday I sold one of my bikes to a student who was in desperate need of one. She had posted a great “bike needed” notice on craigslist, which I saw after a friend forwarded it to me thinking I might have something for her. She sounded like a good candidate for my Trek 800 Mountain bike, probably my best bike but a little too small for me. I gave her a great deal, selling it for essentially what I had put into it myself, about $75. She was so stoked, it made my day!

Dr Kulp-
Thanks thanks thanks! Just had a great ride commenced by flying down the front steps of Angelle, zipping down to Bayou vermilion district ( by airport) and back, launching off of anything I could… no gear trouble, it handles great, and the brakes ARE excellent. Woooo!
Have a wonderful week, and happy riding,

[name redacted]

PS: Please extend my thanks also to your friend who passed along the message.

I’m so glad this bike has found a good home with someone who’ll ride it hard. :)


Rebuilt webserver

2011-09-14 22:30:02

I completely rebuilt this webserver using straight Debian stable instead of Crunchbang Linux, so now there’s no graphical environment on the system at all. The migration was not too hard, probably taking no more than 3 hours altogether from the moment of putting the Debian disc in the drive until all three of my sites were live again. It was actually easier this way than setting it up the first time, because this time I knew from the beginning that I wanted to use the machine as a webserver, whereas before it was first meant as a desktop machine. All happy now. :)