# This Praat script will get F0 value every 10% from all wav files in a directory. # Input: wav and TextGrid (must have the same name) # Date: 26 January 2008 # Author: MATSUURA, Toshio #form form Get F0 at regular interval positive number_of_sampling_point 10 endform #Read files Create Strings as file list... wavlist *.wav Create Strings as file list... gridlist *.TextGrid n = Get number of strings for i to n clearinfo #pitch extraction select Strings wavlist filename$ = Get string... i Read from file... 'filename$' soundname$ = selected$ ("Sound") To Pitch... 0.01 75 400 output$ = "'soundname$'.Pitch" Write to binary file... 'output$' #get intervals select Strings gridlist gridname$ = Get string... i Read from file... 'gridname$' int=Get number of intervals... 1 #calculation of duration for j from 1 to 'int' select TextGrid 'soundname$' label$ = Get label of interval... 1 'j' printline ['label$'] durStart = Get starting point... 1 'j' durEnd = Get end point... 1 'j' duration = durEnd - durStart #pitch extraction for k from 0 to number_of_sampling_point fvalue = duration / number_of_sampling_point * k + durStart select Pitch 'soundname$' vofPitch = Get value at time... 'fvalue' "Hertz" Linear printline 'j','k','fvalue','vofPitch' endfor endfor fappendinfo 'soundname$'.csv endfor