praat_run: Run a 'Praat' script.

View source: R/praat.R

praat_runR Documentation

Run a 'Praat' script.

Description

It runs a 'Praat' script, with optional arguments passed to the script.

Usage

praat_run(script, ..., capture = FALSE)

Arguments

script

A character vector containing the script name.

...

List of arguments to be passed to the script.

capture

If set to TRUE, the standard output of the script (for example, from writeInfo) can be saved into a variable in R. If FALSE (the default) the output is logged to the console.

Value

If the 'Praat' script returns standard output this is returned as a character vector. Also, if the script has instructions to create files, these will be created.

Examples

## Not run: 
script <- system.file("extdata", "get-formants.praat", package = "speakr")

# Run get-formants.praat with argument "Hertz" and log to console.
praat_run(script, "Hertz")

# Run get-formants.praat with arguments and save in R variable.
library(readr)
formants <- praat_run(script, "Hertz", 0.03, capture = TRUE) %>%
  read_csv()

## End(Not run)


stefanocoretta/speakr documentation built on Feb. 4, 2024, 7:24 a.m.