Skip to content

Instantly share code, notes, and snippets.

@fauxneticien
Created October 5, 2016 10:39
Show Gist options
  • Save fauxneticien/33f8895892ffc0f4f44c72361856aabf to your computer and use it in GitHub Desktop.
Save fauxneticien/33f8895892ffc0f4f44c72361856aabf to your computer and use it in GitHub Desktop.
Generate a CSV file of formant data using Praat
# User Praat formant tracker with default settings
#
# Arguments
# input_file: Full file path to location of .wav file
# output_file: Full file path and file name, .csv file recommended
#
#
# Sample usage from command line (OS X)
# /Applications/Praat.app/Contents/MacOS/Praat --run "/Users/Nay/get_formants_as_csv.praat" "/Users/Nay/Desktop/sandboxes/b001_file01.wav" "/Users/Nay/Desktop/sandboxes/b001_file01.csv"
#
# Sample usage from R, for OS X (re-use line above):
# system("/Applications/Praat.app/Contents/MacOS/Praat --run ...")
#
# http://www.fon.hum.uva.nl/praat/manual/Scripting_6_9__Calling_from_the_command_line.html
form Test command line calls
sentence input_file
sentence output_file
endform
Read from file: input_file$
To Formant (burg): 0, 5, 5500, 0.025, 50
Down to Table: "no", "yes", 6, "no", 3, "yes", 3, "yes"
Save as comma-separated file: output_file$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment