Warning: you need the Praat source code only in the following cases:
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.
All of the code is available under the GNU General Public License. Of course, any improvements are welcomed by the authors.
To download the latest source code of Praat, click on one of the archives:
The code requires that your compiler supports C99 and C++.
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).
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.
Extract praat5414_xcodeproj32.zip or praat5414_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.
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 mv external/portaudio external/portaudio2014 mv external/portaudio2007 external/portaudio
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).
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.