Sociophonetics Book Cover

[ Home | Authors | Resources | Links ]

[ Resources: Audio | Figures | Scripts & Code ]

Scripts & Code

Some sample scripts are available here for undertaking basic vowel and sibilant analysis in Praat. See the Figures page for additional examples of R code (code is provided there to generate several of the figures presented in the book). Many Praat scripts and R resources are available online, see the Links page for pointers to additional good resources.

You may need to right-click links to files to download or save the files to your computer.

Vowel Analysis

Extract_Formants_Labeled_Audio_Nov2020.praat
A Praat script intended to be used with a Sound+TextGrid tier with the vowels labeled in the TextGrid. (Whatever you have selected in the TextGrid will be stored as the label for the measurement.) The script supports several measurement point options and records Praat’s formant settings along with its extracted data. You can customize this script for other measurement points or use-cases. To use, open this script from within the Praat Editor window containing your Sound file and TextGrid (not the main Objects window).

Extract_Formants_Unlabeled_Audio_Nov2020.praat
A Praat script intended for use when working in a Sound file with no labels. The script supports several measurement point options and records Praat’s formant settings along with its extracted data. You can customize this script for other measurement points or use-cases. To use, open this script from within a Praat Editor window containing your Sound file (not the main Objects window).

Process_Extract_Formants_Scripts_Results_Starter_Dec2020.R
A simple R script as an example of reading in data from the above scripts and pulling out the columns needed for Vowels.R or the NORM website (http://lingtools.uoregon.edu/norm/). Also see R code in the Figures page for examples of vowel plotting from such a file.

Generate_Pillai+ED_Measures_Dec2020.R
An R script that provides an example for generating speaker-level measures (Pillai and Euclidean distance) and for making vowel plots with some additional annotation. This is designed to be used with one of the small datasets provided on the Figures page.

Sibilant Analysis

Edit January 2023: Corrected an error in the phrasing in the description of the pass filtering, below and in the comments at the top of the scripts; no actual changes to the scripts themselves.

Extract_SibilantMeasures_Labeled_Audio_Nov2020.praat
A Praat script intended to be used with a Sound+TextGrid tier with the sibilant segments labeled in the TextGrid. (Whatever you have selected in the TextGrid will be stored as the label for the measurement.) The script extracts COG, St. Dev., Skewness, Kurtosis, Spectral Peak, and Spectral Slope for a central span of time within a selected sibilant segment. You can customize this script for other measurement points or use-cases. To use, open this script from within the Praat Editor window containing the Sound file and TextGrid (not the main Objects window). Note this script is used from within the Editor window but the measures it extracts are generated from functions available outside the Editor; it thus can serve as an example of how to use an Editor script to run processes on extracted selections in Praat.

Extract_SibilantMeasures_Unlabeled_Audio_Nov2020.praat
A Praat script intended for use when working in a Sound file with no labels. The script is similar to the script above but labels the recorded sound based on the user’s response to a prompt in the initial form. To use, open this script from within a Praat Editor window containing your Sound file (not the main Objects window).

Note: As mentioned in opening comments to the above sibilant scripts, you most likely want to apply some band filter before extracting sibilant measures using scripts like the above (such as with a high pass of 1,000 Hz and a low pass of 16,000 Hz). The scripts do not apply filters to the audio, but this can be done simply in Praat by selecting the sound file in the Object window and executing “Filter (pass Hann band)…” from the “Filter” menu before extracting the individual token-level measurements in the Editor. You can also script a filtering process with the following simple command, in an Object (not Editor) script: Filter (pass Hann band)... 1000 16000 100


     © Tyler Kendall & Valerie Fridland, Last Mod: January 25, 2023