Downloading the Praat source code

Warning: you need the Praat source code only in the following cases:

  1. you want to extend Praat's functionality by adding C or C++ code to it; or
  2. you want to understand or reuse Praat's source code; or
  3. you want to compile Praat for a computer for which we do not provide binary executables, e.g. Linux for non-Intel computers, FreeBSD, HP-UX, SGI, or SPARC Solaris.

Before trying to dive into Praat's source code, you should be familiar with the working of the Praat program and with writing Praat scripts. The Praat program can be downloaded from www.praat.org.


1. Licence

All of the code is available under the GNU General Public License. Of course, any improvements are welcomed by the authors.


2. Downloading the archive

To download the latest source code of Praat, click on one of the archives:

praat5382_sources.zip (26 July 2014; 8.7 MB)
praat5382_sources.tar.gz (26 July 2014; 7.2 MB)

The code requires that your compiler supports C99 and C++.


3. Unpacking the archive

On most computers you can unpack the zip file by double-clicking. If you prefer to try the .tar.gz file instead, drop it on StuffIt Expander (on Macintosh or Windows) or use gunzip and tar xvf (on Unix).


4. Steps to take if you want to extend Praat

First make sure that the source code can be compiled as is. Then add your own buttons by editing main/main_Praat.cpp or fon/praat_Fon.cpp. Consult the manual page on Programming.


5. Compiling on Macintosh

Extract praat5382_xcodeproj32.zip or praat5382_xcodeproj64.zip (depending on whether you want to compile the 32-bit or the 64-bit edition) into the directory that contains sys, fon, dwtools and so on. Then open the project praat32.xcodeproj or praat64.xcodeproj in Xcode and choose Build or Run. The project contains the target praat_mac (for MacOS X, on Intel processors). If you get an error message like "Code Signing Identity xxx does not match any valid, non-expired, code-signing certificate in your keychain", then select the target praat_mac, go to Info -> Build, and switch "Code Signing Identity" to "Don't Code Sign", or sign with your own certificate if you have one as a registered Apple developer.


6. Compiling on Linux and other Unixes

Install libgtk2.0-dev (and its dependencies) and libasound2-dev. Then go to the sources directory and type

   cp makefiles/makefile.defs.linux.alsa ./makefile.defs

Then type make to build the program. One may have to kill jackd or artsd to get audio to function. If your Unix isn't Linux, you may have to edit the library names in the makefile (you may need pthread, gtk-x11-2.0, gdk-x11-2.0, atk-1.0, pangoft2-1.0, gdk_pixbuf-2.0, m, pangocairo-1.0, cairo, gio-2.0, pango-1.0, freetype, fontconfig, gobject-2.0, gmodule-2.0, gthread-2.0, rt, glib-2.0, asound).

When compiling Praat on an external supercomputer or so, you will not have sound. If you do have libgtk2.0-dev (and its dependencies), do

   cp makefiles/makefile.defs.linux.silent ./makefile.defs

Then type make to build the program. If your Unix isn't Linux, you may have to edit the library names in the makefile (you may need pthread, gtk-x11-2.0, gdk-x11-2.0, atk-1.0, pangoft2-1.0, gdk_pixbuf-2.0, m, pangocairo-1.0, cairo, gio-2.0, pango-1.0, freetype, fontconfig, gobject-2.0, gmodule-2.0, gthread-2.0, rt, glib-2.0).


7. Compiling for Windows

Use the MinGW compiler, perhaps on a Mac or Linux computer, to avoid any chance for viruses. You can find toolchains for 32 and 64 bits here (look for Automated Builds). Install the GDI+ headers and the GDI+ library (32-bit; for 64-bit Windows just extract a GDI+ DLL from somewhere). Then copy the file makefiles/makefile.defs.mingw32 or makefiles/makefile.defs.mingw64 to the sources directory (i.e. where makefile is) and rename it to makefile.defs. Then go to the sources directory and type make.


Back to the Praat home page.