Scripting 8.3. The sendpraat directive

Besides being a subroutine (Scripting 8.1. The sendpraat subroutine) and a program (Scripting 8.2. The sendpraat program), sendpraat can also be called from within a Praat script.

Example 1: killing a program

Suppose we are in the Praat-shell program Als, which is a browser for dictionaries, and we want to kill the Praat-shell program Praat, which is a program for phonetics research:

sendpraat Praat Quit

Example 2: playing a sound

Suppose we are in the Praat-shell program Als, which is a browser for dictionaries, and has no idea of what a sound is. From this program, we can play a sound file by sending a message to the Praat-shell program Praat, which does know about sounds:

fileName$ = "hallo.wav"
sendpraat Praat
...'newline$' Read from file... 'fileName$'
...'newline$' Play
...'newline$' Remove

The first newline$ is superfluous, but this format seems to read nicely.

Links to this page


© ppgb, December 18, 2002