make_TextGrid {praatpicture}R Documentation

Interactively create a TextGrid object

Description

Annotate a sound file by interacting with waveform or spectrogram plots, resulting in a TextGrid object which can be used for creating various acoustic plots with time-aligned annotations with praatpicture().

Usage

make_TextGrid(
  sound,
  tierNames,
  start = 0,
  end = 0,
  audioInViewer = TRUE,
  show = "wave",
  channel = 1,
  sampa2ipa = FALSE
)

Arguments

sound

String giving the file name of a sound file with the .wav extension.

tierNames

String or vector of strings giving the name(s) of tiers in the new TextGrid object.

start

Start time (in seconds) of desired plotted area. Default is 0.

end

End time (in seconds) of desired plotted area. Default is 0 (= the entire file).

audioInViewer

Logical; should audio be playable from the Viewer pane in RStudio?

show

String giving the type of plot to show. Default is wave, another option is spectrogram. Note that spectrogram plotting is relatively slow within this function.

channel

Number indicating which audio channel to show. Default is 1.

sampa2ipa

Logical; should SAMPA transcriptions be converted to IPA? Default is FALSE.

Details

Running this function will show either a waveform or a spectrogram in a separate X11 graphics device window. Click on this figure in the locations where you want to add boundaries to your TextGrid objects. This should be done sequentially, starting with the first boundary along the time axis and ending with the last. It does not matter where on the y-axis you click.

Once you have indicated all the desired boundaries, you will be prompted in the R console to say whether the tier is an interval tier or a point tier by typing y (for interval tier) or n (for point tier). Subsequently you will be prompted in the console to write labels corresponding to each interval or point.

If you are creating a TextGrid with multiple tiers (i.e., if tierNames is longer than 1), this process will be repeated for all tiers.

Value

A list object identical to those created by rPraat::tg.read() when loading TextGrid objects into R. This object can be passed to the tg_obj argument when using praatpicture.

See Also

make_TextGrid() is largely a wrapper around the function tg_createTier() which does most of the work.

Examples

## Not run: 
datapath <- system.file('extdata', package='praatpicture')
soundFile <- paste0(datapath, '/2.wav')
tg <- make_TextGrid(soundFile, tierNames=c('Mary', 'John', 'Bell'))
# Follow the steps shown in the console

praatpicture(soundFile, tg_obj=tg)

## End(Not run)

[Package praatpicture version 1.0.0 Index]