Learn R Programming

⚠️There's a newer version (1.3.2-1) of this package.Take me there.

rPraat package for R

rPraat package for R constitutes an interface between the most popular software for phonetic analyses, Praat, and R.

Version 1.3.1

For demonstration, see html/rDemo.html

Package documentation https://github.com/bbTomas/rPraat/blob/master/rPraat.pdf

CRAN link: https://CRAN.R-project.org/package=rPraat

See also: mPraat toolbox for Matlab.

rPraat and mPraat homepage: https://fu.ff.cuni.cz/praat/

Installation

One-time installation (internet connection needed).

CRAN: official version

install.packages("rPraat")

GitHub: experimental, most recent version

install.packages("devtools")
devtools::install_github("bbTomas/rPraat")

Initialize and Test

At each R session, you have to initialize the package (no internet needed).

library(rPraat)
library(dplyr)   # optional, if you want to use the pipeline operator %>%

tg.sample() %>% tg.plot()  # demo test

How to cite this package?

We have invested a lot of time and effort in creating mPraat toolbox / rPraat package, please cite it when using it for data analysis.

Bořil, T., & Skarnitzl, R. (2016). Tools rPraat and mPraat. In P. Sojka, A. Horák, I. Kopeček, & K. Pala (Eds.), Text, Speech, and Dialogue (pp. 367–374). Springer International Publishing.

Download Tools rPraat and mPraat manuscript .pdf

The final publication is available at Springer via DOI 10.1007/978-3-319-45510-5_42

Download BibTeX reference mpraatrpraat2016.bib

What is new

v1.3.1 (2020/04/04): tg.plot(): can plot formant and pitch objects in frame and array formats

v1.3 (2019/12/04): tg.boundaryMagnet(): align interval boundaries in a target tier according to a pattern tier

v1.2.0-3 (2019/04/27): if “UTF-8” encoding is specified in .read() functions (i.e., default value) and input file cannot be read properly, then “auto” encoding is tried automatically with a warning message notification

v1.2.0-2 (2019/04/01): “UTF-16” TextGrids are properly saved in “UTF-8”

v1.2.0-1 (2019/03/16): detectEncoding(): removed “UTF-16LE” (does not work anymore), tg.read(fileName, encoding = “auto”) works again

v1.2.0 (2018/12/08): pitch.write(), formant.write(), col.write()

v1.1.4 (2018/12/08): pitch.cut(), formant.cut(), snd.cut(); pitch.cut0(), formant.cut0(), snd.cut0()

v1.1.3-4 (2018/12/03): snd.read(), snd.write(), snd.plot(), as.snd(); tg.plot() can plot TextGrid together with Sound object; it.plot() can plot IntensityTier together with Sound object

v1.1.3-3 (2018/12/03): formant.toFrame(), pitch.toArray(), pitch.toFrame(), pitch.plot(); tg.plot() can plot TextGrid together with Pitch object; pitch.plot() can plot Pitch object together with PitchTier

v1.1.3-2 (2018/10/29): formant.plot(), formant.toArray(); tg.plot() can plot TextGrid together with Formant object

v1.1.3-1 (2018/10/26): tg.plot() can plot TextGrid together with PitchTier and IntensityTier in one plot

v1.1.3 (2018/10/20): formant.read(), formant.sample(), as.formant(); col.read() can read formant objects

v1.1.2-1 (2018/10/20): tg.plot(): right-aligned labels; pitch.sample(), as.tg(), as.pt(), as.it(), as.pitch(); .read(), .sample() and tg.createNewTextGrid(): class(object)[“type”] set to “TextGrid”, “PitchTier” etc. and class(object)[“name”] set according to fileName

v1.1.2 (2018/08/04): tg.cut(), tg.cut0()

v1.1.1 (2018/08/02): IntensityTiers: it.read(), it.write(), it.plot(), it.sample(), it.interpolate(), it.cut(), it.cut0(), it.legendre(), it.legendreDemo(), it.legendreSynth(), col.read() supports IntensityTiers

v1.1.0 (2018/08/01): col.read() to read Collection in Text and Short-text format (Collection may store many objects in one file – TextGrids, PitchTiers, Pitch objects). Big thanks to Pol van Rijn for initiating this and making the major portion of the new code in mPraat toolbox. Supports for file encodings in all read functions (thanks to Weirong Chen for his DetectEncoding idea in mPraat toolbox).

v1.0.8-3 (2017/11/27): tg.write(): fix for possible UTF-8 encoding and Windows OS locale mismatch

v1.0.8-2 (2017/11/04): tg.write() and pt.write() format support: “text” (full text format), “short” (short text format), and in addition for pt: “spreadsheet” and “headerless”; tg.read(), pt.read() and pitch.read(): optional file encoding parameter (default: “UTF-8”)

v1.0.8-1 (2017/09/01): bugfix, short-text TextGrid with multiple lines in a label no longer produces “missing sppasFormat variable” error

v1.0.8 (2017/07/16): pitch.read() to read Pitch-object files with time frames of pitch candidates

v1.0.7 (2017/04/19): tg.findLabels(), tg.duplicateTierMergeSegments()

v1.0.6 (2017/04/11): pt.cut(), pt.cut0()

v1.0.5 (2017/04/10): pt.legendre(), pt.legendreSynth(), pt.legendreDemo()

v1.0.4 (2017/03/06): pt.interpolate(), pt.Hz2ST()

License

License: MIT

Copyright (c) 2016 Tomáš Bořil, borilt@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Copy Link

Version

Install

install.packages('rPraat')

Monthly Downloads

319

Version

1.3.1

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Tomas Boril

Last Published

April 4th, 2020

Functions in rPraat (1.3.1)

as.it

as.it
formant.toFrame

formant.toFrame
it.legendreDemo

it.legendreDemo
formant.toArray

formant.toArray
it.legendreSynth

it.legendreSynth
isString

isString
formant.cut0

formant.cut0
isNum

isNum
formant.plot

formant.plot
formant.write

formant.write
formant.read

formant.read
pitch.write

pitch.write
pitch.toFrame

pitch.toFrame
pt.cut0

pt.cut0
pt.interpolate

pt.interpolate
it.plot

it.plot
pitch.cut

pitch.cut
formant.sample

formant.sample
it.read

it.read
pitch.sample

pitch.sample
isInt

isInt
pt.Hz2ST

pt.Hz2ST
pitch.toArray

pitch.toArray
pitch.cut0

pitch.cut0
ifft

ifft
isLogical

isLogical
pt.read

pt.read
snd.sample

snd.sample
snd.read

snd.read
str_find

str_find
str_contains

str_contains
it.cut

it.cut
it.interpolate

it.interpolate
pt.cut

pt.cut
tg.getIntervalEndTime

tg.getIntervalEndTime
it.cut0

it.cut0
it.sample

it.sample
pt.sample

pt.sample
pitch.plot

pitch.plot
pt.legendreSynth

pt.legendreSynth
pitch.read

pitch.read
pt.plot

pt.plot
it.legendre

it.legendre
seqM

seqM
strTrim

strTrim
snd.cut

snd.cut
tg.cut0

tg.cut0
snd.write

snd.write
it.write

it.write
tg.getPointIndexHigherThanTime

tg.getPointIndexHigherThanTime
tg.getNumberOfTiers

tg.getNumberOfTiers
tg.getIntervalIndexAtTime

tg.getIntervalIndexAtTime
tg.insertPoint

tg.insertPoint
tg.read

tg.read
tg.getPointTime

tg.getPointTime
tg.getIntervalStartTime

tg.getIntervalStartTime
tg.getStartTime

tg.getStartTime
tg.duplicateTier

tg.duplicateTier
tg.getLabel

tg.getLabel
pt.write

pt.write
tg.createNewTextGrid

tg.createNewTextGrid
str_find1

str_find1
round2

round2
tg.isIntervalTier

tg.isIntervalTier
tg.removeTier

tg.removeTier
tg.removePoint

tg.removePoint
pt.legendreDemo

pt.legendreDemo
pt.legendre

pt.legendre
snd.cut0

snd.cut0
tg.removeIntervalBothBoundaries

tg.removeIntervalBothBoundaries
tg.cut

tg.cut
tg.duplicateTierMergeSegments

tg.duplicateTierMergeSegments
snd.plot

snd.plot
tg.setLabel

tg.setLabel
tg.sampleProblem

tg.sampleProblem
tg.getNumberOfIntervals

tg.getNumberOfIntervals
tg.boundaryMagnet

tg.boundaryMagnet
tg.findLabels

tg.findLabels
tg.checkTierInd

tg.checkTierInd
tg.getPointIndexLowerThanTime

tg.getPointIndexLowerThanTime
tg.isPointTier

tg.isPointTier
tg.plot

tg.plot
tg.getEndTime

tg.getEndTime
tg.countLabels

tg.countLabels
tg.getIntervalDuration

tg.getIntervalDuration
tg.getTierName

tg.getTierName
tg.getTotalDuration

tg.getTotalDuration
tg.repairContinuity

tg.repairContinuity
tg.sample

tg.sample
tg.getPointIndexNearestTime

tg.getPointIndexNearestTime
tg.insertNewPointTier

tg.insertNewPointTier
tg.insertInterval

tg.insertInterval
tg.insertBoundary

tg.insertBoundary
tg.insertNewIntervalTier

tg.insertNewIntervalTier
tg.getNumberOfPoints

tg.getNumberOfPoints
tg.removeIntervalLeftBoundary

tg.removeIntervalLeftBoundary
tg.removeIntervalRightBoundary

tg.removeIntervalRightBoundary
tg.setTierName

tg.setTierName
tg.write

tg.write
col.read

col.read
as.pt

as.pt
as.snd

as.snd
detectEncoding

detectEncoding
as.pitch

as.pitch
formant.cut

formant.cut
as.formant

as.formant
as.tg

as.tg
col.write

col.write