search_openresult_inpraat {act}R Documentation

Open a search result in 'Praat'

Description

The function remote controls 'Praat' by using 'sendpraat' and a 'Praat' script. It opens a search result in the 'Praat' TextGrid Editor.

Usage

search_openresult_inpraat(
  x,
  s,
  resultNr,
  play = TRUE,
  closeAfterPlaying = FALSE,
  filterMediaFile = c(".*\\.(aiff|aif|wav)", ".*\\.mp3"),
  delayBeforeOpen = 0.5
)

Arguments

x

Corpus object.

s

Search object.

resultNr

Integer; Number of the search result (row in the data frame s@results) to be played.

play

Logical; If TRUE selection will be played.

closeAfterPlaying

Logical; If TRUE TextGrid editor will be closed after playing (Currently non functional!)

filterMediaFile

Vector of character strings; Each element of the vector is a regular expression. Expressions will be checked consecutively. The first match with an existing media file will be used for playing. The default checking order is uncompressed audio > compressed audio.

delayBeforeOpen

Double; Time in seconds before the section will be opened in Praat. This is useful if Praat opens but the section does not. In that case increase the delay.

Details

To make this function work you need to do two things first:

Examples

library(act)

mysearch <- act::search_new(x=examplecorpus, pattern = "pero")

# You can only use this functions if you have installed and 
# located the 'sendpraat' executable properly in the package options.
## Not run: 
act::search_openresult_inpraat(x=examplecorpus, s=mysearch, resultNr=1, TRUE, TRUE)

## End(Not run)

[Package act version 1.3.1 Index]