Praat

Below you will find a list of praat scripts that I put together, and a tutorial on measuring F0 and formants with ProsodyPro and FormantPro, and a list of problems commonly encountered in using praat scripts. Feel free to email me if you run into problems/bugs.

I am heavily indebted to Mauricio Figueroa (now at Universidad de Concepción, Chile) for his Praat scripting workshop at Cambridge, 2015, and for his excellent Praat syntax highlighter for Sublime Text, which makes scripting so much easier.

Home-made praat scripts

[Production_stimuli_presentation.praat]
This is my go-to script for presenting production stimuli. All you need to provide is a txt file of a word list. The script will randomise your list and present words one by one for recording, and save the word list in the order as presented. You can set the carrier phrase and the number of repetitions.
[Automatic_textgrid_labelling.praat]
Combining powerfully with [Production_stimuli_presentation.praat.praat], this script labels a textgrid with information from a word list text file, to save you from the trouble of typing every interval manually. The ideal workflow for creating an annotated textgrid for a recording is to: prepare a text file, each word each line; create a textgrid, and segment the boundary of each interval; use this script to fill the textgrid with labels from your word list.
[Get_duration.praat]
This script measures the durations of filled intervals for all textgrids in a folder. These durations are stored in a resulting textfile. You can select which tier of the textgrids to measure.
[resample_all.praat]
This script resamples all files within a folder. You can specify the new sample rate. This allows you to concatenate files that otherwise have different sample rates and cannot be combined. Lowering sample rates also reduces the file size.
[Convert_to_mono.praat]
This script converts all two-channel wav files into mono-channel files. This allows you to concatenate files that otherwise have different channels and cannot be combined. Removing one channel also halves the file size.
[Scale_amplitude_peak.praat ]
This script scales all files in a directory to a common amplitude peak. Essentially, they are scaled to become equally loud, which is useful if you want to play these files in experiments or in presentations.
[Concatenate_all_into_pairs.praat]
This script is useful for creating experimental stimuli. It concatenates all sounds in a directory into pairs, with a silent interval in between, the duration of which you can specify. For example, if you have a.wav, b.wav, c.wav, you will obtain 6 combinations:
a_b.wav, a_c.wav, b_c.wav
b_a.wav, c_a.wav, c_b.wav
You will also get a_a.wav, b_b.wav, c_c.wav if you click "yes" to combine identical files.
Within each pair, the two sounds are separated by a silent interval.
[Concatenate_identical_only.praat]
This script has minor variation from the last one. In this you have the option to only combine identical files. If you have a.wav, b.wav, c.wav, you will obtain 3 combinations under the option:
a_a.wav, b_b.wav, c_c.wav
Within each pair, the two sounds are separated by a silent interval.
[Attach_suffix_to_base_sounds.praat]
This script takes all sounds in one directory, and attach sounds in the other directory to the former. For example, if you have in
directory One: A.wav, B.wav, C.wav
directory Two: a.wav, b.wav
You will end up with: A_a.wav, B_a.wav, C_a.wav, A_b.wav, B_b.wav, C_b.wav
This is useful if you have, say, a suffix sound which you want to attach to all basic sounds
[Concatenate_all_into_one.praat]
This script concatenates all sounds in a directory into a combined file, with a silent interval in between each constituent file, the duration of which you can specify. For example, if you have a.wav, b.wav, c.wav, you will obtain one file in which "a" is followed by "b", followed by "c", all separated by a silent interval.
[Save_selected_sounds.praat]
This script allows you to batch save selected sound files in your praat workspace to a folder you specify. This allows you to batch process files without relying too much on other scripts. For example, you can drag a number of sounds into Praat, remove noise (filter - remove noise), then use this script to save the resulting files.
[Select_sound_process_then_save.praat]
This script adds importing function to [Save_selected_sounds.praat]. It sends all wav files from a folder of your choice to the Praat objects window. After processing those sounds, you can then select some or all of them and save these to a specified folder. See detailed instruction contained in the script.

Measuring pitch and formants

To measure pitch (and voice quality) and formants, I recommend Prof Yi Xu's ProsodyPro and FormantPro, respectively. Below is a very brief description of the workflow, assuming you already have annotated textgrids with your sound files. You can watch a 90-second screencast of me going through these steps.

A screencast of basic ProsodyPro operations

  • Bug reported: FormantPro and ProsodyPro may not function normally if textgrids intervals contain underline (thanks to Sam Karasek).


  • Common causes of problems in running Praat Scripts