Installing Praat on Ubuntu - getting sound to work
Some Background
I recently installed Ubuntu 14.04 on my Lenovo Yoga, and it’s time to reinstall Praat.
I’ve gotten Praat to work before on Ubuntu, but it was a pain. From what I can tell, a lot of Linux users hit this problem where they can see and edit sounds, but just not play them through speakers or headphones.
I remember reading a lot about alsa and pulsaudio, but not getting far.
Today I was on Praat’s website, looking through their installation page and their suggested steps to get Praat working, but then I thought installing from the latest source might be the solution. It’s strange, but there’s no mention that I could find of their source code being hosted on GitHub. They have a local version of the source, but I thought I’d just check on GitHub anyways.
Sure enough, there it was, and it was reassuring to see that Paul Boersma was the one who had made the latest commits.
So, I cloned from GitHub, did the install, and it worked! Since I couldn’t find other posts about the install and the GitHub page is little publicized on Praat’s home page, I will go through the steps here.
First, in case it’s relevant for others I’m going to show a little info about my current setup.
You can see the exact kernel on my version of Ubuntu below:
Installing Dependencies
To install on Ubuntu (or any other unix-like system), we first need to install a few dependencies. Here’s the list:
Name | Homepage | Description |
---|---|---|
libasound2-dev | ALSA Development Library | This package contains files required for developing software that makes use of libasound2, the ALSA library. ALSA is the Advanced Linux Sound Architecture. |
libgtk2.0-dev | GTK+ Development Library | development files for the GTK+ library |
Here’s the command to get both at once:
Installing Praat
To get the most update version of Praat, let’s clone it from GitHub and just save it on our desktop. Once it’s on our desktop.
If you do an ls or la on your Desktop, you should see a new, praat directory. Here are located all the files (Makefiles) to install it correctly. Let’s take a look at what we’ve just got:
Now we need to get the definitions that are specific to Linux for our makefiles. We need to be in our new praat directory and save the ones that are relevant to us to a new file, makefiles.defs.
Now that we’ve made this new makefiles.defs file, we can see it in our praat dir.
Now we can install Praat with the standard make command.
You’re going to get a lot of output at the command line, and it may take a couple mintues to finish. Here’s the tail end of the output you should be getting.
At this point you might think that you’re done, but if you try to run Praat from the command line, you get an error:
DO NOT RUN THAT COMMAND!
This error is telling you that the computer can’t find Praat, not that it’s not installed.
You do have Praat and it does work. To prove it, you can just run:
You should see that familiar, beautiful GUI.
So, to put Praat in the right place, you just copy that executable file ./praat to where it belongs. For Ubuntu users, this executable shoudl be in /usr/bin.
So, we simply copy the file to where it goes:
Now you can run Praat from anywhere, and you should have sound!
You probably want to remove those source files on the Desktop, since you don’t need them anymore:
Enjoy your Praat!
Still having issues?
A friend of mine was still having problems with the sound after installing Praat on Linux, and he found a strange and simple solution. Here’s the thread on GitHub.
Apparently, if you have the NumLock function activated, you won’t be able to hit tab in Praat to play a section of audio. If this is the problem, you should still be able to play the sound by clicking on the gray rectangles of a highlighted section of audio under the spectrogram. If this is your issue, deactivate NumLock and try using tab. It might be that easy.