Learn R Programming

act (version 1.3.1)

export_textgrid: Export a transcript object to a 'Praat' .TextGrid file

Description

Advice: In most situations it is more convenient to use act::corpus_export for exporting annotation files.

Usage

export_textgrid(
  t,
  outputPath = NULL,
  filterTierNames = NULL,
  filterSectionStartsec = NULL,
  filterSectionEndsec = NULL
)

Value

Contents of the .TextGrid file (only if outputPath is left empty)

Arguments

t

Transcript object; transcript to be saved.

outputPath

Character string; path where .TextGrid will be saved.

filterTierNames

Vector of character strings; names of tiers to be included. If left unspecified, all tiers will be exported.

filterSectionStartsec

Double; start of selection in seconds.

filterSectionEndsec

Double; end of selection in seconds.

Details

The .TextGrid file will be written to the file specified in outputPath. If outputPath is left empty, the function will return the contents of the .TextGrid itself.

See Also

corpus_export, export_eaf, export_exb, export_printtranscript, export_rpraat, export_srt

Examples

Run this code
library(act)

# Get the transcript you want to export
t <- examplecorpus@transcripts[[1]]

# Create temporary file path
path <- tempfile(pattern = t@name, tmpdir = tempdir(),
                 fileext = ".TextGrid")

# It makes more sense, however, to you define a destination folder
# that is easier to access on your computer:
if (FALSE) {
path <- file.path("PATH_TO_AN_EXISTING_FOLDER_ON_YOUR_COMPUTER",
                    paste(t@name, ".TextGrid", sep=""))
}

# Export
act::export_textgrid(t=t, outputPath=path)

Run the code above in your browser using DataLab