Sendpraat: sending messages to Praat

With the sendpraat source code, you can send messages to a running program that uses the Praat shell, like Praat, although it is nowadays easier to use praat --send, which will start up Praat if it’s not running yet (see section 6.9 of the scripting tutorial). Sendpraat is available as a subroutine for macOS, Windows, and Linux, and as a command-line program for macOS, Windows, and Linux. The Praat manual contains a page about how to use the sendpraat program.

The source code is in sendpraat.c. In the line above the definition of main (), this file contains either "if 0" or "if 1", depending on whether you use it as a subroutine or as a command-line program.

## Sendpraat for macOS

You can freely use sendpraat as a subroutine in your own C programs, in which case the sendpraat subroutine becomes a part of your macOS application, or use the executable program sendpraat-mac (17,756 bytes) from the macOS command line (Terminal).

You could also compile this executable program yourself with

       cc sendpraat.c -o sendpraat-mac -DSTAND_ALONE -Dmacintosh -framework CoreServices -I/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/Headers -I/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/Headers

## Sendpraat for Windows

You can freely use sendpraat as a subroutine in your own C programs, in which case the sendpraat subroutine becomes a part of your Windows application, or use the executable program sendpraat-win.exe (136,662 bytes) from the command line (console).

You could also compile this executable program yourself under MinGW with something like

       ~/path/to/your/toolchains/mingw64/bin/gcc -std=gnu99 sendpraat.c -o sendpraat-win.exe -DSTAND_ALONE -D_WIN32 -isystem ~/path/to/your/toolchains/mingw64/include

## Sendpraat for Linux

You can freely use sendpraat as a subroutine in your own C programs, in which case the sendpraat subroutine becomes a part of your Linux application, or use the executable program sendpraat-linux (17,736 bytes; 64-bit) from the command line (Terminal).

You could also compile this executable program yourself with

       gcc -std=gnu99 sendpraat.c -o sendpraat-linux -DSTAND_ALONE -DUNIX

Paul Boersma, August 28, 2025
Phonetic Sciences
University of Amsterdam
Spuistraat 134, Amsterdam
E-mail: paul.boersma@uva.nl