Plot waveform and spectrogram

praat_plot(
  file,
  wav,
  tg = NULL,
  start = 0,
  end = NULL,
  width = 5,
  format = "png",
  f0 = FALSE,
  f0_min = 0,
  f0_max = 500,
  spec_max = 5000
)

Arguments

file

Output file path as a string.

wav

Wav file path as a string.

tg

TextGrid file path as a string. If `NULL` (the default), a TextGrid is plotted if a TextGrid file with the same name as the wav file is found. No TextGrid is plotted otherwise.

start

Start time of the plotting window in seconds.

end

End time of the plotting window in seconds. If `NULL` (the default), plot the entire duration.

width

Width of the plot in inches.

format

Output file format (`png` by default, or `pdf`).

f0

Whether to plot f0 (`FALSE` by default).

f0_min

If `f0 = TRUE`, minimum f0 value (`0` by default).

f0_max

If `f0 = TRUE`, maximum f0 value (`500` by default).

spec_max

Maximum frequency for the spectrogram (`5000` by default).

Value

Nothing. It is used for its side effects.

Examples

if (FALSE) {
wav <- system.file("extdata", "vowels.wav", package = "speakr")

praat_plot("vowels.png", wav, f0 = TRUE, f0_max = 200, end = 3)
}