Title: | 'Praat Picture' Style Plots of Acoustic Data |
---|---|
Description: | Quickly and easily generate plots of acoustic data aligned with transcriptions similar to those made in 'Praat' using either derived signals generated directly in R with 'wrassp' or imported derived signals from 'Praat'. Provides easy and fast out-of-the-box solutions but also a high extent of flexibility. Also provides options for embedding audio in figures and animating figures. |
Authors: | Rasmus Puggaard-Rode [aut, cre, cph]
|
Maintainer: | Rasmus Puggaard-Rode <[email protected]> |
License: | Apache License (>= 2) |
Version: | 1.4.1 |
Built: | 2025-02-24 14:49:27 UTC |
Source: | https://github.com/rpuggaardrode/praatpicture |
Helper function to convert capital letters into Unicode small caps. May not work for all font families. Note that there's no Unicode small cap 'X', so 'X' will just be converted to 'x'.
conv2sc(x)
conv2sc(x)
x |
A string where all capital letters should be converted to small caps. |
A string where all capital letters have been converted to small caps.
my_string <- 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' conv2sc(my_string)
my_string <- 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' conv2sc(my_string)
Helper function for drawing arrows on plot components made with
praatpicture. Do not use directly, instead use praatpicture with the
draw_arrow
argument.
draw_arrow(plot_component, args)
draw_arrow(plot_component, args)
plot_component |
String giving the name of the plot component to draw on. |
args |
A list of vectors giving arguments used for drawing arrows. See praatpicture documentation. |
No return values, called internally by praatpicture and sibling functions.
# Don't use directly datapath <- system.file('extdata', package='praatpicture') soundFile <- paste0(datapath, '/1.wav') praatpicture(soundFile, draw_arrow=c('spectrogram', 0.1, 500, 0.4, 2000))
# Don't use directly datapath <- system.file('extdata', package='praatpicture') soundFile <- paste0(datapath, '/1.wav') praatpicture(soundFile, draw_arrow=c('spectrogram', 0.1, 500, 0.4, 2000))
Helper function for adding straight lines to plot components made with
praatpicture. Do not use directly, instead use praatpicture with the
draw_lines
argument.
draw_lines(plot_component, args)
draw_lines(plot_component, args)
plot_component |
String giving the name of the plot component to draw on. |
args |
A list of vectors giving arguments used for drawing straight lines. See praatpicture documentation. |
No return values, called internally by praatpicture and sibling functions.
# Don't use directly datapath <- system.file('extdata', package='praatpicture') soundFile <- paste0(datapath, '/1.wav') praatpicture(soundFile, draw_lines=c('spectrogram', h=seq(0,5000,by=1000), lty='dashed'))
# Don't use directly datapath <- system.file('extdata', package='praatpicture') soundFile <- paste0(datapath, '/1.wav') praatpicture(soundFile, draw_lines=c('spectrogram', h=seq(0,5000,by=1000), lty='dashed'))
Helper function for drawing rectangles on plot components made with
praatpicture. Do not use directly, instead use praatpicture with the
draw_rectangle
argument.
draw_rectangle(plot_component, args)
draw_rectangle(plot_component, args)
plot_component |
String giving the name of the plot component to draw on. |
args |
A list of vectors giving arguments used for drawing rectangles. See praatpicture documentation. |
No return values, called internally by praatpicture and sibling functions.
# Don't use directly datapath <- system.file('extdata', package='praatpicture') soundFile <- paste0(datapath, '/1.wav') praatpicture(soundFile, draw_rectangle=c('spectrogram', 0.1, 500, 0.4, 2000))
# Don't use directly datapath <- system.file('extdata', package='praatpicture') soundFile <- paste0(datapath, '/1.wav') praatpicture(soundFile, draw_rectangle=c('spectrogram', 0.1, 500, 0.4, 2000))
Generate plots in the style of Praat Pictures from sound files and annotations in an EMU database.
emupicture( db_handle, session = "0000", bundle, pitch_ssffExt = NULL, formant_ssffExt = NULL, intensity_ssffExt = NULL, talking = FALSE, ... )
emupicture( db_handle, session = "0000", bundle, pitch_ssffExt = NULL, formant_ssffExt = NULL, intensity_ssffExt = NULL, talking = FALSE, ... )
db_handle |
The handle of an EMU database loaded into R. |
session |
String giving the name of the session where the sound file
to plot is located.
Default is |
bundle |
String giving the name of the bundle with the sound file to plot. |
pitch_ssffExt |
String giving the file extension for an SSFF track with
pitch data to plot. Default is |
formant_ssffExt |
String giving the file extension for an SSFF track
with formant data to plot. Default is |
intensity_ssffExt |
String giving the file extension for an SSFF track with intensity data to
plot. Default is |
talking |
Boolean; should a video be created with embedded audio, as
when using talking_praatpicture? Default is |
... |
Further arguments passed to praatpicture (or
talking_praatpicture if |
No return value, produces a plot or a video.
See praatpicture for more details on how to customize plots and talking_praatpicture for more details on how to customize videos.
# Create demo data and load demo database emuR::create_emuRdemoData(tempdir()) db_path <- paste0(tempdir(), '/emuR_demoData/ae_emuDB') db <- emuR::load_emuDB(db_path) emuR::list_bundles(db) emupicture(db, bundle='msajc003', tg_tiers=c('Text', 'Tone')) # Plot SSFF track data emuR::list_ssffTrackDefinitions(db) emupicture(db, bundle='msajc003', frames=c('sound', 'formant'), proportion=c(30,70), formant_ssffExt='fms', formant_number=4)
# Create demo data and load demo database emuR::create_emuRdemoData(tempdir()) db_path <- paste0(tempdir(), '/emuR_demoData/ae_emuDB') db <- emuR::load_emuDB(db_path) emuR::list_bundles(db) emupicture(db, bundle='msajc003', tg_tiers=c('Text', 'Tone')) # Plot SSFF track data emuR::list_ssffTrackDefinitions(db) emupicture(db, bundle='msajc003', frames=c('sound', 'formant'), proportion=c(30,70), formant_ssffExt='fms', formant_number=4)
Function for plotting formant objects called by praatpicture. Instead of
using this function directly, just use
praatpicture('my_sound_file', frames='formant')
.
formantplot( fm, start, end, tfrom0 = TRUE, tgbool = FALSE, lines = NULL, focusTierColor = "black", focusTierLineType = "dotted", dynamicRange = 30, freqRange = c(0, 5500), plotType = "speckle", color = "black", ind = NULL, min_max_only = FALSE, highlight = NULL, axisLabel = "Frequency (Hz)", drawSize = 1, speckleSize = 1 )
formantplot( fm, start, end, tfrom0 = TRUE, tgbool = FALSE, lines = NULL, focusTierColor = "black", focusTierLineType = "dotted", dynamicRange = 30, freqRange = c(0, 5500), plotType = "speckle", color = "black", ind = NULL, min_max_only = FALSE, highlight = NULL, axisLabel = "Frequency (Hz)", drawSize = 1, speckleSize = 1 )
fm |
Formant object loaded using rPraat::formant.read |
start |
Start time (in seconds) of desired plotted area. |
end |
End time (in seconds) of desired plotted area. |
tfrom0 |
Logical; should time on the x-axis run from 0 or from the
original time? Default is |
tgbool |
Logical; should dotted lines be plotted corresponding to
locations in a TextGrid? Default is |
lines |
Numeric vector giving locations in seconds of locations from
a TextGrid to be plotted with dotted lines. Default is |
focusTierColor |
String or vector of strings giving the color(s) to
use for plotting focus tier lines. If multiple tiers are focused, a vector
of the same length can be passed, and the nth tier will be plotted in the
nth color. Default is |
focusTierLineType |
String or vector of strings giving the line
type(s) for plotting focus tier lines. If multiple tiers are focused, a
vector of the same length can be passed, and the nth tier will be plotted in
the nth line type. Default is |
dynamicRange |
Dynamic range in dB for producing formant plots.
When a formant plot of |
freqRange |
Vector of two integers giving the frequency range to be
used for producing formant plots. Default is |
plotType |
String giving the type of formant plot to produce;
default is |
color |
String or vector of strings giving the name(s) of
colors to be used for plotting formants. If one color is provided, all
formants will be plotted in this color. If multiple colors are provided,
different formants will be shown in different colors. Default is |
ind |
Integer indexing waveform relative to other plot components.
Default is |
min_max_only |
Logical; should only minimum and maximum values be given
on the y-axis? Default is |
highlight |
Named list giving parameters for differential
highlighting of formants based on the time domain. This list
should contain information about which parts of the plot to highlight, either
done with the |
axisLabel |
String giving the name of the label to print along the
y-axis when plotting formants. Default is |
drawSize |
Number indicating the line width if
|
speckleSize |
Number indicating the point size of if |
No return values, called internally by praatpicture and sibling functions.
# Don't use directly datapath <- system.file('extdata', package='praatpicture') soundFile <- paste0(datapath, '/1.wav') praatpicture(soundFile, frames='formant')
# Don't use directly datapath <- system.file('extdata', package='praatpicture') soundFile <- paste0(datapath, '/1.wav') praatpicture(soundFile, frames='formant')
Function for plotting intensity objects called by praatpicture. Instead of
using this function directly, just use
praatpicture('my_sound_file', frames='intensity')
.
intensityplot( it, start, end, tfrom0 = TRUE, tgbool = FALSE, lines = NULL, focusTierColor = "black", focusTierLineType = "dotted", range = NULL, color = "black", ind = NULL, min_max_only = TRUE, highlight = NULL, axisLabel = "Intensity (dB)", drawSize = 1 )
intensityplot( it, start, end, tfrom0 = TRUE, tgbool = FALSE, lines = NULL, focusTierColor = "black", focusTierLineType = "dotted", range = NULL, color = "black", ind = NULL, min_max_only = TRUE, highlight = NULL, axisLabel = "Intensity (dB)", drawSize = 1 )
it |
IntensityTier object loaded using rPraat::it.read |
start |
Start time (in seconds) of desired plotted area. |
end |
End time (in seconds) of desired plotted area. |
tfrom0 |
Logical; should time on the x-axis run from 0 or from the
original time? Default is |
tgbool |
Logical; should dotted lines be plotted corresponding to
locations in a TextGrid? Default is |
lines |
Numeric vector giving locations in seconds of locations from
a TextGrid to be plotted with dotted lines. Default is |
focusTierColor |
String or vector of strings giving the color(s) to
use for plotting focus tier lines. If multiple tiers are focused, a vector
of the same length can be passed, and the nth tier will be plotted in the
nth color. Default is |
focusTierLineType |
String or vector of strings giving the line
type(s) for plotting focus tier lines. If multiple tiers are focused, a
vector of the same length can be passed, and the nth tier will be plotted in
the nth line type. Default is |
range |
Vector of two integers giving the intensity range to be
used for producing intensity plots. Default is |
color |
String giving the name of the color to be used for
plotting intensity. Default is |
ind |
Integer indexing waveform relative to other plot components.
Default is |
min_max_only |
Logical; should only minimum and maximum values be given
on the y-axis? Default is |
highlight |
Named list giving parameters for differential
highlighting of the intensity contour based on the time domain. This list
should contain information about which parts of the plot to highlight, either
done with the |
axisLabel |
String giving the name of the label to print along
the y-axis when plotting intensity. Default is |
drawSize |
Number indicating the line width of the intensity contour.
Default is |
No return values, called internally by praatpicture and sibling functions.
# Don't use directly datapath <- system.file('extdata', package='praatpicture') soundFile <- paste0(datapath, '/1.wav') praatpicture(soundFile, frames='intensity')
# Don't use directly datapath <- system.file('extdata', package='praatpicture') soundFile <- paste0(datapath, '/1.wav') praatpicture(soundFile, frames='intensity')
Helper function for annotating plot components made with
praatpicture. Do not use directly, instead use praatpicture with the
annotate
argument.
make_annot(plot_component, args)
make_annot(plot_component, args)
plot_component |
String giving the name of the plot component to annotate. |
args |
A list of vectors giving arguments used for annotating. See praatpicture documentation. |
No return values, called internally by praatpicture and sibling functions.
# Don't use directly datapath <- system.file('extdata', package='praatpicture') soundFile <- paste0(datapath, '/1.wav') praatpicture(soundFile, annotate=c('spectrogram', 0.25, 1500, 'An annotation'))
# Don't use directly datapath <- system.file('extdata', package='praatpicture') soundFile <- paste0(datapath, '/1.wav') praatpicture(soundFile, annotate=c('spectrogram', 0.25, 1500, 'An annotation'))
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()
.
make_TextGrid( sound, tierNames, start = 0, end = 0, audioInViewer = TRUE, show = "wave", channel = 1, sampa2ipa = FALSE )
make_TextGrid( sound, tierNames, start = 0, end = 0, audioInViewer = TRUE, show = "wave", channel = 1, sampa2ipa = FALSE )
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 |
end |
End time (in seconds) of desired plotted area. Default is |
audioInViewer |
Logical; should audio be playable from the Viewer pane in RStudio? |
show |
String giving the type of plot to show. Default is |
channel |
Number indicating which audio channel to show. Default is |
sampa2ipa |
Logical; should SAMPA transcriptions be converted to IPA?
Default is |
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.
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
.
make_TextGrid()
is largely a wrapper around the function
tg_createTier()
which does most of the work.
## 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)
## 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)
Function for plotting pitch objects called by praatpicture. Instead of
using this function directly, just use
praatpicture('my_sound_file', frames='pitch')
.
pitchplot( pt, start, end, tfrom0 = TRUE, tgbool = FALSE, lines = NULL, focusTierColor = "black", focusTierLineType = "dotted", plotType = "draw", scale = "hz", freqRange = NULL, semitonesRe = 100, color = "black", ind = NULL, min_max_only = TRUE, highlight = NULL, axisLabel = NULL, drawSize = 1, speckleSize = 1 )
pitchplot( pt, start, end, tfrom0 = TRUE, tgbool = FALSE, lines = NULL, focusTierColor = "black", focusTierLineType = "dotted", plotType = "draw", scale = "hz", freqRange = NULL, semitonesRe = 100, color = "black", ind = NULL, min_max_only = TRUE, highlight = NULL, axisLabel = NULL, drawSize = 1, speckleSize = 1 )
pt |
PitchTier object loaded using rPraat::pt.read |
start |
Start time (in seconds) of desired plotted area. |
end |
End time (in seconds) of desired plotted area. |
tfrom0 |
Logical; should time on the x-axis run from 0 or from the
original time? Default is |
tgbool |
Logical; should dotted lines be plotted corresponding to
locations in a TextGrid? Default is |
lines |
Numeric vector giving locations in seconds of locations from
a TextGrid to be plotted with dotted lines. Default is |
focusTierColor |
String or vector of strings giving the color(s) to
use for plotting focus tier lines. If multiple tiers are focused, a vector
of the same length can be passed, and the nth tier will be plotted in the
nth color. Default is |
focusTierLineType |
String or vector of strings giving the line
type(s) for plotting focus tier lines. If multiple tiers are focused, a
vector of the same length can be passed, and the nth tier will be plotted in
the nth line type. Default is |
plotType |
String giving the type of pitch plot to produce; default
is |
scale |
String giving the frequency scale to use when producing
pitch plots. Default is |
freqRange |
Vector of two integers giving the frequency range to be
used for producing pitch plots. Default is |
semitonesRe |
Frequency in Hz giving the reference level for converting
pitch frequency to semitones. Default is |
color |
String giving the name of the color to be used for
plotting pitch. Default is |
ind |
Integer indexing waveform relative to other plot components.
Default is |
min_max_only |
Logical; should only minimum and maximum values be given
on the y-axis? Default is |
highlight |
Named list giving parameters for differential
highlighting of pitch based on the time domain. This list
should contain information about which parts of the plot to highlight, either
done with the |
axisLabel |
String giving the name of the label to print along the
y-axis when printing a pitch track. Default is |
drawSize |
Number indicating the line width if
|
speckleSize |
Number indicating the point size of if |
No return values, called internally by praatpicture and sibling functions.
# Don't use directly datapath <- system.file('extdata', package='praatpicture') soundFile <- paste0(datapath, '/1.wav') praatpicture(soundFile, frames='pitch')
# Don't use directly datapath <- system.file('extdata', package='praatpicture') soundFile <- paste0(datapath, '/1.wav') praatpicture(soundFile, frames='pitch')
Animate some aspect of a Praat Picture-style plot of acoustic data, potentially aligned with transcriptions.
praatanimation( sound, width = 1080, height = 720, frameRate = 24, n_frames = 50, loop = TRUE, outputFile = NULL, outputFormat = "gif", useViewer = TRUE, verbose = TRUE, pointsize = 25, start = 0, end = 0, spec_freqRange = c(0, 5000), spec_windowLength = 0.005, spec_dynamicRange = 50, spec_timeStep = 1000, pitch_timeStep = NULL, pitch_floor = 50, pitch_ceiling = 600, pitch_freqRange = c(50, 500), pitch_semitonesRe = 100, formant_timeStep = NULL, formant_windowLength = 0.025, formant_dynamicRange = 30, formant_freqRange = c(50, 5500), intensity_timeStep = NULL, intensity_minPitch = 100, intensity_range = NULL, ... )
praatanimation( sound, width = 1080, height = 720, frameRate = 24, n_frames = 50, loop = TRUE, outputFile = NULL, outputFormat = "gif", useViewer = TRUE, verbose = TRUE, pointsize = 25, start = 0, end = 0, spec_freqRange = c(0, 5000), spec_windowLength = 0.005, spec_dynamicRange = 50, spec_timeStep = 1000, pitch_timeStep = NULL, pitch_floor = 50, pitch_ceiling = 600, pitch_freqRange = c(50, 500), pitch_semitonesRe = 100, formant_timeStep = NULL, formant_windowLength = 0.025, formant_dynamicRange = 30, formant_freqRange = c(50, 5500), intensity_timeStep = NULL, intensity_minPitch = 100, intensity_range = NULL, ... )
sound |
String giving the file name of a sound file with the .wav extension. |
width |
Number giving the desired width of the resulting animation in
pixels; default is |
height |
Number giving the desired height of the resulting animation in
pixels; default is |
frameRate |
Number giving the desired frame rate of the resulting
animation in Hz; default is |
n_frames |
Number giving the desired number of frames of the resulting
animation; default is |
loop |
Logical; should the animation be looped? Default is |
outputFile |
String giving the desired file name of the animation.
Default is |
outputFormat |
String giving the desired file type; default is |
useViewer |
Logical; should the animation be shown in the Viewer pane in
RStudio? Default is |
verbose |
Logical; should status messages be printed in the console as
figures are being generated? Default is |
pointsize |
Number; which point size should be used for text in the
animation? Default is |
start |
Start time (in seconds) of desired plotted area. Default is |
end |
End time (in seconds) of desired plotted area. Default is |
spec_freqRange |
Vector of two integers giving the frequency range to be
used for plotting spectrograms. Default is |
spec_windowLength |
Window length in seconds for generating spectrograms.
Default is |
spec_dynamicRange |
Dynamic range in dB for generating spectrograms. The
maximum intensity minus |
spec_timeStep |
How many time steps should be calculated for spectrograms?
Default is |
pitch_timeStep |
Measurement interval in seconds for tracking pitch.
Default is |
pitch_floor |
Frequency in Hz; no pitch candidates considered below
this frequency. Default is |
pitch_ceiling |
Frequency in Hz; no pitch candidates considered above
this frequency. Default is |
pitch_freqRange |
Vector of two integers giving the frequency range to be
used for producing pitch plots. Default is |
pitch_semitonesRe |
Frequency in Hz giving the reference level for
converting pitch frequency to semitones. Default is |
formant_timeStep |
Measurement interval in seconds for tracking formants.
Default is |
formant_windowLength |
The effective duration of the analysis window used for tracking formants in seconds; the actual duration of the analysis window is twice this value. Alternatively, a vector giving the first and last window lengths to be used in the animation. |
formant_dynamicRange |
Dynamic range in dB for producing formant plots.
When a formant plot of |
formant_freqRange |
Vector of two integers giving the frequency range to
be used for producing formant plots. Default is |
intensity_timeStep |
Measurement interval in seconds for tracking
intensity. Default is |
intensity_minPitch |
Lowest pitch in Hz used when calculating
intensity; default is |
intensity_range |
Vector of two integers giving the intensity range to be
used for producing intensity plots. Default is |
... |
Further arguments passed to |
No return value, produces an animated figure.
This function is a wrapper for either gifski::save_gif()
or av::av_capture_graphics()
used to
produce animations based on praatpicture()
. For more detail on your
options, see the praatpicture()
help file.
## Not run: datapath <- system.file('extdata', package='praatpicture') soundFile <- paste0(datapath, '/1.wav') # Show increasing frequency range praatanimation(soundFile, spec_freqRange=c(0,0,4000,12000)) # Transition from narrowband to broadband spectrogram praatanimation(soundFile, spec_windowLength=c(0.005,0.03)) # Etc. ## End(Not run)
## Not run: datapath <- system.file('extdata', package='praatpicture') soundFile <- paste0(datapath, '/1.wav') # Show increasing frequency range praatanimation(soundFile, spec_freqRange=c(0,0,4000,12000)) # Transition from narrowband to broadband spectrogram praatanimation(soundFile, spec_windowLength=c(0.005,0.03)) # Etc. ## End(Not run)
Generate plots of acoustic data aligned with transcriptions similar to those made with Praat Picture. The default is to produce a plot with a relatively small waveform, somewhat larger spectrogram, and the first tier of a TextGrid.
praatpicture( sound, start = 0, end = 0, tfrom0 = TRUE, tUnit = "s", frames = c("sound", "spectrogram", "TextGrid"), proportion = c(30, 50, 20), mainTitle = "", mainTitleAlignment = 0, start_end_only = TRUE, min_max_only = TRUE, drawSize = 1, speckleSize = 1, wave_channels = "all", wave_channelNames = FALSE, wave_color = "black", wave_lineWidth = 1, wave_highlight = NULL, tg_obj = NULL, tg_file = NULL, tg_tiers = "all", tg_focusTier = tg_tiers[1], tg_focusTierColor = "black", tg_focusTierLineType = "dotted", tg_tierNames = TRUE, tg_alignment = "central", tg_edgeLabels = "keep", tg_specialChar = FALSE, tg_color = "black", tg_highlight = NULL, spec_channel = NULL, spec_freqRange = c(0, 5000), spec_windowLength = 0.005, spec_dynamicRange = 50, spec_timeStep = 1000, spec_windowShape = "Gaussian", spec_colors = c("white", "black"), spec_axisLabel = "Frequency (Hz)", spec_highlight = NULL, pitch_timeStep = NULL, pitch_floor = 75, pitch_ceiling = 600, pitch_plotType = "draw", pitch_scale = "hz", pitch_freqRange = NULL, pitch_semitonesRe = 100, pitch_color = "black", pitch_plotOnSpec = FALSE, pitch_ssff = NULL, pitch_axisLabel = NULL, pitch_highlight = NULL, formant_timeStep = NULL, formant_maxN = 5, formant_windowLength = 0.025, formant_dynamicRange = 30, formant_freqRange = c(50, 5500), formant_number = NULL, formant_plotType = "speckle", formant_color = "black", formant_plotOnSpec = FALSE, formant_ssff = NULL, formant_axisLabel = "Frequency (Hz)", formant_highlight = NULL, intensity_timeStep = NULL, intensity_minPitch = 100, intensity_range = NULL, intensity_color = "black", intensity_plotOnSpec = FALSE, intensity_ssff = NULL, intensity_axisLabel = "Intensity (dB)", intensity_highlight = NULL, time_axisLabel = NULL, highlight = NULL, draw_lines = list("formant", h = seq(0, 10000, by = 1000), lty = "dotted"), draw_rectangle = NULL, draw_arrow = NULL, annotate = NULL, gender = "u", ... )
praatpicture( sound, start = 0, end = 0, tfrom0 = TRUE, tUnit = "s", frames = c("sound", "spectrogram", "TextGrid"), proportion = c(30, 50, 20), mainTitle = "", mainTitleAlignment = 0, start_end_only = TRUE, min_max_only = TRUE, drawSize = 1, speckleSize = 1, wave_channels = "all", wave_channelNames = FALSE, wave_color = "black", wave_lineWidth = 1, wave_highlight = NULL, tg_obj = NULL, tg_file = NULL, tg_tiers = "all", tg_focusTier = tg_tiers[1], tg_focusTierColor = "black", tg_focusTierLineType = "dotted", tg_tierNames = TRUE, tg_alignment = "central", tg_edgeLabels = "keep", tg_specialChar = FALSE, tg_color = "black", tg_highlight = NULL, spec_channel = NULL, spec_freqRange = c(0, 5000), spec_windowLength = 0.005, spec_dynamicRange = 50, spec_timeStep = 1000, spec_windowShape = "Gaussian", spec_colors = c("white", "black"), spec_axisLabel = "Frequency (Hz)", spec_highlight = NULL, pitch_timeStep = NULL, pitch_floor = 75, pitch_ceiling = 600, pitch_plotType = "draw", pitch_scale = "hz", pitch_freqRange = NULL, pitch_semitonesRe = 100, pitch_color = "black", pitch_plotOnSpec = FALSE, pitch_ssff = NULL, pitch_axisLabel = NULL, pitch_highlight = NULL, formant_timeStep = NULL, formant_maxN = 5, formant_windowLength = 0.025, formant_dynamicRange = 30, formant_freqRange = c(50, 5500), formant_number = NULL, formant_plotType = "speckle", formant_color = "black", formant_plotOnSpec = FALSE, formant_ssff = NULL, formant_axisLabel = "Frequency (Hz)", formant_highlight = NULL, intensity_timeStep = NULL, intensity_minPitch = 100, intensity_range = NULL, intensity_color = "black", intensity_plotOnSpec = FALSE, intensity_ssff = NULL, intensity_axisLabel = "Intensity (dB)", intensity_highlight = NULL, time_axisLabel = NULL, highlight = NULL, draw_lines = list("formant", h = seq(0, 10000, by = 1000), lty = "dotted"), draw_rectangle = NULL, draw_arrow = NULL, annotate = NULL, gender = "u", ... )
sound |
String giving the file name of a sound file with the .wav extension. |
start |
Start time (in seconds) of desired plotted area. Default is |
end |
End time (in seconds) of desired plotted area. Default is |
tfrom0 |
Logical; should time on the x-axis run from 0 or from the
original time? Default is |
tUnit |
String giving the unit of time to print along the x-axis.
Possible options are |
frames |
String or vector of strings giving the frames that the plot
should consist of. Default is |
proportion |
Integer or vector of integers of the same size as |
mainTitle |
String giving a title to print at the top of the plot. The default is an empty string, i.e. no title. |
mainTitleAlignment |
Number indicating the vertical alignment of the
plot title, where |
start_end_only |
Logical; should there only be ticks on the x-axis
for start and end times? Default is |
min_max_only |
Logical; should only minimum and maximum values be given
on the y-axis? Default is |
drawSize |
Number indicating the line width of plot components where
the |
speckleSize |
Number indicating the point size of plot components where
the |
wave_channels |
Vector of numbers or strings giving either numeric
identifiers of audio channels to plot of the names of audio channels to plot.
Also understands |
wave_channelNames |
Should names of audio channels be printed
on the y-axis? If |
wave_color |
String giving the name of the color to be used for plotting
the waveform. Default is |
wave_lineWidth |
Number giving the line width to use for plotting
the waveform. Default is |
wave_highlight |
Named list giving parameters for differential
highlighting of the waveform based on the time domain. This list
should contain information about which parts of the plot to highlight, either
done with the |
tg_obj |
A TextGrid object returned by the |
tg_file |
Path of file to be used for plotting TextGrid. Default is
|
tg_tiers |
Vector of numbers or strings giving either numeric identifiers
of TextGrid tiers to plot or the names of TextGrid tiers to plot. Also
understands |
tg_focusTier |
For which tier(s) should lines be shown on all
acoustic plots giving the locations of boundaries? Vector of number or
strings giving either numeric identifiers
of TextGrid tiers or the names of TextGrid tiers to plot. Default is
|
tg_focusTierColor |
String or vector of strings giving the color(s) to
use for plotting focus tier lines. If multiple tiers are focused, a vector
of the same length can be passed, and the nth tier will be plotted in the
nth color. Default is |
tg_focusTierLineType |
String or vector of strings giving the line
type(s) for plotting focus tier lines. If multiple tiers are focused, a
vector of the same length can be passed, and the nth tier will be plotted in
the nth line type. Default is |
tg_tierNames |
Logical; should TextGrid tier names be printed along the
y-axis? Default is |
tg_alignment |
String giving the desired alignment of text in the
TextGrids. Default is |
tg_edgeLabels |
String specifying how to handle TextGrid labels in
interval tiers that fall partially before |
tg_specialChar |
Logical; should Praat typesetting for special font types
such as italic, bold, and small caps be converted into corresponding
R-readable special font types. Default is |
tg_color |
String or vector of strings giving the name of the color(s)
to be used for the text in TextGrids. Default is |
tg_highlight |
Named list giving parameters for differential
highlighting of TextGrid intervals. This list
should contain information about which intervals to highlight, using the
|
spec_channel |
Numeric giving the channel that should be used to
generate the spectrogram. Default is |
spec_freqRange |
Vector of two integers giving the frequency range to be
used for plotting spectrograms. Default is |
spec_windowLength |
Window length in seconds for generating spectrograms.
Default is |
spec_dynamicRange |
Dynamic range in dB for generating spectrograms. The
maximum intensity minus |
spec_timeStep |
How many time steps should be calculated for spectrograms?
Default is |
spec_windowShape |
String giving the name of the window shape to be
applied to the signal when generating spectrograms. Default is |
spec_colors |
Vector of strings giving the names of colors to be used
for plotting the spectrogram; default is |
spec_axisLabel |
String giving the name of the label to print along the
y-axis when plotting a spectrogram. Default is |
spec_highlight |
Named list giving parameters for differential
highlighting of the spectrogram based on the time domain. This list
should contain information about which parts of the plot to highlight, either
done with the |
pitch_timeStep |
Measurement interval in seconds for tracking pitch.
Default is |
pitch_floor |
Frequency in Hz; no pitch candidates considered below
this frequency. Default is |
pitch_ceiling |
Frequency in Hz; no pitch candidates considered above
this frequency. Default is |
pitch_plotType |
String giving the type of pitch plot to produce; default
is |
pitch_scale |
String giving the frequency scale to use when producing
pitch plots. Default is |
pitch_freqRange |
Vector of two integers giving the frequency range to be
used for producing pitch plots. Default is |
pitch_semitonesRe |
Frequency in Hz giving the reference level for
converting pitch frequency to semitones. Default is |
pitch_color |
String giving the name of the color to be used for
plotting pitch. Default is |
pitch_plotOnSpec |
Boolean; should pitch be plotted on top of
spectrogram? Default is |
pitch_ssff |
An object of class |
pitch_axisLabel |
String giving the name of the label to print along the
y-axis when printing a pitch track. Default is |
pitch_highlight |
Named list giving parameters for differential
highlighting of pitch based on the time domain. This list
should contain information about which parts of the plot to highlight, either
done with the |
formant_timeStep |
Measurement interval in seconds for tracking formants.
Default is |
formant_maxN |
Integer giving the maximum number of formants to track.
Default is |
formant_windowLength |
The effective duration of the analysis window used for tracking formants in seconds; the actual duration of the analysis window is twice this value. |
formant_dynamicRange |
Dynamic range in dB for producing formant plots.
When a formant plot of |
formant_freqRange |
Vector of two integers giving the frequency range to
be used for producing formant plots. Default is |
formant_number |
Number of formants to plot. Default is |
formant_plotType |
String giving the type of formant plot to produce;
default is |
formant_color |
String or vector of strings giving the name(s) of
colors to be used for plotting formants. If one color is provided, all
formants will be plotted in this color. If multiple colors are provided,
different formants will be shown in different colors. Default is |
formant_plotOnSpec |
Boolean; should formants be plotted on top of
spectrogram? Default is |
formant_ssff |
An object of class |
formant_axisLabel |
String giving the name of the label to print along the
y-axis when plotting formants. Default is |
formant_highlight |
Named list giving parameters for differential
highlighting of formants based on the time domain. This list
should contain information about which parts of the plot to highlight, either
done with the |
intensity_timeStep |
Measurement interval in seconds for tracking
intensity. Default is |
intensity_minPitch |
Lowest pitch in Hz used when calculating
intensity; default is |
intensity_range |
Vector of two integers giving the intensity range to be
used for producing intensity plots. Default is |
intensity_color |
String giving the name of the color to be used for
plotting intensity. Default is |
intensity_plotOnSpec |
Boolean; should intensity be plotted on top of
spectrogram? Default is |
intensity_ssff |
An object of class |
intensity_axisLabel |
String giving the name of the label to print along
the y-axis when plotting intensity. Default is |
intensity_highlight |
Named list giving parameters for differential
highlighting of the intensity contour based on the time domain. This list
should contain information about which parts of the plot to highlight, either
done with the |
time_axisLabel |
String giving the name of the label to print along
the x-axis. Default is |
highlight |
Named list giving parameters for differential highlighting
of part of the plot based on the time domain. This list should contain
information about which parts of the plot to highlight, either done with the
|
draw_lines |
Use for drawing straight lines on plot components. Takes
an argument of type |
draw_rectangle |
Use for drawing rectangles on plot components. A vector containing a) a string giving the plot component to draw a rectangle on, and b) arguments to pass on to graphics::rect. Alternatively a list of such vectors, if more rectangles should be drawn. If multiple audio channels are plotted and a rectangle should be added to one of these, use the channel identifier instead of a string giving the frame to draw on. |
draw_arrow |
Use for drawing arrows on plot components. A vector containing a) a string giving the plot component to draw an arrow on, and b) arguments to pass on to graphics::arrows. Alternatively a list of such vectors, if more arrows should be drawn. If multiple audio channels are plotted and an arrow should be added to one of these, use the channel identifier instead of a string giving the frame to draw on. |
annotate |
Use for annotating plot components. A vector containing a) a string giving the plot component to annotate, and b) arguments to pass on to graphics::text. Alternatively a list of such vectors, if more annotations should be made. If multiple audio channels are plotted and annotations should be added to one of these, use the channel identifier instead of a string giving the frame to draw on. |
gender |
String indicating the gender of the speaker; default is
|
... |
Further global plotting arguments passed on to |
When available, pitch, formant, and intensity tracks are loaded
from Praat files with the same base name as sound
; i.e., if your sound
file is called 1.wav
and there is a Praat file called 1.Formant
in the
same directory, this file is used for plotting formants. Pitch files should
have either the PitchTier
or Pitch
extension, and intensity files should
have the IntensityTier
extension.
If no such files are available, the signal processing tools in the wrassp
package are used; pitch is tracked with the function wrassp::ksvF0,
formants are tracked with wrassp::forest, and intensity is tracked with
wrassp::rmsana. Parameters are set to mimic Praat as closely as possible,
e.g. using a Gaussian-like window shape KAISER2_0
, but results will differ
from Praat simply because the tracking algorithms differ; as far as I know,
the Burg algorithm used by Praat for tracking formants isn't implemented in R,
nor is the autocorrelation method for tracking pitch.
Spectrograms are generated with the function phonTools::spectrogram. The code portion that actually adds the spectrogram to a plot is based on phonTools::plot.spectrogram but rewritten to use a bitmap raster for rendering the image if the graphics device allows for it, which significantly speeds up rendering the spectrogram.
No return value, produces a figure.
datapath <- system.file('extdata', package='praatpicture') soundFile <- paste0(datapath, '/1.wav') praatpicture(soundFile)
datapath <- system.file('extdata', package='praatpicture') soundFile <- paste0(datapath, '/1.wav') praatpicture(soundFile)
Interactive version of praatpicture
shiny_praatpicture()
shiny_praatpicture()
No return values
## Not run: shiny_praatpicture() ## End(Not run)
## Not run: shiny_praatpicture() ## End(Not run)
Function for plotting spectrograms called by praatpicture. Instead of using
this function directly, just use
praatpicture('my_sound_file', frames='spectrogram')
.
specplot( sig, sr, t, start, end, tfrom0 = TRUE, freqRange = c(0, 5000), windowLength = 0.005, dynamicRange = 60, timeStep = 1000, windowShape = "Gaussian", colors = c("white", "black"), pitch_plotOnSpec = FALSE, pt = NULL, pitch_plotType = "draw", pitch_scale = "hz", pitch_freqRange = NULL, pitch_axisLabel = NULL, pitch_color = "black", pitch_highlight = NULL, formant_plotOnSpec = FALSE, fm = NULL, formant_plotType = "speckle", formant_dynamicRange = 30, formant_color = "black", formant_highlight = NULL, intensity_plotOnSpec = FALSE, it = NULL, intensity_range = NULL, intensity_axisLabel = "Intensity (dB)", intensity_color = "black", intensity_highlight = NULL, tgbool = FALSE, lines = NULL, focusTierColor = "black", focusTierLineType = "dotted", ind = NULL, min_max_only = TRUE, highlight = NULL, axisLabel = "Frequency (Hz)", drawSize = 1, speckleSize = 1 )
specplot( sig, sr, t, start, end, tfrom0 = TRUE, freqRange = c(0, 5000), windowLength = 0.005, dynamicRange = 60, timeStep = 1000, windowShape = "Gaussian", colors = c("white", "black"), pitch_plotOnSpec = FALSE, pt = NULL, pitch_plotType = "draw", pitch_scale = "hz", pitch_freqRange = NULL, pitch_axisLabel = NULL, pitch_color = "black", pitch_highlight = NULL, formant_plotOnSpec = FALSE, fm = NULL, formant_plotType = "speckle", formant_dynamicRange = 30, formant_color = "black", formant_highlight = NULL, intensity_plotOnSpec = FALSE, it = NULL, intensity_range = NULL, intensity_axisLabel = "Intensity (dB)", intensity_color = "black", intensity_highlight = NULL, tgbool = FALSE, lines = NULL, focusTierColor = "black", focusTierLineType = "dotted", ind = NULL, min_max_only = TRUE, highlight = NULL, axisLabel = "Frequency (Hz)", drawSize = 1, speckleSize = 1 )
sig |
Numeric vector corresponding to a sound signal. |
sr |
Integer giving the sampling rate of the signal. |
t |
Numeric vector giving times corresponding to the signal. |
start |
Start time (in seconds) of desired plotted area. |
end |
End time (in seconds) of desired plotted area. |
tfrom0 |
Logical; should time on the x-axis run from 0 or from the
original time? Default is |
freqRange |
Vector of two integers giving the frequency range to be
used for plotting spectrograms. Default is |
windowLength |
Window length in seconds for generating spectrograms.
Default is |
dynamicRange |
Dynamic range in dB for generating spectrograms. The
maximum intensity minus |
timeStep |
How many time steps should be calculated for spectrograms?
Default is |
windowShape |
String giving the name of the window shape to be applied
to the signal when generating spectrograms. Default is |
colors |
Vector of strings giving the names of colors to be used
for plotting the spectrogram; default is |
pitch_plotOnSpec |
Boolean; should pitch be plotted on top of
spectrogram? Default is |
pt |
Pitch object loaded using rPraat::pt.read or similar object. |
pitch_plotType |
String giving the type of pitch plot to produce; default
is |
pitch_scale |
String giving the frequency scale to use when producing
pitch plots. Default is |
pitch_freqRange |
Vector of two integers giving the frequency range to be
used for producing pitch plots. Default is |
pitch_axisLabel |
String giving the name of the label to print along the
y-axis when printing a pitch track. Default is |
pitch_color |
String or vector of strings giving the name of the color
to be used for plotting pitch. Default is |
pitch_highlight |
Named list giving parameters for differential
highlighting of pitch based on the time domain. This list
should contain information about which parts of the plot to highlight, either
done with the |
formant_plotOnSpec |
Boolean; should formants be plotted on top of
spectrogram? Default is |
fm |
Formant object loaded using rPraat::formant.read or similar object. |
formant_plotType |
String giving the type of formant plot to produce;
default is |
formant_dynamicRange |
Dynamic range in dB for producing formant plots.
When a formant plot of |
formant_color |
String or vector of strings giving the name(s) of
colors to be used for plotting formants. If one color is provided, all
formants will be plotted in this color. If multiple colors are provided,
different formants will be shown in different colors. Default is |
formant_highlight |
Named list giving parameters for differential
highlighting of formants based on the time domain. This list
should contain information about which parts of the plot to highlight, either
done with the |
intensity_plotOnSpec |
Boolean; should intensity be plotted on top of
spectrogram? Default is |
it |
Intensity object loaded using rPraat::it.read or similar object. |
intensity_range |
Vector of two integers giving the intensity range to be
used for producing intensity plots. Default is |
intensity_axisLabel |
String giving the name of the label to print along
the y-axis when plotting intensity. Default is |
intensity_color |
String or vector of strings giving the name of the
color to be used for plotting intensity. Default is |
intensity_highlight |
Named list giving parameters for differential
highlighting of the intensity contour based on the time domain. This list
should contain information about which parts of the plot to highlight, either
done with the |
tgbool |
Logical; should dotted lines be plotted corresponding to
locations in a TextGrid? Default is |
lines |
Numeric vector giving locations in seconds of locations from
a TextGrid to be plotted with dotted lines. Default is |
focusTierColor |
String or vector of strings giving the color(s) to
use for plotting focus tier lines. If multiple tiers are focused, a vector
of the same length can be passed, and the nth tier will be plotted in the
nth color. Default is |
focusTierLineType |
String or vector of strings giving the line
type(s) for plotting focus tier lines. If multiple tiers are focused, a
vector of the same length can be passed, and the nth tier will be plotted in
the nth line type. Default is |
ind |
Integer indexing waveform relative to other plot components.
Default is |
min_max_only |
Logical; should only minimum and maximum values be given
on the y-axis? Default is |
highlight |
Named list giving parameters for differential
highlighting of the spectrogram based on the time domain. This list
should contain information about which parts of the plot to highlight, either
done with the |
axisLabel |
String giving the name of the label to print along the
y-axis when plotting a spectrogram. Default is |
drawSize |
Number indicating the line width of plot components where
the |
speckleSize |
Number indicating the point size of plot components where
the |
No return values, called internally by praatpicture and sibling functions.
# Don't use directly datapath <- system.file('extdata', package='praatpicture') soundFile <- paste0(datapath, '/1.wav') praatpicture(soundFile, frames='spectrogram')
# Don't use directly datapath <- system.file('extdata', package='praatpicture') soundFile <- paste0(datapath, '/1.wav') praatpicture(soundFile, frames='spectrogram')
Generate simple MP4 video files with Praat Picture style plots of acoustic data with time-aligned transcriptions and embedded audio to use in presentations etc.
talking_praatpicture( sound, start = 0, end = 0, audio_start = start, audio_end = end, width = 1080, height = 720, pointsize = 25, outputFile = "praatvid.mp4", useViewer = TRUE, ... )
talking_praatpicture( sound, start = 0, end = 0, audio_start = start, audio_end = end, width = 1080, height = 720, pointsize = 25, outputFile = "praatvid.mp4", useViewer = TRUE, ... )
sound |
String giving the file name of a sound file with the .wav extension. |
start |
Start time (in seconds) of desired plotted area. Default is |
end |
End time (in seconds) of desired plotted area. Default is |
audio_start |
Start time (in seconds) of embedded audio. By default
it is the same as |
audio_end |
End time (in seconds) of embedded audio. By default it is
the same as |
width |
Number giving the desired width of the resulting animation in
pixels; default is |
height |
Number giving the desired height of the resulting animation in
pixels; default is |
pointsize |
Number; which point size should be used for text in the
animation? Default is |
outputFile |
String giving the desired file name. Default is
|
useViewer |
Logical; should the video be shown in the Viewer pane in
RStudio? Default is |
... |
Further arguments passed to |
No return value, produces a video file.
This function is a wrapper for av::av_capture_graphics()
used to
produce plots similar to those made with praatpicture()
with embedded
audio. For more detail on your
options, see the praatpicture()
help file.
## Not run: datapath <- system.file('extdata', package='praatpicture') soundFile <- paste0(datapath, '/1.wav') talking_praatpicture(soundFile) ## End(Not run)
## Not run: datapath <- system.file('extdata', package='praatpicture') soundFile <- paste0(datapath, '/1.wav') talking_praatpicture(soundFile) ## End(Not run)
Function for creating TextGrid tiers called by make_TextGrid. Instead of using this function directly, use make_TextGrid.
tg_createTier( sound, tierName, start = 0, end = 0, show = "wave", channel = 1, sampa2ipa = FALSE )
tg_createTier( sound, tierName, start = 0, end = 0, show = "wave", channel = 1, sampa2ipa = FALSE )
sound |
String giving the file name of a sound file with the .wav extension. |
tierName |
String giving the name of the tier. |
start |
Start time (in seconds) of desired plotted area. Default is |
end |
End time (in seconds) of desired plotted area. Default is |
show |
String giving the type of plot to show. Default is |
channel |
Number indicating which audio channel to show. Default is |
sampa2ipa |
Logical; should SAMPA transcriptions be converted to IPA?
Default is |
A list object identical to a single tier created by
rPraat::tg.read()
when
loading TextGrid objects into R.
## Not run: # Don't use directly datapath <- system.file('extdata', package='praatpicture') soundFile <- paste0(datapath, '/2.wav') tg <- make_TextGrid(soundFile, tierNames='Mary') # Follow the steps shown in the console praatpicture(soundFile, tg_obj=tg) ## End(Not run)
## Not run: # Don't use directly datapath <- system.file('extdata', package='praatpicture') soundFile <- paste0(datapath, '/2.wav') tg <- make_TextGrid(soundFile, tierNames='Mary') # Follow the steps shown in the console praatpicture(soundFile, tg_obj=tg) ## End(Not run)
Helper function for converting Praat font styles such as italics, bold,
and small caps into expressions that can be read by base R plots.
Instead of using
this function directly, just use
praatpicture('my_sound_file', frames='TextGrid', tg_specialChar=TRUE)
.
tg_stylize(lab)
tg_stylize(lab)
lab |
A string or vector of strings with labels from a TextGrid. |
A list with elements of class expression
.
# Don't use directly datapath <- system.file('extdata', package='praatpicture') soundFile <- paste0(datapath, '/1.wav') # With stylized text praatpicture(soundFile, frames='TextGrid') # Without stylized text praatpicture(soundFile, frames='TextGrid', tg_specialChar=FALSE)
# Don't use directly datapath <- system.file('extdata', package='praatpicture') soundFile <- paste0(datapath, '/1.wav') # With stylized text praatpicture(soundFile, frames='TextGrid') # Without stylized text praatpicture(soundFile, frames='TextGrid', tg_specialChar=FALSE)
Function for plotting TextGrids called by praatpicture. Instead of using
this function directly, just use
praatpicture('my_sound_file', frames='TextGrid')
.
tgplot( tg, t, sr, start, end, tiers = 1, tfrom0 = TRUE, tierNames = TRUE, alignment = "central", edgeLabels = "keep", specialChar = FALSE, color = "black", highlight = NULL )
tgplot( tg, t, sr, start, end, tiers = 1, tfrom0 = TRUE, tierNames = TRUE, alignment = "central", edgeLabels = "keep", specialChar = FALSE, color = "black", highlight = NULL )
tg |
TextGrid object loaded using rPraat::tg.read |
t |
Numeric vector giving times corresponding to the signal. |
sr |
Integer giving the sampling rate of the signal. |
start |
Start time (in seconds) of desired plotted area. |
end |
End time (in seconds) of desired plotted area. |
tiers |
Vector of number or strings giving either numeric identifiers
of TextGrid tiers to plot or the names of TextGrid tiers to plot. Default is
|
tfrom0 |
Logical; should time on the x-axis run from 0 or from the
original time? Default is |
tierNames |
Logical; should TextGrid tier names be printed along the
y-axis? Default is |
alignment |
String giving the desired alignment of text in the
TextGrids. Default is |
edgeLabels |
String specifying how to handle TextGrid labels in
interval tiers that fall partially before |
specialChar |
Logical; should Praat typesetting for special font types
such as italic, bold, and small caps be converted into corresponding
R-readable special font types. Default is |
color |
String or vector of strings giving the name of the color(s)
to be used for the text in TextGrids. Default is |
highlight |
Named list giving parameters for differential
highlighting of TextGrid intervals. This list
should contain information about which intervals to highlight, using the
|
No return values, called internally by praatpicture and sibling functions.
# Don't use directly datapath <- system.file('extdata', package='praatpicture') soundFile <- paste0(datapath, '/1.wav') praatpicture(soundFile, frames='TextGrid')
# Don't use directly datapath <- system.file('extdata', package='praatpicture') soundFile <- paste0(datapath, '/1.wav') praatpicture(soundFile, frames='TextGrid')
Function for plotting waveforms called by praatpicture. Instead of using
this function directly, just use
praatpicture('my_sound_file', frames='sound')
.
waveplot( sig, bit, t, nchan = 1, color = "black", tgbool = FALSE, lines = NULL, focusTierColor = "black", focusTierLineType = "dotted", ind = NULL, line_comp = NULL, rect_comp = NULL, arr_comp = NULL, annot_comp = NULL, draw_lines = NULL, draw_rectangle = NULL, draw_arrow = NULL, annotate = NULL, channelNames = FALSE, lineWidth = 1, cn = NULL, min_max_only = TRUE, highlight = NULL )
waveplot( sig, bit, t, nchan = 1, color = "black", tgbool = FALSE, lines = NULL, focusTierColor = "black", focusTierLineType = "dotted", ind = NULL, line_comp = NULL, rect_comp = NULL, arr_comp = NULL, annot_comp = NULL, draw_lines = NULL, draw_rectangle = NULL, draw_arrow = NULL, annotate = NULL, channelNames = FALSE, lineWidth = 1, cn = NULL, min_max_only = TRUE, highlight = NULL )
sig |
Numeric vector corresponding to a sound signal. |
bit |
Numeric; will generally be grabbed from a loaded |
t |
Numeric vector giving times corresponding to the signal. |
nchan |
Numeric; how many channels will be plotted? Default is |
color |
String giving the name of the color to be used for plotting
the waveform. Default is |
tgbool |
Logical; should dotted lines be plotted corresponding to
locations in a TextGrid? Default is |
lines |
Numeric vector giving locations in seconds of locations from
a TextGrid to be plotted with dotted lines. Default is |
focusTierColor |
String or vector of strings giving the color(s) to
use for plotting focus tier lines. If multiple tiers are focused, a vector
of the same length can be passed, and the nth tier will be plotted in the
nth color. Default is |
focusTierLineType |
String or vector of strings giving the line
type(s) for plotting focus tier lines. If multiple tiers are focused, a
vector of the same length can be passed, and the nth tier will be plotted in
the nth line type. Default is |
ind |
Integer indexing waveform relative to other plot components.
Default is |
line_comp |
Vector of strings or numbers giving plot components to draw
straight lines on. Default is |
rect_comp |
Vector of strings or numbers giving plot components to draw
rectangles on. Default is |
arr_comp |
Vector of strings of numbers giving plot components to draw
arrows on. Default is |
annot_comp |
Vector of strings of numbers giving plot components to
annotate. Default is |
draw_lines |
List of arguments for drawing straight lines passed from
|
draw_rectangle |
List of arguments for drawing rectangles passed from
|
draw_arrow |
List of arguments for drawing arrows passed from
|
annotate |
List of arguments for annotating passed from
|
channelNames |
Logical; should names of audio channels be printed on
the y-axis? Default is |
lineWidth |
Number giving the line width to use for plotting
the waveform. Default is |
cn |
Vector of strings with channel names to be printed on the y-axis
if |
min_max_only |
Logical; should only minimum and maximum values be given
on the y-axis? Default is |
highlight |
Named list giving parameters for differential
highlighting of the waveform based on the time domain. This list
should contain information about which parts of the plot to highlight, either
done with the |
No return values, called internally by praatpicture and sibling functions.
# Don't use directly datapath <- system.file('extdata', package='praatpicture') soundFile <- paste0(datapath, '/1.wav') praatpicture(soundFile, frames='sound')
# Don't use directly datapath <- system.file('extdata', package='praatpicture') soundFile <- paste0(datapath, '/1.wav') praatpicture(soundFile, frames='sound')