1

I have a praat script:

#!/usr/bin/praat --run

form Add VOT
     sentence Filename_of_textgrid /mount/arbeitsdaten31/studenten1/vernonhn/Thesis/MASTER_code/autovot-master/experiments/data/ALC/train/0422047037_h_00.TextGrid
endform

# check if absolute path
if startsWith (filename_of_textgrid$, "/") 
   # absolute, so just copy the value into the shortened variable
   filename$ = filename_of_textgrid$
else
   # relative, concatenate with shellDirectory
   filename$ = shellDirectory$ + "/" + filename_of_textgrid$
endif


textgrid = Read from file: filename$

Insert interval tier: 2, "VOT"
numberOfIntervals = Get number of intervals: 1
for intervalNumber from 1 to numberOfIntervals
    label$ = Get label of interval: 1, intervalNumber
    if ( label$ = "k" ) or ( label$ = "p" ) or ( label$ = "t" )
        start = Get start time of interval: 1, intervalNumber
        end = Get end time of interval: 1, intervalNumber
                Insert boundary: 2, start
                Insert boundary: 2, end
                intervalNumberNewTier = Get interval at time: 2, start
                Set interval text: 2, intervalNumberNewTier, label$
   endif
endfor

Save as text file: filename$ + ".for.autoVOT"

removeObject: textgrid

Can anyone tell me why the line textgrid = Read from file: filename$ gives an error when i try to iterate over files?

1
  • There are a lot of mistakes in your script. You can find many scripts available online showing how read a file with PRAAT language. – amegnunsen Jul 31 '19 at 17:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.