praatanimation {praatpicture} | R Documentation |
Make animations from Praat Picture-style plots of acoustic data
Description
Animate some aspect of a Praat Picture-style plot of acoustic data, potentially aligned with transcriptions.
Usage
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,
...
)
Arguments
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 |
Value
No return value, produces an animated figure.
See Also
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.
Examples
## 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)