Description Usage Arguments Details Value Note Author(s) References See Also Examples
Sends a shell command to the operating system that invokes the command-line form of Praat with an associated Praat script that imports a file, applies a Praat command to it, and then either brings the output directly into R or exports the output as a textfile.
1 | praat( command, arguments, input, output, overwrite, filetype, simplify )
|
command |
A character string indicating what command should be executed. At present, 972 different commands can be applied to 100 of Praat's different object classes, for a total of 2163 unique combinations of command + object. For the full list, see http://www.aaronalbin.com/praatr/commands.html. |
arguments |
Only required for certain commands. A list() of the arguments to the Praat command. These must be in the exact same order as used in Praat. The components of the list can optionally be named, but these names are ignored by PraatR. |
input |
The path to the file that the specified Praat command takes as input. This should be the full path on your hard drive (not merely the file name) and must not contain any spaces. |
output |
Required for 'Create' commands, and optional for 'Modify' commands.
The path for the file that will be created once the specified Praat command is executed.
This should be the full path on your hard drive (not merely the file name) and must not contain any spaces.
If omitted for a 'Modify' command, this will be assumed to be the same as the |
overwrite |
Only relevant for 'Create' and 'Modify' commands.
If the file specified in 'output' already exists, indicates whether that file should be over-written with the file created by executing the Praat command.
Defaults to |
filetype |
Only relevant for 'Create' and 'Modify' commands.
Determines what file format the output text file will have.
All 'Create' and 'Modify' commands have three choices: |
simplify |
Only relevant for 'Query' commands.
If |
The only two arguments that are obligatory (i.e. required for every possible command) are command
(which command to execute) and input
(what file to work with).
Depending on the command, you may also need to provide the arguments
required by Praat in order for it to know exactly how to execute that command.
The rest of the arguments depend on what kind of command you are executing:
For a 'Play' command, no additional arguments need to be specified.
For a 'Create' command, you must specify output
; overwrite
and filetype
are optional.
For a 'Modify' command, output
, overwrite
, and filetype
are all optional.
For a 'Query' command, simplify
is optional.
This function is largely used for its 'side-effect' - controlling Praat.
The exception is 'Query' commands, which return a value to R in one of two different formats.
(See the documentation of the simplify
argument above.)
Further information - including installation instructions, a basic tutorial, and the list of supported commands - is available at the PraatR homepage: http://www.aaronalbin.com/praatr/.
Aaron Albin (http://www.aaronalbin.com/)
Albin, A. (2014). PraatR: An architecture for controlling the phonetics software "Praat" with the R programming language. Journal of the Acoustical Society of America, 135(4), 2198. http://scitation.aip.org/content/asa/journal/jasa/135/4/10.1121/1.4877175
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | # The following examples are commented out because the file paths need to be adjusted for your
# computer (so the files and folders actually exist).
# Example 'Play' command
#praat( "Play", input="C:/sound.wav" )
# Has Praat read in the the soundfile 'C:/sound.wav' and then execute the 'Play' command on it
# Example 'Create' command
#praat( "Down to PitchTier", input="C:/sound.Pitch", output="C:/sound.PitchTier" )
# Takes a Pitch object, creates a PitchTier object out of it, and saves the result
# Example 'Modify' command
#praat( "Insert boundary...", input="C:/sound.TextGrid", arguments=list(1, 0.5) )
# Takes a TextGrid and inserts a boundary at 0.5 seconds ('0.5') on the first tier ('1')
# Example 'Query' command
#praat("Get mean...", input="C:/sound.Formant", arguments=list(1,0,0,"Hertz"), simplify=TRUE )
# Reads in a Formant object, retrieves the mean value of formant '1' from time '0' to time '0'
# (i.e. the entirety of the file), and returns only the number (omitting the suffix " Hertz")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.