Category Archives: Praat Scripts

PraatDocExtractor

This program will extract documentation strings in a Praat script and write them to a Markdown file, in the fashion of Doxygen, Roxygen, and Javadoc. In particular, the commenting style is inspired by Roxgygen’s, as Praat comments already use the octothorpe to denote comments.

For the sake of convenience, there are two implementations, one in Python 3, and the other the Praat scripting language.

The GitLab repository is available at https://gitlab.com/maetshju/PraatDocExtractor.

Praat Force-Aligned Word Presenter

Developed for use in pre-processing stimuli for experiments, this Praat script will present all WAV and TextGrid pairs in a directory that have been passed through a forced aligner tool. This allows a user to more quickly and regularly check the alignment of their files, and stores the results of the alignment in a file as well for later reference.

This script is licensed under version 2 of the GNU General Public License.

Item Extractor

This is a script that extracts items coded on an interval tier. It extracts labeled items in the tier and saves them as a WAV file with the label as the file name.

  1. To run this script, open the textgrid and sound file in Praat.
  2. Then, highlight the relevant textgrid and soundfile.
  3. Go to the File menu and choose Open script… You will get a dialogue box with the script in it.
  4. Specify the tier number where you have labeled your items.
  5. Specify the name of the file (the script will save the output file in the same directory as the script).
  6. Press ok and the script should do the rest of the work.
  7. All of the new sound files will be saved in the same directory as the script.

Download

Get the average intensity for all files in a directory

This script will open all the files in the subfolders within a given directory and take the average intensity of the words on a given duration tier. The parent “path” folder may have several subfolders within it. This script will open all of these subfolders and processes all of the files within them. The output will contain intensity measurements for all the files within each subfolder and will be saved in one .txt document in the parent “path” folder.

by Michelle Sims, Alberta Phonetics Lab, University of Alberta, May 2012

Resave all the .wav files in a directory/subdirectories

If you are having problems with using your .wav files in another script, or if Praat errors while trying to open/manipulate a .wav file, use this script. This script will open all the .wav files in a given folder and resave them. The parent folder may have many subfolders, this script will open the .wav files in each subfolder and resave them in their original place (rewrite).

by Michelle Sims, Alberta Phonetics Lab, University of Alberta, May 2012

Trim .wav files to zero crossings

This Praat script will open all .wav files in the subfolders of a parent directory and edit them so that they begin and end on the first and last zero crossing. The parent “path” folder may have several subfolders within it, this script will open all of these subfolders and processes all of the files within them. These newly edited files will be saved in a subfolder within each subfolder with the prefix “zero_cross-” added to the name of the original files.

by Michelle Sims, University of Alberta, Alberta Phonetics Lab, May 2012

Calculate the local speaking rate from a corpus

This script will calculate the local speaking rate in a corpus for the words on a list you provide. Note: you must have an annotated textgrid 2 durational tiers: words on one tier and segments on another. You need to provide the list of words you want the local speaking rate for. This must be in a .txt format, single column, one word per line. No “/t” or “/s” or csv formats. Put all corpus files in a folder. This parent folder may have many subfolders, this script will open your .textgrid files within these subfolders. The script searches for the words on your wordlist and calculates the local speaking rate in segments/second based on the two words before and after the wordlist word. This is all customizable. The output file will be saved in the parent folder with a listing of all occurrences throughout the corpus of each word on your wordlist, and their local speaking rate. See hashtag comments in the code for customizable options.


by Michelle Sims, Alberta Phonetics Lab, University of Alberta, May 2012