Read from txt file in Praat - “File not recognized” error

less than 1 minute read

Published:

Praat is a great tool for analysing speech data, but I recently ran into a frustrating problem. Whenever I tried to open a txt file (a vector of numbers) in Praat, I’d get this error: File not recognized. File not finished. Praat-read-from-file-error After asking around among my fellow PhD students, I found out what I was missing: a header that tells Praat how to read txt files. The quickest fix is to add the following header to a text file in your favourite text editor: If you’d rather automate it, a bit of scripting saves a lot of time. So I wrote a function (txt2praat.R) that appends this header to the original text file and writes the result to a new one. You can use the function in the following way: txtfile <- file.choose() txt2praat(txtfile, testfile-modified)

These commands create a txt file (testfile - modified) with the short header prepended. That file then opens in Praat without the error. Praat-testfile-modified