Description Usage Arguments Details Value Author(s) References See Also Examples
This function takes a Pitch object textfile, reads it into R in a quick and efficient way, and returns the requested information.
1 | ReadPitch( File, Return = "Frames" )
|
File |
Path to a Pitch object stored on one's computer. This must be stored in Praat's "text" format (and not "short (text)" or "binary" format). This file path does *not* have to be a full path, and it *can* have spaces in it. |
Return |
Specifies the kind of information about the Pitch object to be brought into R. See "Details" section below. |
Three values are accepted for Return
:
Header | All the info from the header (in the same order) |
Frames | Information about each frame (and each frame's highest-ranking candidate) |
Candidates | Information about every candidate in each frame |
The default is "Frames"
since it represents the most common use case.
Return="Header"
:A list with the following entries: FileStartTime
, FileEndTime
, nFrames
, TimeStep
, FirstTime
, Ceiling
, MaxNumberCandidates
Return="Frames"
:A dataframe with the following columns: Time
, Frequency
, Intensity
, Strength
, nCandidates
Return="Candidates"
:A dataframe with the following columns: nthFrame
, nthCandidate
, Frequency
, Strength
The default is "Frames"
since it represents the most common use case.
Aaron Albin (http://www.aaronalbin.com/)
This function is referenced on page 55 of
Albin, A. (2015). Typologizing native language influence on intonation in a second language: Three transfer phenomena in Japanese EFL learners. (Doctoral dissertation). Indiana University, Bloomington. http://dx.doi.org/10.5967/K8JW8BSC
This function is called from within RichVisualization
and F0RangeFinder
in order to generate the F0 tracks.
For creating Pitch objects in the first place, see ToPitch
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # Create path to sample Pitch object textfile ('HelloWorld.Pitch') included in the package
PitchPath = paste(R.home("library"),"intonation","HelloWorld.Pitch",sep="/")
# Return the information contained in the header of the Pitch object
# More specifically, this queries the file's start/end time, the total number of frames, the time step, the timestamp of the first sample, the F0 ceiling, and the maximum number of candidates per frame.
Header = ReadPitch( PitchPath, Return="Header" )
print(Header) # Inspect the results
# Return information about the frames in the Pitch object.
# More specifically, this queries the time, frequency, intensity, strength, and number of candidates in each frame.
Frames = ReadPitch( PitchPath, Return="Frames" )
fix(Frames) # Inspect the results
# Return="Frames" is the default, hence the previous line is equivalent to
Frames = ReadPitch( PitchPath )
# Return information about the F0 candidates in the Pitch object.
# More specifically, this queries which frame each candidate is in as well as the candidate ranking, frequency, and strength of each candidate.
Candidates = ReadPitch( PitchPath, Return="Candidates" )
fix(Candidates) # Inspect the results
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.